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

lightprobe_grid_fill_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: ced8e7f4f013d5679b0198e8deda054ccf1e90b4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
uniform sampler2DArray irradianceGrid;

out vec4 FragColor;

void main()
{
#if defined(IRRADIANCE_SH_L2)
	const ivec2 data_size = ivec2(3, 3);
#elif defined(IRRADIANCE_CUBEMAP)
	const ivec2 data_size = ivec2(8, 8);
#elif defined(IRRADIANCE_HL2)
	const ivec2 data_size = ivec2(3, 2);
#endif
	ivec2 coord = ivec2(gl_FragCoord.xy) % data_size;
	FragColor = texelFetch(irradianceGrid, ivec3(coord, 0), 0);

	if (any(greaterThanEqual(ivec2(gl_FragCoord.xy), data_size))) {
		FragColor = vec4(0.0, 0.0, 0.0, 1.0);
	}
}