Jump to content

  • Log In with Google      Sign In   
  • Create Account


Lots of reflections- how?


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

#1 gchewood   Members   -  Reputation: 236

Like
0Likes
Like

Posted 15 October 2012 - 09:43 AM

A rather vague question about reflections. I hope someone can enlighten me.

I've got no problems with simple mirrors and reflecting water etc but how do you go about creating an environment with lots of reflections (I'm working in XNA)?

I'm thinking of games like Mass Effect 2/3 where nearly every other surface reflects its environment. It seems clear that not ever reflection can be calculated each frame so I'm assuming some kind of pre-calculated approach like environment mapping with cubemaps. Hope someone can fill me in.

Thanks

Edited by gchewood, 15 October 2012 - 09:44 AM.


Sponsor:

#2 Quat   Members   -  Reputation: 401

Like
0Likes
Like

Posted 15 October 2012 - 11:20 AM

I would guess they place cube maps around the scene to do reflections. There is also a screen space reflection technique I heard crytek uses, but it is not very accurate and can get problems, so I don't like it too much.
-----Quat

#3 MJP   Moderators   -  Reputation: 10205

Like
1Likes
Like

Posted 15 October 2012 - 11:50 AM

Yeah the common approach is to place reflection probes in the scene, and then pre-render environment maps at the probe locations. When you do this you can also filter the mip levels such that they somewhat match the specular response for different roughness values (specular powers).

#4 InvalidPointer   Members   -  Reputation: 1364

Like
0Likes
Like

Posted 15 October 2012 - 10:31 PM

What MJP said. I can personally confirm ME2/3 both use regular boring cubemaps, but BioWare's art department did a pretty good job hiding this by way of careful region selection. I can't think of any glaring examples where the infinite projection was obvious.

If you want to slap them over things more aggressively, techniques like parallax-corrected cubemaps and other enhanced-projection approaches work really, really well for a large percentage of scenes. They typically aren't much more expensive than the traditional stuff but for mostly-planar surfaces you can get results approaching stencil-masked mirrors.
clb: At the end of 2012, the positions of jupiter, saturn, mercury, and deimos are aligned so as to cause a denormalized flush-to-zero bug when computing earth's gravitational force, slinging it to the sun.

#5 TheChubu   Crossbones+   -  Reputation: 3689

Like
0Likes
Like

Posted 15 October 2012 - 11:27 PM

The even more common approach is not to do reflections at all :P

"I AM ZE EMPRAH OPENGL 3.3 THE CORE, I DEMAND FROM THEE ZE SHADERZ AND MATRIXEZ"

 

My journals: dustArtemis ECS framework and Making a Terrain Generator


#6 gchewood   Members   -  Reputation: 236

Like
0Likes
Like

Posted 16 October 2012 - 03:21 AM

The even more common approach is not to do reflections at all Posted Image


Erm, yeah.....thanks. Very helpful.

Yeah the common approach is to place reflection probes in the scene, and then pre-render environment maps at the probe locations. When you do this you can also filter the mip levels such that they somewhat match the specular response for different roughness values (specular powers).


Well I'm glad I was on the right lines. Is it best to do this programmatically in the engine (and if so, does anyone have the algorithm?) or in something like 3ds max?

#7 jeffkingdev   Members   -  Reputation: 736

Like
0Likes
Like

Posted 16 October 2012 - 07:01 AM


Yeah the common approach is to place reflection probes in the scene, and then pre-render environment maps at the probe locations. When you do this you can also filter the mip levels such that they somewhat match the specular response for different roughness values (specular powers).


Well I'm glad I was on the right lines. Is it best to do this programmatically in the engine (and if so, does anyone have the algorithm?) or in something like 3ds max?


MJP,

In addition to gchewood's question, I would like to add a question regarding the probe locations. Do you then just setup an orthographic view in all directions (ex. straight up, down, left, right, forward, back) to a single cubemap texture?

Thanks,
Jeff.

#8 InvalidPointer   Members   -  Reputation: 1364

Like
0Likes
Like

Posted 16 October 2012 - 08:09 AM


The even more common approach is not to do reflections at all Posted Image


Erm, yeah.....thanks. Very helpful.

Yeah the common approach is to place reflection probes in the scene, and then pre-render environment maps at the probe locations. When you do this you can also filter the mip levels such that they somewhat match the specular response for different roughness values (specular powers).


Well I'm glad I was on the right lines. Is it best to do this programmatically in the engine (and if so, does anyone have the algorithm?) or in something like 3ds max?

The consistency is nice, but you'll likely need to add extra shaders, etc. for things to go smoothly. Rendering programs have the advantage of accuracy and sampling flexibility. If one is a win, go with it.

Re: implementation: Render six views along each of the six major axes with 90-degree horizontal and vertical FOV, save into the appropriate face of a cubemap, done. With MAX you can probably accomplish something similar using render-to-texture and MAXScript though it's not something I've ever attempted.



Yeah the common approach is to place reflection probes in the scene, and then pre-render environment maps at the probe locations. When you do this you can also filter the mip levels such that they somewhat match the specular response for different roughness values (specular powers).


Well I'm glad I was on the right lines. Is it best to do this programmatically in the engine (and if so, does anyone have the algorithm?) or in something like 3ds max?


MJP,

In addition to gchewood's question, I would like to add a question regarding the probe locations. Do you then just setup an orthographic view in all directions (ex. straight up, down, left, right, forward, back) to a single cubemap texture?

Thanks,
Jeff.

You probably want to be using projection cameras, but I guess ortho could work too. Likely would look a bit weird, but maybe there's some 'artistic effect' floating around in there someplace :)
clb: At the end of 2012, the positions of jupiter, saturn, mercury, and deimos are aligned so as to cause a denormalized flush-to-zero bug when computing earth's gravitational force, slinging it to the sun.

#9 MJP   Moderators   -  Reputation: 10205

Like
0Likes
Like

Posted 17 October 2012 - 12:11 AM

You'll probably want to capture your probes with the same renderer that you use at runtime. This ensure that you support all of the same shaders/materials/effects/etc. when capturing probes. We do render the probes inside of Maya, using a custom plugin that uses our engine to do the rendering.

To render to a cubemap you'll want use use 6 perspective projections. The easiest way to do it is to line up each cubemap face with a world-space axis, so that you can sample from the probe using a world-space reflection vector. For the projection you'll want to use a FOV of Pi / 2, and an aspect ratio of 1.0.

#10 gchewood   Members   -  Reputation: 236

Like
0Likes
Like

Posted 17 October 2012 - 01:39 AM

For the projection you'll want to use a FOV of Pi / 2, and an aspect ratio of 1.0.


: Render six views along each of the six major axes with 90-degree horizontal and vertical FOV


Cool, I didn't realise it was that simple. Sounds like the only difficulty lies in dividing up the scenes so the reflections fit nicely. Thanks a lot people, glad to this forum is so reliable.




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