Reflection and mirrors

Is there a way to create good looking reflections, that are independent from the direction?
I want to create glass skyscrapers that are exterior only with a high reflective facade in all 4 directions.
I don’t want to create many 100 or 1000 cameras for that. I know the Unity reflection shader with the script. it is cool, but only in one direction. Why isn’t there anything that reflects in all directions? Is it too difficult to create? What alternates are there? And don’t say, that I should make 4 sides of the skyscraper and face the gizmo outwards to get the reflection in all directions. ^^ Reflection probes also don’t work. they look ugly. :slight_smile:

Raytracing. It’s the ultimate solution to your problem. Just be aware it’s a very early preview, only works on Windows 10, and only with NVIDIA (GTX 1060 6GB and greater, RTX 1660 and greater).

https://unity.com/ray-tracing
https://discussions.unity.com/t/738275

I have Windows 7. so nope. ^^ and it is HDRP. I want the standard one.

Even big games generally don’t do what you’re asking for. It is almost always faked or fudged in some way. Even the new Spiderman game, which looks wonderful and often has you crawling up the sides of highly reflective buildings, doesn’t have proper building reflections.

Is it one building you need this for, or a whole city, or…? Specifics of the use case matter.

The catch is the number of different perspectives you need to capture to get appropriate perspective for every surface. Raytracing does this naturally. Other approaches require cameras or probes set up, and get (prohibitively) more expensive as the accuracy of results increases.

If the reflections were really important for something I was doing, I’d consider setting up a system with a small pool of dedicated cameras to take appropriate perspective shots for the nearest reflective surfaces. I’m no shader / graphics expert, though, so I don’t know how tricky that might be to get working properly.

If the stuff that needs to be reflected is generally in front of you and on screen, another consideration is Screen Space Raytraced Reflections. This is a variant of raytracing that happens with an already rendered image. Basically, it checks to see if the thing being reflected is already visible on-screen, and re-uses those pixels if it is. Otherwise, it leaves things blank. Very useful for corridor-type environments.

2 Likes

I’m suddenly imagining six cameras, a rendertexture cubemap, and this function.

https://docs.unity3d.com/ScriptReference/Camera.RenderToCubemap.html

Similar principle, but I don’t think built-in cube map rendering allows you to change the perspective as you’d need to.

Reflection probes can give you something that looks reflective and can even be updated every frame but the rendering cost can be very large.

If you move the probe with the camera,otherwise the perspective is wrong

1 Like

What he want is planar reflection, that’s expensive though, ie one camera per plane at resolution that match the screen coverrage of the plane.

1 Like

This github has a planar reflection for LWRP

edit: but he wanted built in. hmmm

1 Like

There was a planar reflections script from Aras floating around I think (it is REALLY old).

Planar reflections are kinda easy to code though, and with downsampling and limited use they are kinda fast (well, depending).

I see now, that good reflections are not easy to generate. ^^

1 Like

If they were easy every AAA, AA and indie game would overuse them.

2 Likes

Stress on overused, see what happen with lens flare, bloom, god rays, toon shading …

3 Likes

Yepp, the wording was intentional. :slight_smile:

I fully expect to start seeing reflective puddles everywhere in games thanks to raytracing. :stuck_out_tongue:

We got post reflective pudding already, I expect more fancy mirroir reflection by now, like chrome people and objects everywhere.