newbie newbie............

Hi,
I have make some simple application use opengl .
But i don’t know everything about openGL shading language . I have downloaded a sample tutorial , but when i run .exe file , it tell me that opengl shading language doesn’t exist . I like to learn about opengl shading language , about vertex shading , per-pixel shading , fragment… but don’t know where to start . Give me a link if you have free time please. Thank …

ps: How can i compile my code if i write per-pixel shader e.g.? I think i need some include files or lib files . And if so , where can i down it ???
:smiley:

Take a look at this site:
http://www.clockworkcoders.com/oglsl/tutorials.html

I have downloaded a sample tutorial , but when i run .exe file , it tell me that opengl shading language doesn’t exist .

Which graphics card do you have and which driver do you use?

Here are some more links for GLSL information/downloads, etc.

Downloads:
http://www.3dlabs.com/support/developer/ogl2/downloads/index.htm
Specifications:
http://www.3dlabs.com/support/developer/ogl2/specs/index.htm
More GLSL Info:
http://www.3dlabs.com/support/developer/ogl2/index.htm

Get the Book:
http://www.3dshaders.com/

IDE for OpenGL Shading Language:
http://www.typhoonlabs.com

hi all,
i have played a bit with the vert and frag programs, and now i wanted to give GLSL a try…
i loaded both the vertex and fragment program, simply setting all

gl_FragColor = vec4 (1.0, 0.0, 0.0, 0.0);

so all red, doesn’t it? No, it doesn’t…
my app fall back on std pipeline and renders all textures, colors and stuff…

why does it behaves this way? do i have to install anything to use GLSL??? I am again a newbie on this topic :frowning:

thx the G.

Did you check if the shaders were successfully compiled and linked before you use them?

actually…
i am using opensg,
and i think it is its role to compile em 4 me…

how do i check if the shader is properly compiled??

You can get the compilation status with:
glGetObjectParameter(my_shader_object, GL_OBJECT_COMPILE_STATUS, &status);
And linking status with:
glGetObjectParameter(my_program_object, GL_OBJECT_COMPILE_STATUS, &status);

On the OpenSG mailing list a guy told me that there is still no OpenGL driver 4 linux supporting the GL shading language… is it true? or do i have to dnload something?
If there is really no device driver, well it may be tricky to fix my problem :mad:

The last NVidia drivers add support for GLSL.
See :
http://www.nvidia.com/object/linux_display_ia32_1.0-6106.html

:smiley:

Originally posted by Bozfr:
[b]The last NVidia drivers add support for GLSL.
See :
http://www.nvidia.com/object/linux_display_ia32_1.0-6106.html

:smiley: [/b]
THANKS! installed and made em run… :slight_smile:

just to check if that worked i made a veeeery
simple frag program that actually just says

void main(void)
{
gl_FragColor = vec4f(1.0,0.0,0.0,1.0);
}

that should turn everithing red, when activated, right?
My mesh istead remains of an infinite dark graysh color… what’s wrong with it?
uh and my frame rate drops significantly
any clues?
thx the G.

solved the previous problem,
but now i am stuck the next step:

here is my vp:

// uniform parameter, used to calculate che eye vector
uniform vec4 Camera;

// varying variables passed to fragment shader
varying vec3 PixColor;
varying vec3 TexCoord;
varying vec4 Eye;

void main (void)
{
gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;

Eye = glPosition - Camera;

//TexCoord = vec3 (gl_Normal);
TexCoord = vec3 (1.0,0.0,0.0);
}

and here my fp:

// texture units incoming
uniform samplerCube map;

// varying variables passed to fragment shader
varying vec3 PixColor;
varying vec3 TexCoord;
varying vec4 Eye;

void main(void)
{
vec4 tcolor = textureCube (map, TexCoord);

// gl_FragColor = vec4 (exrcolor);

// just to check output
gl_FragColor = vec4 (1,0,0,1);
}

it should display all red, but it hangs, and OpenGL falls back to the std pipeline…
the problem is TexCoord, which is undefined (and should be 1,0,0).
I tryied also to set

gl_FragColor(TecCoord,1.0);

(which should be red too), but it keeps hanging.
Now, the varying stuff shouldn’t pass values automatically from one program to the other?

thx

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.