bgfx/examples/37-gpudrivenrendering/fs_gdr_instanced_indirect_rendering.sc
Branimir Karadžić 5d2f256dc4 Cleanup.
2018-03-04 21:33:21 -08:00

25 lines
447 B
Python

$input v_materialID
/*
* Copyright 2018 Kostas Anagnostou. All rights reserved.
* License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
*/
#include "../common/common.sh"
uniform vec4 u_colour[50];
void main()
{
vec4 colour = u_colour[uint(v_materialID)];
if ( colour.w < 1.0f )
{
//render dithered alpha
if ( (int(gl_FragCoord.x) % 2) == (int(gl_FragCoord.y) % 2) )
discard;
}
gl_FragColor = vec4( colour.xyz,1 );
}