Vertex shader: #version 120 void main() { float m; vec3 r; vec4 ec_pos = gl_ModelViewMatrix * gl_Vertex; gl_Position = gl_ProjectionMatrix * ec_pos; ec_pos /= ec_pos.w; vec3 normal = normalize(gl_NormalMatrix * gl_Normal); vec3 ambient = gl_LightModel.ambient.xyz; vec3 diffuse = vec3(0.0); vec4 specular = vec4(0.0); vec3 dir, dst; float att, t; gl_FrontColor.xyz = gl_FrontMaterial.ambient.xyz * ambient + gl_FrontMaterial.diffuse.xyz * diffuse + gl_FrontMaterial.emission.xyz; gl_FrontColor.w = gl_FrontMaterial.diffuse.w; gl_FrontSecondaryColor = gl_FrontMaterial.specular * specular; gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0; gl_TexCoord[1] = gl_TextureMatrix[1] * gl_MultiTexCoord1; gl_TexCoord[2] = gl_TextureMatrix[2] * gl_MultiTexCoord2; gl_TexCoord[3] = gl_TextureMatrix[3] * gl_MultiTexCoord3; gl_TexCoord[4] = gl_TextureMatrix[4] * gl_MultiTexCoord4; gl_TexCoord[5] = gl_TextureMatrix[5] * gl_MultiTexCoord5; gl_TexCoord[6] = gl_TextureMatrix[6] * gl_MultiTexCoord6; gl_TexCoord[7] = gl_TextureMatrix[7] * gl_MultiTexCoord7; gl_FogFragCoord = ec_pos.z; } fragment shader: #version 120 vec4 tmp0, tmp1; vec4 ret; vec4 arg0, arg1, arg2; uniform sampler2D ps_sampler0; vec4 tex0; uniform sampler2D ps_sampler1; vec4 tex1; uniform vec4 specular_enable; void main() { tex0 = clamp(texture2D(ps_sampler0, gl_TexCoord[0].xy), 0.0, 1.0); tex1 = clamp(texture2D(ps_sampler1, gl_TexCoord[1].xy), 0.0, 1.0); ret.xyz = tex0.xyz; ret.w = gl_Color.w; ret.xyz = clamp(tex1.xyz + ret.xyz, 0.0, 1.0); ret.xyz = clamp(ret.xyz + gl_Color.xyz, 0.0, 1.0); gl_FragData[0] = gl_SecondaryColor * specular_enable + ret; float Fog = (gl_Fog.end - gl_FogFragCoord) / (gl_Fog.end - gl_Fog.start); gl_FragData[0].xyz = mix(gl_Fog.color.xyz, gl_FragData[0].xyz, clamp(Fog, 0.0, 1.0)); }