Welcome to mirror list, hosted at ThFree Co, Russian Federation.

update_noise_frag.glsl « shaders « eevee « engines « draw « blender « source - git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 0c01c46c2ba95dec2f36d827ebab989b4f4def72 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18

#pragma BLENDER_REQUIRE(common_math_lib.glsl)

uniform sampler2D blueNoise;
uniform vec3 offsets;

out vec4 FragColor;

void main(void)
{
  vec3 blue_noise = texelFetch(blueNoise, ivec2(gl_FragCoord.xy), 0).xyz;

  float noise = fract(blue_noise.y + offsets.z);
  FragColor.x = fract(blue_noise.x + offsets.x);
  FragColor.y = fract(blue_noise.z + offsets.y);
  FragColor.z = cos(noise * M_2PI);
  FragColor.w = sin(noise * M_2PI);
}