08-14-2007, 06:39 PM,
|
|
abs1nth
Senior Member
|
Posts: 358
Threads: 5
Joined: Sep 2005
|
|
abs1nth Wrote:modifying the other shaders also makes the shaders compile but it somehow forces vdrift into extremely slow software rendering (although it is pretty ;-)
something must have changed, it doesn't fall back to software anymore, but it also isn't pretty any more:
btw here is the diff: Code: Index: shaders/full/fragment.glsl
===================================================================
--- shaders/full/fragment.glsl (Revision 52)
+++ shaders/full/fragment.glsl (Arbeitskopie)
@@ -10,7 +10,7 @@
//varying vec3 eyecoords;
varying vec3 eyespacenormal;
-uniform vec3 eyelightposition;
+varying vec3 eyelightposition;
varying vec4 ecpos;
varying vec3 viewdir;
Index: shaders/full-nometallic/vertex.glsl
===================================================================
--- shaders/full-nometallic/vertex.glsl (Revision 52)
+++ shaders/full-nometallic/vertex.glsl (Arbeitskopie)
@@ -17,7 +17,7 @@
//set the normal, eyespace normal, and eyespace position
eyespacenormal = normalize(gl_NormalMatrix * gl_Normal);
- normal = (mat3(gl_TextureMatrix[1]) * gl_NormalMatrix) * gl_Normal;
+ normal = (mat3(gl_TextureMatrix[1][0].xyz,gl_TextureMatrix[1][1].xyz,gl_TextureMatrix[1][2].xyz) * gl_NormalMatrix) * gl_Normal;
//normal = vec3(gl_TextureMatrix[1] * (gl_ModelViewProjectionMatrix * gl_Vertex));
//normal = gl_NormalMatrix * gl_Normal;
//normal = gl_Normal;
Index: shaders/full-nospecular/vertex.glsl
===================================================================
--- shaders/full-nospecular/vertex.glsl (Revision 52)
+++ shaders/full-nospecular/vertex.glsl (Arbeitskopie)
@@ -15,6 +15,6 @@
//set the texture coordinates
texcoord_2d = vec2(gl_MultiTexCoord0);
- normal = (mat3(gl_TextureMatrix[1]) * gl_NormalMatrix) * gl_Normal;
+ normal = (mat3(gl_TextureMatrix[1][0].xyz,gl_TextureMatrix[1][1].xyz,gl_TextureMatrix[1][2].xyz) * gl_NormalMatrix) * gl_Normal;
lightposition = normalize(vec3(.1,1.0,.3));
}
|
|
08-15-2007, 07:08 AM,
|
|
abs1nth
Senior Member
|
Posts: 358
Threads: 5
Joined: Sep 2005
|
|
joevenzon Wrote:I don't quite follow, what's the diff for? Do you have the latest SVN code and data? yes
the diff is to to get the shaders compiling on mac os x. remember this?
joevenzon Wrote:but I only modified the full shader. If this compiles for you and makes things work, go ahead and copy & paste to the other shaders and check in (or I can). i posted the remaining modifications to get the shaders to compile here.
joevenzon Wrote:The artifacts look like shadow aliasing, which shouldn't be there because I have generous polygon offsets set when rendering the shadow pass. What kind of 3D card do you have? ATI Radeon X1900 XT 512MB
|
|
08-15-2007, 10:34 PM,
|
|
joevenzon
Administrator
|
Posts: 2,679
Threads: 52
Joined: Jun 2005
|
|
According to some google hits, ATI cards have issues with the glPolygonOffset function. If you tweak the values in line 1240 (increase both numbers) do the artifacts eventually go away?
This is the line to tweak:
Code: glPolygonOffset(1.0,1.0);
Also the full-no* shader files aren't used anymore; I've just removed them from SVN. Also, I'm not sure why you had to change that uniform to varying; it's a uniform! Were you getting any useful error, or just some generic compile error?
|
|
09-13-2007, 05:36 PM,
|
|
abs1nth
Senior Member
|
Posts: 358
Threads: 5
Joined: Sep 2005
|
|
joevenzon Wrote:According to some google hits, ATI cards have issues with the glPolygonOffset function. If you tweak the values in line 1240 (increase both numbers) do the artifacts eventually go away?
This is the line to tweak:
Code: glPolygonOffset(1.0,1.0);
nah that didn't work :-(
joevenzon Wrote:Also, I'm not sure why you had to change that uniform to varying; it's a uniform! Were you getting any useful error, or just some generic compile error? Code: ----- Start Shader Log for full -----
INTERNAL ERROR: Symbol 'eyelightposition' is bound as uniform but token type is not local param.
INTERNAL ERROR: Mismatch between compiler's and linker's count of vertex shader local params.
----- End Shader Log for full -----
|
|
12-28-2007, 04:54 PM,
|
|
abs1nth
Senior Member
|
Posts: 358
Threads: 5
Joined: Sep 2005
|
|
i would, but data revision 138 broke shaders on the mac again ;-)
Code: shaders/depthgen/fragment.glsl:
Error on line 13: assigning non-constant to 'const 4-component vector of float' (hint: '=')
const vec4 tu0color = texture2D(tu0_2D, texcoord);
EDIT:
but if i remove the "const" to get rid of this error AND remove the line:
Code: lightdotnorm = max(dot(lightposition,normal),0.0);
(in shaders/depthgen/vertex.glsl) to get rid of this warning:
Code: "WARNING: vertex shader writes varying 'lightdotnorm' which is not active. "
the shaders work fine and the problem (from the screenshot) goes away.
btw. i don't think a warning should disable shader usage.
|
|
|