O'Reilly logo

Unity Shaders and Effects Cookbook by Kenny Lammers

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Normal maps and reflections in Unity3D

There are situations where you are going to want to have the normal also perturb the reflected Cubemap. Let's say you want to simulate a surface like frosted glass, or the surface of an ice cube. You couldn't model in all the details of the surface and expect it to run at 60 fps in your game. We have to use normal maps to fake the effects of higher resolution details, so we need to learn how to pass the normal map information to the reflection effect.

To accomplish this task, we are going to look at another built-in parameter to the Input struct that will pass in the modified surface normal, generated by the normal mapping technique. So, let's see how we need to modify the Input struct to produce this effect. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required