varying vec4 Color; varying float LightIntensity; uniform float Density; uniform float Frequency; void main() { float s = gl_TexCoord[0].s; float t = gl_TexCoord[0].t; float sf = s * Frequency; float tf = t * Frequency; vec2 st = gl_TexCoord[0].st; vec2 stf = st * Frequency; // if( fract( sf ) >= Density && fract( tf ) >= Density ) if( all( fract(stf) >= vec2(Density,Density) ) ) discard; gl_FragColor = vec4( LightIntensity*Color.rgb, 1. ); }