Jump to content
  • Advertisement
Sign in to follow this  
ADDMX

OpenGL backing GI

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

Hi
 
I have question about backing light probes ...
 
To draw some background:
 
I have a little (not so little after all) engine writen in OpenGL 4.2 with some neat features (like voxel cone tracking, etc, etc.) and
application that uses this engine. From graphical point of view there is a big city (lots of buildings (with are STATIC geometry) and lots of crowd/cars (with are moving)).
The polycount is quite big, about 4 - 5 milions per frame overal (2 milions for cascaded shadowmap itself), but the performance on high-end cards is OK.
Whole scene without any clipping is about 20 - 25 milions depending on crowd/cars ratio.
 
The problem with voxel cone tracking is that I need to prerender (some parts) of scene into volume (i'm doing it using 'imageStore' capability of opengl 4.2) and the volume around camera must be quite big
to get good looking gi in open environment (128x128x128x4 consumes quite a lot of memory).
 
So i came with idea of placing light probes on the level, and bake indirect light on those (using SH) (maybe bake both direct & indirect for static objects would be also good idea ...).
Probes distribution & relighting from probes is not a problem, the real problem is to bake the probes.
 
My first solution was to export whole scene (20 milion tris + about 1GB of textures (albedo only) into some format (say *.fbs)) and then use some software (like Max or Maya) to bake GI probes,
but the solution fails at export/load phase since 20 milion tris is too large for fbx to handle even in 1000's of subobjects, also there will be management problems, i need plugin to place probes, etc., etc.
 
Second solution is to bake probes inside engine, is there any middleware for this that is free for non-comercial use, writing own GI backer would probably be gargantuan job (or not ?)
 
Any ideas how to approach this problem ?

Share this post


Link to post
Share on other sites
Advertisement

I'm not sure if I understand the question correctly, but can't you place your probes around your level in your engine. Then for every probe, render a cube map located at the probe position, then convert the cube maps to a set of SH coefficients and store them. At render time, render spheres(for example) at your probe's position, pass the SH harmonics coeffiecents for this probe to the shader, and for every pixel, get its world position, calculate the vector pixel->probe pisition, which can be used as normal to extract the light comming from that direction stored in the SH and shade that pixel with "global light" .    

Share this post


Link to post
Share on other sites

I'm not sure if I understand the question correctly, but can't you place your probes around your level in your engine. Then for every probe, render a cube map located at the probe position, then convert the cube maps to a set of SH coefficients and store them. At render time, render spheres(for example) at your probe's position, pass the SH harmonics coeffiecents for this probe to the shader, and for every pixel, get its world position, calculate the vector pixel->probe pisition, which can be used as normal to extract the light comming from that direction stored in the SH and shade that pixel with "global light" .    

 

ok, that will give me DIRECT light on the probes - this is the easy part ... now the INDIRECT light (bounces) :))

the trick is that I want to calculate DIRECT light in conventional way for (for quality) and add only INDIRECT light from the probes.

 

If you are familiar with unity-pro, then this is the mechanism applied for lights with 'auto' settings when backing light probes, only indirect lighting (bounces) is backed on probes, then when the rendering is done, the direct lighting is calculated as usual (shadowmaps rendered, diffuse term evaluated, etc.) and then indirect light is added.

 

the real question would be - HOW TO BAKE INDIRECT LIGHT (without writing own montecarlo/metropolis tracer ;))) (or what middleware use)

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!