Jump to content

  • Log In with Google      Sign In   
  • Create Account


Transparecy and fog


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
2 replies to this topic

#1 Prauch Kummel   Members   -  Reputation: 122

Like
Likes
Like

Posted 07 October 2001 - 07:50 AM

Yesterday I started with OpenGL, but I''ve already lerned a lot. But there are still 3 problems I have to solve: ------------------------------------------ 1 If I use fog as following: glFogi(GL_FOG_MODE, GL_LINEAR); glFogfv(GL_FOG_COLOR, fogColor); glFogf(GL_FOG_DENSITY, 1.0f); glHint(GL_FOG_HINT, GL_NICEST); glFogf(GL_FOG_START, 5.0f); glFogf(GL_FOG_END, 50.0f); glEnable(GL_FOG); fog isn''t starting at 5.0 but it is starting right behind my screen, which is equal to 1.0 in my environment. At a depht of 2.0 all faces/object are completele coverd by fog (which means I can''t see them any more). What do I do wrong? ------------------------------------------ 2 I would like to use transparent objects, which can be done by using the Alpha-Value. In order to avoid one object being in front of another (so that I can''t see the one behind, as if the front-object was opage) i should use glDisable(GL_DEPTH_TEST); This is really working, as long as I dont use non-transparent objects as well. If I do so, I get rubbish on my screen (of course!). Is there a way to use both transparent and non-transparent objects at once? Some one said I had to do do a multi-pass-rendering, but I dont know how to do taht, and I think there has to be another solution ------------------------------------------ 3 My version of the help-file opengl.hlp ist corrupted. It says: The equation for GL_EXP fog is "error with bitmap-display" Can somebody tell me the correct equation for GL_LINEAR, GL_EXP and GL_EXP2? The Help-Topic ist named "glFogf, glFogi, glFogfv, glFogiv"

Sponsor:

#2 Prosper/LOADED   Members   -  Reputation: 100

Like
Likes
Like

Posted 07 October 2001 - 08:57 AM

1. Sorry, I''ve never used fog so I guess I can''t help you. You may perhaps try different values ?

2. It''s a common problem. Here''s a possible solution :

glEnable( GL_DEPTH_TEST);
// draw all your non transparent polygons
glDepthMask( GL_FALSE); // Disable z-buffer writing but not z-buffer reading
// draw all your (z-sorted) transparent polygons
glDepthMask( GL_TRUE); // Enable back z-buffer writting

3. The Red Book (OpenGL Programing Guide) is available online. Search it with google, the equations must be described in the fog chapter.

Hope it helps!

#3 Prauch Kummel   Members   -  Reputation: 122

Like
Likes
Like

Posted 07 October 2001 - 12:24 PM

Thank for that advice.

I think this Red Book will answer all Question that I will ever have concerning OpenGL. it''s really cool!




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS