Jump to content

  • Log In with Google      Sign In   
  • Create Account


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 ADDMX   Members   -  Reputation: 253

Like
0Likes
Like

Posted 20 September 2013 - 03:53 AM

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 ?


Sponsor:

#2 solenoidz   Members   -  Reputation: 531

Like
1Likes
Like

Posted 20 September 2013 - 10:34 AM

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" .    



#3 ADDMX   Members   -  Reputation: 253

Like
0Likes
Like

Posted 20 September 2013 - 02:09 PM

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)






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