Sign in to follow this  

Photon Mapping

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this