0
\$\begingroup\$

I would like to render an object as if mirrored but on its own world position and with a mirrored orientation being camera view dependant. Something like the billboarding but keeping the 3D shape and showing it mirrored. I don't want to change my current culling when rendering it as it will be during regular scene rendering. See the picture below for expected result. Thanks in advance for your help. enter image description here

\$\endgroup\$
4
  • \$\begingroup\$ Are you using any particular rendering framework for this? \$\endgroup\$
    – DMGregory
    Jun 20 at 11:32
  • \$\begingroup\$ For clarification: Do you want to render both, the original and the mirred one at different positions? \$\endgroup\$ Jun 20 at 12:51
  • \$\begingroup\$ No. In fact I'm trying to solve some SSR artifact when the ray misses part of a ball due to the angle, particularly on bottom of it and in the limit of hidden faces. My idea is to have a "mirrored" depth with more chances to hit a surface. I've made a depth map with planar depth for some object and it works somehow but not the best. A 3D local mirrrored depth could be better I think. \$\endgroup\$
    – philB
    Jun 20 at 12:56
  • \$\begingroup\$ Quasimodo's, as explained above I just want to get the corresponding depth in a separate map during my deferred multitarget rendering. \$\endgroup\$
    – philB
    Jun 20 at 12:58

1 Answer 1

0
\$\begingroup\$

A solution to this is to precalculate on CPU DepthMin and DepthMax for the object in a constant buffer. I was already using it for sorting the object back to front for some needs. Then apply some local transform to the object (if the mesh origin is 0,0,0) before the WVP operation and use the result to have a specific Depth. Then do Depth = DepthMax+DepthMin-Depth to "revert locally" the depth. With this equation when Depth = DepthMax it becomes DepthMin and vice versa all over the [DMax,DMin] interval.

I'm using this "revert" depth as fallback for hard case ray miss in SSR with some nice results to be improved. Using this method pixels from front faces difficult to hit can be found. I'm now twiking this to have the additional transform begin oriented according to the direction of the camerapos to objectpos to have a result consistant all over the screen. Like the billboard I was mentioning.

\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .