bgfx/examples/39-assao/fs_assao_gbuffer.sc
Бранимир Караџић 4581f14cd4 Happy New Year!
2022-01-15 11:59:06 -08:00

23 lines
487 B
Scala

$input v_normal, v_texcoord0
/*
* Copyright 2018 Attila Kocsis. All rights reserved.
* License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "../common/common.sh"
SAMPLER2D(s_albedo, 0);
void main()
{
vec3 normalWorldSpace = v_normal;
// Write normal
gl_FragData[0].xyz = normalWorldSpace.xyz; // Normal is already compressed to [0,1] so can fit in gbuffer
gl_FragData[0].w = 0.0;
// Write color
gl_FragData[1] = texture2D(s_albedo, v_texcoord0);
}