Skip to content

frostbone25/Unity-Improved-Box-Projected-Reflections

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Improved Box Projected Reflections

A work-in-progress attempt at improving Box Projected Reflections.

Contact Hardening

Contact Hardening: None

1

The issue with how box projected reflections are typically done is that when sampled, the roughness of the reflection is consistent regardless of camera position, and object position.

With that there are a couple of implementations here that attempt to alleviate that problem and make them more true to life and higher fidelity.

Contact Hardening: Approximated

2

This is done by modifying unity's existing box projection method to output a hit distance from the bounds of the box, to where the object is. Using the hit distance it offsets the mip level to be sharper when closer to the bounds of the probe, and rougher when farther from the bounds. It's very cheap and fast, though not accurate as it fails to model anisotropic reflections.

Contact Hardening: Traced

3

This is a more accurate way of handling reflections. Using multiple randomized samples, and GGX to model roughness. It's also expensive at high sample counts. (more work to be done here)

Beveled Box Projection

Beveled Box Projection: Off

13

Classic box projection, it's fast but has sharp edges and can look jarring especially when the cubemap is sampled at a higher mip level.

Beveled Box Projection: On

14

Using a beveled box projection with an adjustable bevel factor. Idea is to smooth out the sharp edges you'd get with the classic method. Has artifacts at high bevel values.

TODO/Ideas:

  • Use Blue Noise for better perceptual quality.
  • Use mips to reduce samples/noise.
  • Animated noise.
  • Quad Intrinsics?
  • Use reflection cubemap luminance for better ray allocation?

Results

No Contact Hardening 4

Approximated Contact Hardening 5

Traced Contact Hardening 6

Normal Maps with No Contact Hardening 7

Normal Maps with Approximated Contact Hardening 8

Normal Maps with Traced Contact Hardening 9

No Contact Hardening 10

Approximated Contact Hardening 11

Traced Contact Hardening 12