From Unify Community Wiki
Jump to: navigation, search


Lux – an open source shader framework

Lux is an open source shader framework built upon unity’s 5.x rendering and shading pipeline. It adds advanced lighting features such as area lights, translucent and skin lighting and allows you to easily use effects like dynamic weather, mix mapping or parallax occlusion mapping.

[1] Lux on the Asset Store | [2] Lux on GitHub | [3] Documentation


Area Lights and diffuse fill lights

Lux supports tube, sphere (both based on point lights) and disc (spot lights only) area lights which can be globally enabled and disabled. When using forward rendering area lights might even be enabled on a per material basis. Diffuse fill lights allow you to add point or spot lights which mainly affect diffuse lighting while specular highlights might be completely suppressed or simply dimmed in order to create “traditional” fill lights and fake global illumination.


Lux BRDFs and further lighting features

Lux supports unity’s built in physically based standard lighting which is pretty much used as is (GGX BRDF).

Translucent lighting

gets added on top of standard lighting. It is based on a well known solution presented by DICE and was first brought to Unity by Farfarer. It is not physically correct but still delivers nice and believable results as far as deep subsurface scattering is concerned while being pretty fast to render. In order to not loose translucent lighting on self shadowed objects Lux allows you to suppress shadows on translucent objects. If the “Scattering Power” is set to 0.0 the shader uses wrapped NdotL based translucent lighting – suitable for single sided geometry and foliage rendering.


Anisotropic lighting

uses an anisotropic GGX BRDF as proposed by Brent Burley and allows you to define a specular spread along the tangent or bitangent in order to create materials like brushed metal or even hair.


Pre-integrated skin lighting

is based on the work of Eric Penner. It adopts an implementation first presented by Farfarer and combines deep subsurface scattering from a static depth map (like translucent lighting) and light scattering calculated dynamically based on the given curvature of the (skinned) surface.


Diffuse scattering, asperity scattering or peach fuzz

currently simply boosts the albedo color at grazing angles but gives you a very cheap possibility to create surfaces like velvet or surfaces covered by a thin layer of “something” that scatters light like e.g. ice. Compared to translucent lighting this will only add light scattering at the outmost parts of the surface whereas translucent light will give you deep subsurface scattering.

Ambient specular reflections

use Lazarov’s environmental BRDF optimized by Epic. You can return to the built in BRDF editing the “Lux Config.cginc”.

Surface Features

Dynamic Weather

Dynamic weather allows you to dynamically accumulate wetness/water and snow – both generally controlled by global script input such as temperature and rainfall over time as well as material and object specific properties like world normal, height or slope damp.


Mix Mapping

Unlike unity’s built in detail mapping mix mapping allows you to blend between 2 different texture sets either controlled using vertex colors or texture input and takes the height per pixel into account if present to calculate the final blending result. It supports 2 independent physically based material sets of which each has its own albedo, diffuse scattering, smoothness, specular and normal as well as special wetness/water and snow settings.

Parallax Mapping, Parallax Occlusion Mapping (POM) and Tessellation

Both techniques let you to add a much better sense of depth to your materials. Whereas parallax mapping is super-cheap to render as it only needs one single additional texture lookup and some very easy math POM really might kill your frame rate as Lux uses a pretty simple but quite accurate implementation if it comes to mix mapping.


Further Features


Lux refraction shaders support refraction based on the geometry's normal as well as the applied bump map.


Deferred Geometry Decals

Lux support deferred geometry based decals which smoothly fade with the underlaying surface.

Personal tools