Jump to content

  • Log In with Google      Sign In   
  • Create Account

Realtime non-raytraced curved mirrors


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 irreversible   Crossbones+   -  Reputation: 1354

Like
0Likes
Like

Posted 30 January 2013 - 02:16 AM

I'm talking about surfaces too large to be environment-mapped (eg mirrors that span the length of an entire corridor wall).

 

Right off the bat it seems handling concave surfaces with minor curvature might be accomplished by the simple case of using flat mirroring + rendering to an FBO and manipulating texture coordinates to distort the mirrored image (the mirror edges would still not line up - which in turn wouldn't be too big of an issue if the mirror edges didn't touch any of the mirrored surfaces). Concave and uneven surfaces get far more complex pretty quickly, though.

 

An alternative would be to curve the geometry when rendering the mirrored image, but I would assume the actual implementation would be far more complex than theory in this case.

 

Has anyone done research into this?



Sponsor:

#2 Ashaman73   Crossbones+   -  Reputation: 7551

Like
0Likes
Like

Posted 30 January 2013 - 02:51 AM

An alternative would be to curve the geometry when rendering the mirrored image

Have you considered a technique similar to paraboloid shadowmapping.


Edited by Ashaman73, 30 January 2013 - 02:51 AM.


#3 irreversible   Crossbones+   -  Reputation: 1354

Like
0Likes
Like

Posted 30 January 2013 - 02:56 AM

Paraboloid shadow/environment maps are essentially light probes that are rendered from the view of the light source or the object. Make the object (in this case the mirror) large enough and sadly no amount of projection is going to help you as the projection becomes invalid the further you go from the center of the paraboloid.

 

I'm in particular talking about mirrors that span across an entire room - eg making a curved wall partially reflective the same way you'd make a floor or a ceiling (which is usually accomplished by reflecting the scene across the mirror's plane).



#4 Krypt0n   Crossbones+   -  Reputation: 2575

Like
4Likes
Like

Posted 30 January 2013 - 03:10 AM

if the curvy object is not facing straight at you (e.g. if it's a bumpy floor), you could try screenspace reflections, those should work decent most of the time for those cases.



#5 Waterlimon   Crossbones+   -  Reputation: 2573

Like
0Likes
Like

Posted 30 January 2013 - 03:17 AM

I guess you could do it by rendering from the mirrors perspective, but using a vertex shader to apply some custom math to transform the scene so that the mirror is flat (but the scene itself becomes "curved"/distorted)

 

Pretty sure you cant do that with a matrix though xD

 

Im not sure if that will be ugly (id imagine long edges would look wrong, but if you have small enough triangles and not too much curvature...)


o3o


#6 irreversible   Crossbones+   -  Reputation: 1354

Like
1Likes
Like

Posted 30 January 2013 - 03:29 AM

The screen space reflections approach looks like it would do for a vast majority of cases that have to do with reflectivity, but not direct mirroring. I'll definitely do some reading into it!



#7 CryZe   Members   -  Reputation: 768

Like
2Likes
Like

Posted 30 January 2013 - 04:03 AM

You could try Billboard reflections, such as those from the Unreal Engine Samarithan Demo. You simply approximate the environment using textured planes and perform texture fetches at the ray-plane-intersections. Maybe not only texture fetches, but actual "pixel shading" of this geometry too. Do this for all the planes and output the color of the nearest sample. This should work pretty well if done correctly. If you combine it with screen space reflections and cube mapping, you can get almost perfect reflections. Billboard reflections as first fallback and cube mapping as second fallback. You simply fade in the billboard reflections, where no sufficient screen space information is available, and also fade in cube mapping, where no ray-plane-intersections are found. You might also want to use a signed distance field of the geometry to check whether the billboards are occluded. They did that in the Samarithan Demo to prevent bright billboards from leaking through buildings in the reflections.

Update: I have an even more crazy idea. You could also apply not only bump mapping to these billboards, but also parallax occlusion mapping. This way, you would have reflections that are not completely flat. But this would probably immensely reduce your performance.

Edited by CryZe, 30 January 2013 - 04:29 AM.


#8 Frenetic Pony   Members   -  Reputation: 1321

Like
0Likes
Like

Posted 30 January 2013 - 04:31 PM

The screen space reflections approach looks like it would do for a vast majority of cases that have to do with reflectivity, but not direct mirroring. I'll definitely do some reading into it!

Screenspace reflections are awful, in their own way. If you are really, REALLY careful and clever and spend an inordinate amount of time you can get a neat hacky effect out of them, but the amount of time you have to spend to get it working is, to me, not worth the results. And of course its going to be utterly worthless for any highly reflective materials like a mirror, because constantly shifting missing reflections are going to ruin the effect.



#9 MaelmDev   Members   -  Reputation: 198

Like
3Likes
Like

Posted 04 February 2013 - 09:35 PM

I would avoid trying to find a solution that works for massive mirrors in one fell swoop, and split up large mirrors into smaller, simpler surfaces that can get away with texture coordinate distortion for curvature.



#10 Rhetorician   Members   -  Reputation: 119

Like
1Likes
Like

Posted 06 February 2013 - 11:17 PM

Rasterization based non-linear beam tracing. Unfortunately the first bone-head to have implemented it has filed a patent at Microsoft...

 

https://duckduckgo.com/?q=nonlinear+beam+tracing

 

Their implementation isn't that great anyway. Microsoft blows.






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