Advertisement Jump to content


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


Vertex fog and 2D (XYZRHW)

This topic is 6176 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 have some trouble getting vertex fog to work with my 2d components (GUI). It appears the 2d is at the back of the projection matrix and is getting fog applied to it. I want it at the beginning so its not all fogged out. It works fine in pixel fog. But vertex fog is not working. I''ve been playing with the Z and RHW values (randomly setting different things to each one) and has no effect. I''m stumped.

Share this post

Link to post
Share on other sites
Turning your fog off before drawing the GUI should be just fine. To paraphrase the MSDN on the topic, you should avoid 1000''s of state changes (such as enabling/disabling fog) per frame. One or two per frame is fine, and often unavoidable.

In fact, you *might* get a speed improvement if you disable things you''re not using, such as lighting, before rendering your GUI. I say might since the transformation & lighting pipeline isn''t applied to pre-transformed vertices anyway, which is what you''re using. Disabling pixel-level tests such as alpha blending and testing will probably give you a slight speed boost, depending on your GUI''s size and complexity.


Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!