Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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: about 14 hours 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 (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-02-28T04:04:58.000Z (7 months ago)
- Last Synced: 2024-09-26T23:22:43.728Z (about 14 hours 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: 32
- Watchers: 1
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
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.![window](GithubContent/window.png)
## Results
Specular Probes Enabled
![result1-on](GithubContent/result1-on.png)Specular Probes Disabled
![result1-off](GithubContent/result1-off.png)Specular Probes Enabled
![result2-on](GithubContent/result2-on.png)Specular Probes Disabled
![result2-off](GithubContent/result2-off.png)### 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.