Jump to content
  • Advertisement
Sign in to follow this  
RichardoX

OpenGL OpenGL Shading Language (and shaders in general)

This topic is 5085 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

Hi! I've been doing some work with OpenGL Shading Language (GLSL) recently, and I have bumped into some problems: 1) I can use a fragment shader without a vertex shader, but not the other way. If I have only a vertex program linked into my shader program, nothing happens. Just a black screen. Is this the way it's supposed to be working? 2) If I have a fragment shader that has only gl_FragColor = gl_Color; in the main() function, nothing happens? Why? 3) Can I WRITE into textures with fragment shaders? 4) Do you prefer Cg better than GLSL? That's all I can think of now. Thanks, Richardo

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
Quote:
Original post by RichardoX
Hi!
2) If I have a fragment shader that has only
gl_FragColor = gl_Color;
in the main() function, nothing happens? Why?


AFAIK, gl_Color is a vertex attribute--it's only available to the vertex program. Use a varying variable to pass it to the fragment program.

Quote:

4) Do you prefer Cg better than GLSL?


Heavens no.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Quote:
Original post by RichardoX
Hi!
2) If I have a fragment shader that has only
gl_FragColor = gl_Color;
in the main() function, nothing happens? Why?


AFAIK, gl_Color is a vertex attribute--it's only available to the vertex program. Use a varying variable to pass it to the fragment program.

Quote:

4) Do you prefer Cg better than GLSL?


Heavens no.

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!