Coder Social home page Coder Social logo

frostbone25 / unity-specular-probes Goto Github PK

View Code? Open in Web Editor NEW
32.0 1.0 2.0 4.31 MB

A simple editor script that emulates specular highlighting for every light in the scene on reflection probes when baking them.

License: MIT License

C# 100.00%
rendering rendering-3d-graphics unity unity-3d unity-editor unity-package unity-scripts unity3d-plugin

unity-specular-probes's Introduction

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

Results

Specular Probes Enabled result1-on

Specular Probes Disabled result1-off

Specular Probes Enabled result2-on

Specular Probes Disabled result2-off

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 implementation, however I opted for my own and went for a more simplified but global solution that also can do area lights as well.

unity-specular-probes's People

Contributors

frostbone25 avatar soulwithmae avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.