1
0
Fork 0

No changing gl_Vertex, ATI/AMD may not tolerate it

This commit is contained in:
Thorsten Renk 2014-10-13 08:32:23 +03:00
parent f8f8e9b709
commit 52dc0e9e69
2 changed files with 14 additions and 2 deletions

View file

@ -490,6 +490,11 @@
<type>int</type>
<value><use>display_ysize</use></value>
</uniform>
<uniform>
<name>raise_vertex</name>
<type>bool</type>
<value> <use>raise_vertex</use></value>
</uniform>
<uniform>
<name>texture</name>
<type>sampler-2d</type>

View file

@ -88,12 +88,19 @@ void main()
steepness = dot(normalize(gl_Normal), vec3 (0.0, 0.0, 1.0));
grad_dir = normalize(gl_Normal.xy);
if (raise_vertex) gl_Vertex.z+=0.1;
vec4 pos = gl_Vertex;
if (raise_vertex)
{
pos.z+=0.1;
gl_Position = gl_ModelViewProjectionMatrix * pos;
}
else gl_Position = ftransform();
// this code is copied from default.vert
//vec4 ecPosition = gl_ModelViewMatrix * gl_Vertex;
gl_Position = ftransform();
//gl_Position = ftransform();
gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
normal = gl_NormalMatrix * gl_Normal;
//nvec = (gl_NormalMatrix * gl_Normal).xy;