

What this shader does is set a reflection probe and set a transparent reflection onto the windows of the car. The white colour is used to not leave a colour tint on the reflections and makes it easier to see the reflections on the glass.


This is the graphical editor for the custom shader that was written. This allows the user to adjust the values that will be passed through the shader without needing to know how to code.

This is the code that sets the visual input values shown above and sets them to a property variable. There are limits set to some of the properties.

What this then does is feed the properties into the functions and sets the diffuse lighting by using the dot product of the normal and light direction. Then the lambert is calculated by using the diffuse light and multiplying it by 0.5 and adding 0.5 to get a nice value to be used. The rim light is calculated by using the dot product of the normal and view direction. The lambert and rim light are then applied to the ramp texture. the albedo and colour are then applied to the ramp texture then returned.

The next function is then used to sort out the reflections based on the metallic, fernal and reflections. This is also done by using the emissive colour, ambient colour and the amplification.