Jump to content
  • Advertisement
Sign in to follow this  

Photon Mapping

This topic is 3176 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 saw the game Infiniminer, and decided to make a clone that is more FPS oriented. Effectively, the entire world is rendered out of cubes. I have used an octree to group large clusters of cubes as single large cubes. They are then rendered using instancing techniques. Just like Infinimer, the world is completely dynamic. Player's can add and remove Cubes however they want. Now my problem is global illumination. Because the world will be changed a lot during gameplay, I can't precalculate anything. Therefore I have decided on photon mapping. I have never done anything like this, but here are my idea's/questions: I want to use the GPU for Generating the photon map (cos it's fast lol), my idea is to have each photon as a vertex (with origin and direction as vertex inputs). Then do the calculations in the vertex shader and position it on the photon map texture accordingly. The pixel shader won't do anything here, every vertex will be rendered as a point. My questions are: - What is the best way to organize the photon map on a 2D or 3D texture? - How should I define the scene to the vertex shader (keep in mind the world is made of cubes), my ideas were volumetric texture or a second vertex stream. - Is this the right approach? The rendering pass will use the generated photon map and the k-nearest neighbor algorithm to find the 4 closest photons. This will be done per-pixel, so accessing the photon map must be fast. These photons will be averaged and the final luminance will be based on the search radius for the 4 photons and the averaged photon. Is this the right way to approach this? Tell me if you don't understand anything.

Share this post

Link to post
Share on other sites
Sign in to follow this  

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