nuclear@20: /* MRT assignments nuclear@20: * 0 - RGB: position nuclear@20: * 1 - RGB: normal nuclear@20: * 3 - RGB: diffuse color, A: shininess str. nuclear@20: * 4 - unused nuclear@20: */ nuclear@20: nuclear@20: uniform sampler2D tex_dif, tex_norm; nuclear@20: nuclear@20: varying vec3 pos, norm; nuclear@16: nuclear@16: void main() nuclear@16: { nuclear@20: vec3 n = normalize(norm); nuclear@20: nuclear@16: vec4 texel = texture2D(tex_dif, gl_TexCoord[0].st); nuclear@20: vec3 diffuse = (gl_FrontMaterial.diffuse * texel).xyz; nuclear@20: vec3 spec = gl_FrontMaterial.specular.xyz; nuclear@20: float sstr = (spec.x + spec.y + spec.z) / 3.0; nuclear@20: nuclear@20: gl_FragData[0] = vec4(pos, 0.0); nuclear@20: gl_FragData[1] = vec4(norm, 0.0); nuclear@20: gl_FragData[2] = vec4(diffuse, sstr); nuclear@20: gl_FragData[3] = vec4(0.0, 0.0, 0.0, 0.0); nuclear@16: }