nuclear@0: varying vec3 vpos, norm; nuclear@0: varying vec2 texcoord; nuclear@0: nuclear@0: void main() nuclear@0: { nuclear@0: vec3 n = normalize(norm); nuclear@0: vec3 ldir = normalize(vec3(-0.5, 0.5, 2)); nuclear@0: nuclear@0: float ndotl = max(dot(n, ldir), 0.0); nuclear@0: nuclear@0: vec3 color = vec3(0.8, 0.8, 0.8) * ndotl; nuclear@0: nuclear@0: float hpat = smoothstep(0.49, 0.5, mod(texcoord.x * 8.0, 1.0)); nuclear@0: float vpat = smoothstep(0.49, 0.5, mod(texcoord.y * 8.0, 1.0)); nuclear@0: nuclear@0: float pattern = 0.0; nuclear@0: if((hpat > 0.5 && vpat > 0.5) || (hpat < 0.5 && vpat < 0.5)) { nuclear@0: pattern = 1.0; nuclear@0: } else { nuclear@0: pattern = 0.0; nuclear@0: } nuclear@0: nuclear@0: vec3 tex = vec3(pattern * 0.5 + 0.5); nuclear@0: nuclear@0: nuclear@0: gl_FragColor.rgb = color * tex; nuclear@0: gl_FragColor.a = 1.0; nuclear@0: }