This repository has been archived on 2023-10-09. You can view files and clone it, but cannot push or open issues or pull requests.
Files
blender-archive/source/blender/draw/engines/eevee/shaders/update_noise_frag.glsl
Campbell Barton e12c08e8d1 ClangFormat: apply to source, most of intern
Apply clang format as proposed in T53211.

For details on usage and instructions for migrating branches
without conflicts, see:

https://wiki.blender.org/wiki/Tools/ClangFormat
2019-04-17 06:21:24 +02:00

19 lines
426 B
GLSL

uniform sampler2D blueNoise;
uniform vec3 offsets;
out vec4 FragColor;
#define M_2PI 6.28318530717958647692
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);
}