PDA

View Full Version : built in uniforms?



zed
03-05-2005, 12:32 AM
whats the deal with builtin uniforms i was under the impression (from reading the spec) that they were accessable with both vertex and fragment shaders.

but this doesnt work
-- fs --
gl_FragColor = vec4( gl_LightSource[1].diffuse.xyz, 1.0 );

though this does work

-- vs --
varying vec3 light_col;
light_col = gl_LightSource[1].diffuse.xyz;

-- fs --
gl_FragColor = vec4( light_col, 1.0 );

this with gffx 75.90 (also with earlier drivers)

yooyo
03-05-2005, 03:14 AM
It work on my machine (6800U + FW 75.90). Please post your hw spec.

Also.. try it in Shader Designer.

yooyo

zed
03-05-2005, 09:59 AM
strange i have a gffx5900 (same drivers)

i try to startup shader designed and get the error "shader designer needs a(sic) hardware with multitexture support"
so i dont know whats up there, it has worked previously on my machine (havent tried it for a month or so though so dont know what i done to cause it to stop working).
ill redownload it and install it

zed
03-05-2005, 11:04 AM
from the shaderdesigner page
Requirements
- Microsoft.NET Framework 1.1.4322 (only for the windows version)

i uninstalled this a while ago, note to shaderdesigner guys fix the error message :)
23mb download ill download it later and test

Ffelagund
03-05-2005, 11:54 AM
Hello,
If Shader Designer shows this error: "Shader Designer needs hardware with multitexture support", it is most likely caused by a impossiblity of creating a suitable opengl context, returning no one or the MS' one.
This could be caused by a corruption in your drivers, try reinstalling them.

If you do not have installed the .NET runtime, I find very strange that you can run the application; it should crash before the execution.

Also I've experienced this behaviour if MatLab is present in the system (I've tried with different hardware configurations). Many OpenGL applications are unable to create a good OpenGL's RC (not only SD)if MatLab is installed.

zed
03-05-2005, 10:28 PM
This could be caused by a corruption in your drivers, try reinstalling them.yeah that was it


If you do not have installed the .NET runtime, I find very strange that you can run the application; it should crash before the execution.i have a feeling that even though i uninstalled it , it didnt uninstall ie like internet explorer, even though the impression is that its uninstalled its just hidden

i wrote a simple glut app and the light stuff was accessable in the fragment shader (very strange) this with 75.90,

anyways i installed the 70.90 drivers + the light stuff was accesable in the fragment shader in my app, also shaderdesigner program worked (though it crashes when i exit it, which its always done in the past with the error common language runtime debugging services, application has generated an exception that could not be handled)
anyways alls sweet again

Ffelagund
03-06-2005, 01:18 AM
Originally posted by zed:
also shaderdesigner program worked (though it crashes when i exit it, which its always done in the past with the error common language runtime debugging services, application has generated an exception that could not be handled)
anyways alls sweet againThis error only happens with NV cards, and is caused by a wglMakeCurrent(NULL,NULL); line, so don't worry about this crash. I probably will remove this line (improving the clean up process in tha way) in the next SD's revision.

sqrt[-1]
03-06-2005, 02:00 AM
FYI: Running GLIntercept on Shader Designer revealed a stream of errors on startup. Most of them are like:

GL ERROR - Function glGetAttribLocationARB(0,"tangent") generated error GL_INVALID_VALUE
GL ERROR - Function glEnableVertexAttribArrayARB(4294967295) generated error GL_INVALID_VALUE
GL ERROR - Function glVertexAttribPointerARB(4294967295,3,GL_FLOAT,fal se,0,0x3d42b10) generated error GL_INVALID_VALUE
GL ERROR - Function glGetAttribLocationARB(0,"binormal") generated error GL_INVALID_VALUE
GL ERROR - Function glEnableVertexAttribArrayARB(4294967295) generated error GL_INVALID_VALUE
GL ERROR - Function glVertexAttribPointerARB(4294967295,3,GL_FLOAT,fal se,0,0x3d4c548) generated error GL_INVALID_VALUE

With a few functions being called before you have a context:
Call to glGetIntegerv made outside of context/init
Function glGetIntegerv is being called before context creation
Call to glGetIntegerv made outside of context/init
Diagnostic: Unknown function glViewport being logged.
Function glViewport is being called before context creation

Ffelagund
03-06-2005, 10:43 AM
Hello,
Thanks for pointing me on these errors :) . I've fixed all of them. Now, only will appear errors like those with unused uniforms or vertex attributes, because Shader Designer does not check the code to see if a uniform of the uniforms list is present in the source code (same for attributes).
SD tries to upload unconditionally these items:

a) Uniforms inserted in the uniforms list.
b) Tangent and binormal attributes, as well as all other attributes created throught an attribute plugin

Mesh data: Indices, vertices, vertex normals and texture coordinates (only one uv set, and in the first texture unit)

So, it is normal that a) or b) causes a GL_INVALID_OPERATION error.