Jump to content
  • Advertisement
Sign in to follow this  
Duel93

GLSL question

This topic is 4227 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I'm trying to run GLSL with a vertex shader only and bypass the fragment shader. I would like to manipulate the vertices and let the fixed pipeline handle the lighting. For what I am trying to do, I don't want to bother with fog/lighting. Is this possible with GLSL? I can do it with nVIDIA Cg. I have a basic understanding of GLSL and I understand that I am required to output the position. And, my video card supports all of the necessary extensions. When my vertex shader is only... gl_Position = ftransform(); ...I get no display of my geometry, unless I also have a fragment shader. Then I see the textured geometry. I would expect to at least see the geometry with only a vertex shader, even if it's not lit correctly. 1) Is it possible to only use a vertex shader and bypass the fragment shader? 2) Am I missing some outputs in my vertex shader since I see nothing at all? Thanks for any help.

Share this post


Link to post
Share on other sites
Advertisement
You have the option to specify just a vertex shader, just a fragment shader, or both of them. If you specify just a vertex shader, the fixed function fragment shader is used, which expects that you also set the other parameters (like the vertex color as would have been computed by the fixed function vertex shader).

Share this post


Link to post
Share on other sites
Thanks for the input.

I found out that I was missing the following.

gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
gl_FrontColor = gl_Color;

Actually the geometry only displayed when I included the gl_TexCoord part.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!