https://github.com/frostbone25/Unity-Specular-Probes
A simple editor script that emulates specular highlighting for every light in the scene on reflection probes when baking them.
https://github.com/frostbone25/Unity-Specular-Probes
rendering rendering-3d-graphics unity unity-3d unity-editor unity-package unity-scripts unity3d-plugin
Last synced: 4 days ago
JSON representation
A simple editor script that emulates specular highlighting for every light in the scene on reflection probes when baking them.
- Host: GitHub
- URL: https://github.com/frostbone25/Unity-Specular-Probes
- Owner: frostbone25
- License: mit
- Created: 2022-10-06T04:24:27.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2024-02-28T04:04:58.000Z (over 1 year ago)
- Last Synced: 2025-04-07T03:11:18.410Z (8 months ago)
- Topics: rendering, rendering-3d-graphics, unity, unity-3d, unity-editor, unity-package, unity-scripts, unity3d-plugin
- Language: C#
- Homepage:
- Size: 4.21 MB
- Stars: 37
- Watchers: 1
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- anything_about_game - Unity-Specular-Probes
README
# Unity Specular Probes
A simple editor script that places an emissive object at the place of every light in the scene to emulate specular highlights on reflection probes when baking them.

## Results
Specular Probes Enabled

Specular Probes Disabled

Specular Probes Enabled

Specular Probes Disabled

### Why?
The unity standard shader does not have a specular highlight term when baking lightmaps *(even with directional lightmaps, but it only shades the diffuse term)*. As a result when a light source is baked fully within unity, you lose out on the specular highlight term you would normally get from realtime/mixed lights *(unless you are using the shader that computes a specular highlight using the directional term from the lightmap)*. For PBR rendering, having a good specular term is critical for getting good and correct shading results.
This is a script that attempts to alleviate that by spawning an emissive object *(that matches the shape of the light source)* before reflection probes are baked in an attempt to emulate the specular lobe of the light. All of this at no extra performance cost at all! *(because it's being baked directly into the reflection probes)*.
### Credits
I was inspired by [Zulubo's](https://github.com/zulubo/SpecularProbes) implementation, however I opted for my own and went for a more simplified but global solution that also can do area lights as well.