Shadow_v2 Op

Shadow

add shadow capabilities to any material


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


Full Name
  • Ops.Gl.ShaderEffects.Shadow_v2
Visibility
  • Core Op - Official cables op
License
  • MIT
AuthorgithubTest Patches


Example Patch Shadow - Example

Adds shadows to your 3D Models

Open In Editor

INPUT PORTS


Trigger In (Trigger)

trigger input

Cast Shadow (Number: boolean)

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

Receive Shadow (Number: boolean)

if true, following meshes will receive shadows

Algorithm index (Number: integer)

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 (Number: integer)

Shadow Settings

Samples (String)

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

Sample Distribution (Number: integer)

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 (Number: boolean)

Opacity Settings

Opacity Threshold (Number)

alpha threshold for discarding pixels

Alpha Mask Source index (Number: integer)

Opacity Settings

Alpha Mask Source (String)

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

Opacity Texture (Object:texture)

alpha texture input

OUTPUT PORTS


Trigger Out (Trigger)

trigger output


Patches using Shadow_v2

  • Examples
  • Public
  • My Patches

Changelog


Ops.User.cables.ShadowModuleWithoutStruct renamed to Ops.Admin.ShadowModuleModifieruser avatarcables - 2020-06-25 16:44
added core lib: cgl_shadermodifieruser avatarcables - 2020-06-30 15:18
Ops.Admin.ShadowModuleModifier renamed to Ops.Gl.ShaderEffects.Shadow_v2user avatarpandur - 2020-07-29 22:47