beta
cables is under heavy development.
There might be one or another bug, please let us know about it!
add shadow capabilities to any material

summary (oneliner)

This op is an extension for all materials. If attached after one, the material will have the capabilities to receive shadows.
Four different shadow algorithms are selectable.

It is also possible to use an opacity mask to discard parts of a mesh ("punch holes" into shadows).

The example on the right is a minimal example for the new Shadow op.

For intermediate examples, please refer to the shadow documentation and these patches:

Multiple occluders:
https://cables.gl/p/Iqob_e

Multiple occluders & multiple lights:
https://cables.gl/p/Hd5J_e

If you want to see a more advanced example, visit this patch:
https://cables.gl/p/M0F2We

doc

issues

youtube id

collections

related ops

Inputs

Trigger In (Trigger)

trigger input


Cast Shadow (boolean / Number)

if true, following meshes will cast shadows, if false, following geometries will NOT cast shadows


Receive Shadow (boolean / Number)

if true, following meshes will receive shadows


Algorithm index (integer / Number)

index for algorithm


Shadow Settings

Algorithm (String)

choose between the 4 algorithms: Default, PCF (Percentage-Closer Filtered Shadows), Poisson, VSM (Variance Shadow Mapping)


Samples index (integer / Number)

Shadow Settings

Samples (String)

only active when PCF or Poisson algorithm is used: amount of samples taken to soften shadows


Sample Distribution (integer / Number)

distribution of sampled points, the higher the value, the smaller the "wash", if the value is too low, step artefacts can occur


R (Number)

R color channel of the shadow


G (Number)

G color channel of the shadow


B (Number)

B color channel of the shadow


Discard Transparent (boolean / Number)

Opacity Settings

Opacity Threshold (Number)

alpha threshold for discarding pixels


Alpha Mask Source index (integer / Number)

Opacity Settings

Alpha Mask Source (String)

source channel of texture for discarding pixels: r, g, b, a or luminance


Opacity Texture (Object)

alpha texture input


Outputs

Trigger Out (Trigger)

trigger output


Caught a mistake or want to contribute to the documentation?

Edit Documentationcancel save
Shadows_v2 - example simple:

This is the minimum example for the new Shadow op.

For intermediate examples, please refer to the shadow documentation and these patches:

Multiple occluders:
https://cables.gl/p/Iqob_e

Multiple occluders & multiple lights:
https://cables.gl/p/Hd5J_e

If you want to see a more advanced example, visit this patch:
https://cables.gl/p/M0F2We



Credits


Changelog


Ops.User.cables.ShadowModuleWithoutStruct renamed to Ops.Admin.ShadowModuleModifier
2020-06-25 - cables

added core lib: cgl_shadermodifier
2020-06-30 - cables

Ops.Admin.ShadowModuleModifier renamed to Ops.Gl.ShaderEffects.Shadow_v2
2020-07-29 - pandur

Examples using Shadow_v2

Public Patches using Shadow_v2