Improve color handling approach
This commit is contained in:
parent
e53ca905af
commit
f29293c475
22 changed files with 259 additions and 181 deletions
|
|
@ -6,17 +6,23 @@ uniform float maxMinDistance;
|
|||
uniform float distanceNdcPixelSize;
|
||||
varying vec2 position;
|
||||
|
||||
uniform sampler2D palette;
|
||||
|
||||
vec4 readFromPalette(int index) {
|
||||
return texture2D(palette, vec2((float(index) + 0.5) / {paletteSize}, 0.5));
|
||||
}
|
||||
|
||||
|
||||
{macroDefinitions}
|
||||
|
||||
{declarations}
|
||||
|
||||
void main() {
|
||||
float minDistance = maxMinDistance;
|
||||
float color = 0.0;
|
||||
|
||||
float objectMinDistance, objectColor;
|
||||
float minDistance = maxMinDistance, objectMinDistance;
|
||||
vec4 color = {backgroundColor};
|
||||
vec4 objectColor;
|
||||
|
||||
{functionCalls}
|
||||
|
||||
gl_FragColor = vec4(minDistance * 8.0, color, 0.0, 1.0);
|
||||
gl_FragColor = vec4(color.rgb, minDistance * 8.0);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue