mirror of
https://github.com/seigler/generative
synced 2025-07-27 07:06:08 +00:00
publish: Add sketch 5, "glow lines" Fix an issue with the displacement fragment shader
generated from commit 5e6d27e70417d909df95696e2e938207e4b3de7a
This commit is contained in:
parent
b730b3e019
commit
fef90e585c
10 changed files with 38 additions and 7 deletions
|
@ -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));
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue