Fix some shaders not building with mesa
git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@14775 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
parent
7f51c9737b
commit
5f23483bd9
@ -17,7 +17,7 @@ void main() {
|
||||
|
||||
float d = distance(center, xpos.xyz);
|
||||
if (d > r) discard;
|
||||
float att = 200.0 / (4 * 3.14 * d * d);
|
||||
float att = 200.0 / (4. * 3.14 * d * d);
|
||||
|
||||
vec3 norm = texture2D(ntex, texc).xyz;
|
||||
norm = (norm - 0.5) * 2.0;
|
||||
@ -28,7 +28,7 @@ void main() {
|
||||
float NdotL = max(0.0, dot(norm, -L)) * att;
|
||||
// Reflected light dir
|
||||
vec3 R = reflect(-L, norm);
|
||||
float RdotE = max(0.0, dot(R, normalize(xpos)));
|
||||
float RdotE = max(0.0, dot(R, normalize(xpos.xyz)));
|
||||
float Specular = pow(RdotE, spec);
|
||||
|
||||
gl_FragColor = vec4(NdotL * col, Specular + 0.001); // Irrlicht force alpha test, can't be 0
|
||||
|
@ -5,7 +5,7 @@ uniform vec2 screen;
|
||||
|
||||
void main()
|
||||
{
|
||||
vec2 xy = gl_FragCoord / screen;
|
||||
vec2 xy = gl_FragCoord.xy / screen;
|
||||
float FragZ = gl_FragCoord.z;
|
||||
float EnvZ = texture2D(normals_and_depth, xy).a;
|
||||
vec4 FragmentPos = invproj * (2. * vec4(xy, FragZ, 1.0) - 1.);
|
||||
|
@ -32,7 +32,7 @@ void main() {
|
||||
|
||||
float NdotL = max(0.0, dot(norm, L));
|
||||
vec3 R = reflect(L, norm);
|
||||
float RdotE = max(0.0, dot(R, normalize(xpos)));
|
||||
float RdotE = max(0.0, dot(R, normalize(xpos.xyz)));
|
||||
float Specular = pow(RdotE, 200);
|
||||
|
||||
vec3 outcol = NdotL * col;
|
||||
|
Loading…
x
Reference in New Issue
Block a user