Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


using "uniform" keyword in Cg

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

Ok, i''m confused as to the real use of uniform in Cg. The tutorial book says that you can use it to specify a value that doesn''t inherintly get passed to the function, etc. However, in the Bump mapping tutorial on this site (using Cg), the fragment program uses 3 uniform variables, and only specifies one of them (AmbientColor) in the rendering code. I''m confused as to how this still works, and when do i know that i need something to be uniform?

Share this post

Link to post
Share on other sites
use uniform for every param passed by the runtime and that can change between render batches.
Not specifying a unifomr parameter will give unpredictable results.
Things like position matrices, and more generally what used to in the T&L state are uniform things.

Share this post

Link to post
Share on other sites

  • 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!