#version 120
uniform sampler2D tex;
varying vec2 texCoord;
void main()
{
vec4 texAlbedo = texture2D(tex, texCoord);
vec3 albedo = mix(gl_Color.rgb, texAlbedo.rgb, texAlbedo.a);
gl_FragColor = vec4(albedo, gl_Color.a);
}
#version 120
varying vec3 worldNormal;
varying vec3 worldPos;
uniform vec3 camPos;
uniform mat4 obj2World;
uniform mat4 world2Cam;
varying vec2 texCoord;
vec4 viewDelta;
void main()
{
worldPos = (obj2World * vec4(gl_Vertex.xyz, 1.0f)).xyz;
worldNormal = ((obj2World * vec4(gl_Normal.xyz, 0.0f)).xyz);
if(length(gl_Normal.xyz) < 1.1f)
worldNormal.xyz = normalize(worldNormal.xyz);
viewDelta.xyz = worldPos - camPos;
viewDelta.w = length(viewDelta.xyz);
viewDelta.xyz = -normalize(viewDelta.xyz);
gl_Position = gl_ProjectionMatrix * world2Cam * vec4(worldPos, 1.0f);
gl_FrontColor = gl_Color;
texCoord = gl_MultiTexCoord0.st;
}
This will undoubtedly look worse than with shaders Off and may or may not be slower or faster. Why are you using Minimum instead of Off when you have performance problems on Minimum?