Improve color handling approach
This commit is contained in:
parent
e53ca905af
commit
f29293c475
1 changed files with 259 additions and 181 deletions
|
|
@ -6,21 +6,28 @@ uniform float maxMinDistance;
|
|||
uniform float distanceNdcPixelSize;
|
||||
in vec2 position;
|
||||
|
||||
uniform sampler2D palette;
|
||||
|
||||
#define WEBGL2_IS_AVAILABLE
|
||||
|
||||
vec4 readFromPalette(int index) {
|
||||
return texture(palette, vec2((float(index) + 0.5) / {paletteSize}, 0.5));
|
||||
}
|
||||
|
||||
{macroDefinitions}
|
||||
|
||||
{declarations}
|
||||
|
||||
out vec2 fragmentColor;
|
||||
layout(location = 0) out vec4 fragmentColor;
|
||||
layout(location = 1) out float distanceValue;
|
||||
|
||||
void main() {
|
||||
float minDistance = maxMinDistance;
|
||||
float color = 0.0;
|
||||
|
||||
float objectMinDistance, objectColor;
|
||||
float minDistance = maxMinDistance, objectMinDistance;
|
||||
vec4 color = {backgroundColor};
|
||||
vec4 objectColor;
|
||||
|
||||
{functionCalls}
|
||||
|
||||
fragmentColor = vec2(minDistance, color);
|
||||
distanceValue = minDistance;
|
||||
fragmentColor = color;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue