Correct way to add reflection onto glass surface

Average, Screen, Add and …

Geometric Merge: 2AB/(A+B) – a Different kind of average
Hypot: sqrt (AA+BB) - screen alt works with values over 1

1st 2 shaders I ever wrote. I wrote them specifically for reflections. But as @randy says what ever looks best is the correct way

Interesting!!! Is that shader available somewhere?

Wipped this up this morning. Source included. Like stated before whatever looks best, these are just 2 more options.

4 Likes

Thx a lot. Can’t wait to download that this WE. :wave:

ReflectionAnim

I made this animation to sum up reflections.

If you move the camera below the horizon as much as it was above the horizon, then flip the image, you’ve built your reflection. I usually do this by copying the main camera and assuming the horizon is at 0 on the XZ plane, parenting the camera below an axis with -100 Y-scale.

Then you ADD the image…

…technically.

as everyone says, you really do whatever looks good to whoever cares, but from a strictly technical standpoint, working in scene-linear and adding reflections is correct as it will carry the super-bright values along. See the image below and note how wrecked the highlights get when the screened image is defocused.

at that point it’s just a matter of comping the FG objects back over.

What I like about this little experiment is it demonstrates how a reflection is just the entire scene inverted along an axis. This means paying attention to occluding objects in the reflection, which is a big pain in the ass when combining fake reflections and real ones.

On my beloved Kia Jet spot, I remember feeling like a total asshole sending out the roto for the reflections in the windows of the car, but it was good to have them when it came time to throw the completely different sky in.

If anyone’s interested, I can upload the green cube reflection setup.

11 Likes

Thanks! Worked like a charm.

ooh, I just saw your path in there for the matchbox download path. Awesome. I’m getting this error in the shell when I hit download:

downloading Logik Matchboxes…

Traceback (most recent call last):
File “/opt/Autodesk/shared/python/logik_portal/logik_portal.py”, line 905, in download_logik_matchboxes
urllib.urlretrieve(‘https://logik-matchbook.org/MatchboxShaderCollection.tgz’, tar_path)
File “/opt/Autodesk/python/2021.1/lib/python2.7/urllib.py”, line 98, in urlretrieve
return opener.retrieve(url, filename, reporthook, data)
File “/opt/Autodesk/python/2021.1/lib/python2.7/urllib.py”, line 249, in retrieve
tfp = open(filename, ‘wb’)
IOError: [Errno 2] No such file or directory: ‘/opt/Autodesk/shared/python/pyFlame/logik_installer/MatchboxShaderCollection.tgz’

1 Like