publish: Add sketch 5, "glow lines" Fix an issue with the displacement fragment shader

generated from commit 5e6d27e70417d909df95696e2e938207e4b3de7a
This commit is contained in:
Joshua Seigler 2019-11-12 14:00:24 -05:00
parent b730b3e019
commit fef90e585c
10 changed files with 38 additions and 7 deletions

View file

@ -13,12 +13,14 @@ uniform float u_intensity;
void main() {
vec2 uv = vTexCoord;
// the texture is loaded upside down and backwards by default so lets flip it
uv = 1.0 - uv;
// get the displacement map as a vec4 using texture2D
vec4 mapTex = texture2D(u_map, uv);
// the texture is loaded upside down and backwards by default so lets flip it
// uv = 1.0 - uv;
uv[1] = 1.0 - uv[1];
// lets get the average color of the rgb values
float avg = dot(mapTex.rgb, vec3(0.33333));