Jump to content

  • Log In with Google      Sign In   
  • Create Account

Best approach to rendering an environment map


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
4 replies to this topic

#1 lipsryme   Members   -  Reputation: 1044

Like
0Likes
Like

Posted 11 February 2013 - 06:20 AM

So I'm currently implementing a full daytime change in my scene and I'm now wondering how to approach this problem.

Before what I had was my static scene with a skybox where I could use this skybox (or better use an env probe) to create prefiltered environment maps and irradiance maps for diffuse ambient and ambient specular lighting respectively. But now as the scene and the environment becomes dynamic I stand before the problem of not being able to use the old static approach to this. My current idea is to make 3 environment maps for 3 "special" daytimes like night, sunrise/sundown and daytime and interpolate between those. Is this a viable idea, or do I have to do it differently ?

 

My second question would be if there is a better way to render the environment from the probe itself then to rotate the camera and render 6 times the scene for each face ? As I understand I have to do this without any post-processing enabled ? What about tonemapping ?


Edited by lipsryme, 11 February 2013 - 06:21 AM.


Sponsor:

#2 Vilem Otte   Crossbones+   -  Reputation: 1561

Like
1Likes
Like

Posted 11 February 2013 - 07:09 AM

Hm... basically you need just 2 renders of environment, not 6 ... if you use Dual Paraboloid mapping - see http://graphicsrunner.blogspot.cz/2008/07/dual-paraboloid-reflections.html

 

Tone mapping is a problem here, basically you want your environment map also in HDR (e.g. render to high precision format and don't apply tone mapping). Tone mapping is then applied when you render "final scene" from your camera on whole result (e.g. also reflections). The problem is, that you actually need some RGBA16F or RGBA32F format to store environmept nap ... maybe you could try using RGBE8 (Red-Green-Blue-Exposure) or such format, if you're memory limited.


My current blog on programming, linux and stuff - http://gameprogrammerdiary.blogspot.com


#3 riuthamus   Moderators   -  Reputation: 5779

Like
0Likes
Like

Posted 11 February 2013 - 11:09 AM

We had some of these issues and moved to SRGB, the tone map + HDR + exposure mapping made some serious headaches for the texturing of things but once you get a decent setup you like ( we created a tool to modify each of the values for all of these in game ) the textures will look like they should. I have an entire thread about it on this forum... let me look it up and link you so you can do some reading. Would help to know what language you are coding in and openGL or DX11/DX10?

 

EDIT: Here is the links:

 

http://www.gamedev.net/topic/632844-tonemapping-formula-help-math-help/

http://www.gamedev.net/topic/630256-hdr-tonemapping-skylight-fail/


Edited by riuthamus, 11 February 2013 - 11:15 AM.


#4 lipsryme   Members   -  Reputation: 1044

Like
0Likes
Like

Posted 11 February 2013 - 12:39 PM

Hmm well I guess I could render them to a 64bit texture...

@riuthamus I'm using DirectX11. Thanks for the links but they're about tonemapping itself. My problem is more on how to handle this for environment probes.

edit: I found some answers on sebastienlagarde's blog about this.
I'd still like to have feedback on my idea that I wrote above of making an environment for 3 different times of day. Or is there a better way ?
If I were to use a dynamic probe, how would I be able to blur them for each miplevel, like I do with the AMD cubemap gen offline ?

Edited by lipsryme, 11 February 2013 - 12:39 PM.


#5 riuthamus   Moderators   -  Reputation: 5779

Like
0Likes
Like

Posted 11 February 2013 - 01:51 PM

Ah sorry, i misunderstood what you were going for.






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