Add palette system

This commit is contained in:
schmelczerandras 2020-09-23 16:27:02 +02:00
parent f60ae06f59
commit 98d1fc9ca2
19 changed files with 196 additions and 113 deletions

View file

@ -12,19 +12,16 @@ uniform vec2 squareToAspectRatioTimes2;
uniform float shadingNdcPixelSize;
uniform float shadowLength;
uniform sampler2D distanceTexture;
uniform sampler2D palette;
in vec2 position;
in vec2 uvCoordinates;
uniform vec3 ambientLight;
vec3[{colorCount}] colors = vec3[](
{palette}
);
float getDistance(in vec2 target, out vec3 color) {
vec4 values = texture(distanceTexture, target);
color = colors[int(values[1])];
color = texture(palette, vec2(values[1], 0.0)).rgb;
return values[0];
}