September 2018
Intermediate to advanced
472 pages
15h 36m
English
To discard fragments based on alpha data from a texture, use the following steps:
layout(binding=0) uniform sampler2D BaseTex; layout(binding=1) uniform sampler2D AlphaTex;
void main() { vec4 alphaMap = texture( AlphaTex, TexCoord ); if(alphaMap.a < 0.15 ) discard; else { if( gl_FrontFacing ) { FragColor = vec4( blinnPhong(Position,normalize(Normal)), ...Read now
Unlock full access