Skip to content

Conversation

lLcrowe-dev
Copy link

@lLcrowe-dev lLcrowe-dev commented Aug 21, 2025

Ported the stencil shadow volume shader from CesiumJS to Unity (For URP).
support for stencil shadow volume rendering technique in order to render vector shapes visualize on terrain.

(My colleague @TomLeeLive is planning to do PR for VCTR polygon mesh processing, and it would work well together with this functionality.)

Instruction.
Follow this Step

//Project Setting

  1. In ProjectSetting >> Graphics >> ScriptableRenderPipelineSetting
  2. Select SRPSetting >> Rendering >> index0 (UniversalRendererData)
  3. AddRendererFeature >> Add 2 more "RenderObjects (Experimental)" A, B
  4. Set A B RenderObjects >> Layer Mask >> "Everything"
  5. A RenderObjects >> Filters >> LightMode Tags >> Add "Step1"
  6. B RenderObjects >> Filters >> LightMode Tags >> Add "Step2"
  7. Sort this role A(Step1), B(Step2)

//Create Material

  1. In Shader "CesiumToUnityStencilShadowVolume"
  2. Select And RightMouseClick >> Create >> Material
  3. Choose Color

// Use case example

  1. Return the Scene. And Create cube.
  2. Apply the Material(CesiumToUnityStencilShadowVolume) To the cube >> Set Scale (1, 20, 1)
  3. Create Other Cube >> Set Scale (100, 1, 100)
  4. Select Apply the Material cube >> Overlap the two cube

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant