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

Volumetric Fog (again)

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

Hello !!

I have a problem with volumetric fog. I understand how it should work basically, I also set up a function which calculates the intersection points between a sphere and a ray. Ok, fine. But, how do I create the fog-map (which is, as far as I know, a texture map) ??
Lets say I have a simple room, four sides, a floor and a ceiling. The camera is in the room and looks to some point in space. Let's say I have a fog sphere in one of the lower corners of the room. How the hell do I create the fog map.
In all articles I have found, that you simply have to calc the vector from a vertex to the camera position, then calc intersection points with the sphere, then compute the distance of these two points et voila ??? Ok, this is really simple, no problem. Ok, now I have this distance, and I am able to compute an alpha value based on this distance (the easiest way of course is to simply set the spheres radius to 255, so the distance is between 0 and 255).
Ok, let's say I have a texture of size 32x32 and I am able to change pixels in it in runtime. Now, what do I do with these information. How do I know where to draw the pixel in the fog-texture-map. One side of the room has 4 vertices and two faces (I am using triangles for faces), right ?? Well, I only could set 4 pixels in the 32x32 texture map ?? How do I get the other pixels. I heard something of tesselation of the faces. How is this done, and how do I make sure, that all pixels are filled in the texture map ???
Now, If your answers can help me, I have a texture map. How do I set the Texture Coordinates of that face ??

I hope I made clear what problems I have with volume rendering. Please help me, since I WANT this effect in my game.

Best Regards, MfG

Share this post

Link to post
Share on other sites
This is not answer to your question, Phillip. I just was away for two weeks and when i come back i get an e-mail message about posted answer to my posting about volumetric fog. But when i get here, i found new message board (wich i really like much less than previous one, because of all messages are messed up on one page) and all old articles are gone. If you (poster) can repost your message, please do so.


Share this post

Link to post
Share on other sites