-
Notifications
You must be signed in to change notification settings - Fork 19
Feature SubSurface Scattering
Subsurface scattering is the effect of simulation light transmission through (semi)transluscent materials (not fully opaque, not transparent). A full explanation of this effect can be found: https://en.wikipedia.org/wiki/Subsurface_scattering
As implemented by TexturesUnlimited, this effect allows for objects to only partially occlude light sources that are behind them from the perspective of the viewer, resulting in the appearance of an object being at least partially transluscent. Normally this effect would be used on objects made of wax, jade, flesh, or frosted glass. In TU and KSP this effect is mostly used to simulate semi-transparency of thin-film solar panels.
The implementation used by TexturesUnlimited is a 'fast approximation' of SubSurface Scattering -- notably it does not take into account the full light travel path, and relies simply on a depth/thickness texture for geometry-specific attenuation and transmission values.
The source reference for the implementation used by Textures Unlimited may be found at the following: https://colinbarrebrisebois.com/2011/03/07/gdc-2011-approximating-translucency-for-a-fast-cheap-and-convincing-subsurface-scattering-look/ with additional input and modifications from the implementation from: https://www.alanzucconi.com/2017/08/30/fast-subsurface-scattering-1/
This texture determines the light transmission amounts at the point of exit. White = full transmission, black = no transmission. Inbetween values of gray simulate partial transmission. Colored values can be used to simulate light tinting as it passes through the object.
This determines the ambient light factor that will be input into the equations regardless of any actual 'Light' objects in the scene.
Multiplier/scale factor applied to the subsurface output.
Exponential/non-linear growth factor applied to the subsurface output.
Higher distortion levels 'pull' the emitted light towards the surface (which may be towards or away from the viewer). Negative distortion levels limit/minimize view-direction dependence.
Determines how 'thick' the object is; used as a base multiplier to the input thickness texture. Higher values simulate a thicker object, and more light loss.
The below is an example of how to configure the SubSurfaceScattering effect inside any of TextureUnlimited's MATERIAL configuration blocks (this material block should be inside of a texture set/model shader for its intended use).
MATERIAL
{
shader = TU/Metallic
//other mesh, excludeMesh, texture assignments, and properties as
// needed for the material would be placed here
//the below will activate the effect, specify the thickness texture (optional),
// and specify the parameter values (optional, defaults shown)
texture = _Thickness, YourModName/Assets/YourTextureName
keyword = TU_SUBSURF
float = _SubSurfAmbient, 0
float = _SubSurfScale, 1
float = _SubSurfPower, 1
float = _SubSurfDistortion, 0
float = _SubSurfAttenuation, 1
}
- TODO - put together a couple simple model+texture setups to showcase how the effect works and what the parameters do.
- A single warped flat plane, to simulate a piece of cloth. Use 'distortion' to pull light in the direction of surface normal to approximate light-transmission through the cloth mesh (directional)
- Standard blender monkey-face to show use on a wax/stone/flesh type setup - non-distorted, no/low ambient
- Existing SSTU-ISS solar panel to show 'colored' emission.
- As none of this will work in Blender, use Unity Editor to produce preview/sample images.