LyCheSis:ShowCase

LyCheSis:ShowCase

Who am I?

Unity / Unreal Developer and 3D Artist


What I write about


Recent Posts

Shader 101

Here's a collection of shader algorithms in node form for the Amplify Shader Editor. Useful, should you ever want to build a shader with custom lighting and are too lazy to do it in code.

Diffuse

Diffuse

Simply the dot product between the surface normal and light direction in world space.

Specular

Specular

The dot product between the surface normal and the normal half way between view direction and light direction. The hardness can be adjusted by power with the hardness as exponent.

Fresnel

Fresnel

The dot product between the surface normal and the view direction. This is basically the incidence angle and can be used to imitate how surfaces become more shiny the steeper the viewing angle becomes or as a ghostly/x-ray outline effect. Amplify has it's own fresnel node which also includes support for normal maps and other adjustments.

Matcap

Matcap

The surface normal transformed by the view matrix. With this we can get the surface normal in camera space and can use it in this case to sample and transfer the "baked" shading of a sphere. It's also similar to the fresnel shader, but includes the direction and not only the amount of deviation.

Refraction

Refraction

The surface normal transformed by the view matrix. Again we can use the surface deviation, but this time to offset the pixels that are being sampled from the grab screen color, allowing us to create fake refractions for transparent surfaces. Doesn't take into account thickness of medium, distance other meshes, backfaces of the mesh and chromatic aberration.

Other useful nodes

Light Attenuation

Returns a factor that takes into account the fall-off of light over distance. Also includes real time shadows. Note: Will only appear if Lighting Model is set to Custom Lighting.

Light Color

Contains the light color of the current light source.

Indirect Diffuse Light

Contains the ambient diffuse light calculated by Unity's global illumination system. This is basically image based lighting (IBL).

Indirect Specular Light

Contains the environment specular reflections calculated by Unity's rendering engine. This is basically image based lighting (IBL).