bgfx/examples/39-assao/fs_assao_gbuffer.sc

23 lines
487 B
Python
Raw Normal View History

2018-12-15 00:09:37 +03:00
$input v_normal, v_texcoord0
/*
* Copyright 2018 Attila Kocsis. All rights reserved.
2022-01-15 22:59:06 +03:00
* License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
2018-12-15 00:09:37 +03:00
*/
#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);
}