Vertex fog and 2D (XYZRHW)

Started by
1 comment, last by JoeyBlow2 22 years, 1 month ago
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.
Advertisement
*Bump* I''d rather not have to turn off Fog before rendering GUI then turn fog back on. =) Seems kinda sloppy.
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.


--
Eric
-- Eric

This topic is closed to new replies.

Advertisement