# DisplayPipeline.Draw\* elements suddenly casting shadows in R8.18+

**URL:** <https://discourse.mcneel.com/t/displaypipeline-draw-elements-suddenly-casting-shadows-in-r8-18/203655>\
**Category:** Rhino Developer\
**Tags:** windows, shadows, rhino8-bug, display-conduit\
**Created:** [April 26, 2025, 8:19pm UTC](https://discourse.mcneel.com/t/displaypipeline-draw-elements-suddenly-casting-shadows-in-r8-18/203655 "2025-04-26T20:19:41Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![sarg](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/sarg/32/669423_2.png) [@sarg](https://discourse.mcneel.com/u/sarg)\
**Post date:** [April 26, 2025, 8:19pm UTC](https://discourse.mcneel.com/t/displaypipeline-draw-elements-suddenly-casting-shadows-in-r8-18/203655/1 "2025-04-26T20:19:41Z")

</div>

As of Rhino 8.18 or perhaps earlier, display elements created using `DisplayPipeline.Draw*()` are casting shadows in rendered display modes (where \*=YouNameIt… MeshShaded, Curve, Points, Polyline, etc.).

Is this a bug? If not, please let us know how to disable the behavior.

---

<div class="post-metadata">

**Author:** ![michaelvollrath](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/michaelvollrath/32/479405_2.png) [@michaelvollrath](https://discourse.mcneel.com/u/michaelvollrath)\
**Post date:** [April 26, 2025, 8:31pm UTC](https://discourse.mcneel.com/t/displaypipeline-draw-elements-suddenly-casting-shadows-in-r8-18/203655/2 "2025-04-26T20:31:11Z")

</div>

Hi @sarg,

Not sure as to “why” that is different post 8.18 but give this a try:

[https://developer.rhino3d.com/api/rhinocommon/rhino.display.displaypipelineattributes/shadowson](https://developer.rhino3d.com/api/rhinocommon/rhino.display.displaypipelineattributes/shadowson)

```auto
Rhino.Display.DisplayPipelineAttributes.ShadowsOn = False

```

Make sure that goes “before” whatever you are drawing to disable shadows.

---

<div class="post-metadata">

**Author:** ![sarg](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/sarg/32/669423_2.png) [@sarg](https://discourse.mcneel.com/u/sarg)\
**Post date:** [April 27, 2025, 7:03pm UTC](https://discourse.mcneel.com/t/displaypipeline-draw-elements-suddenly-casting-shadows-in-r8-18/203655/3 "2025-04-27T19:03:49Z")

</div>

Thanks @michaelvollrath. Unfortunately that doesn’t quite work. Here’s what I tried:

```auto
// 1: myObjects still cast shadows
protected override void PostDrawObjects(DrawEventArgs e)
{
    e.Display.DisplayPipelineAttributes.ShadowsOn = false;
    e.Display.Draw*(myObjects);
    e.Display.DisplayPipelineAttributes.ShadowsOn = true;
}

```

```auto
// 2: nothing casts shadows, including actual RhinoDoc objects
protected override void PostDrawObjects(DrawEventArgs e)
{
    e.Display.DisplayPipelineAttributes.ShadowsOn = false;
    e.Display.Draw*(myObjects);
}

```

```auto
// 3: nothing casts shadows, including actual RhinoDoc objects
protected override void PreDrawObjects(DrawEventArgs e)
{
    e.Display.DisplayPipelineAttributes.ShadowsOn = false;
    e.Display.Draw*(myObjects);
    e.Display.DisplayPipelineAttributes.ShadowsOn = true;
}

```

I also tried each of the above using [CastShadows](https://developer.rhino3d.com/api/rhinocommon/rhino.display.displaypipelineattributes/castshadows) instead of ShadowsOn, with the same results.

If anyone knows of a different sequence that works, I’m all ears. Either way, I’d imagine many 3rd-party plug-ins use RhinoCommon’s `Pre/PostDrawObjects` overrides – and until now, these routines have never participated in shadow casting. Ideally that default behavior would be restored…

---

<div class="post-metadata">

**Author:** ![stevebaer](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/stevebaer/32/473567_2.png) [@stevebaer](https://discourse.mcneel.com/u/stevebaer)\
**Post date:** [December 12, 2025, 4:44pm UTC](https://discourse.mcneel.com/t/displaypipeline-draw-elements-suddenly-casting-shadows-in-r8-18/203655/4 "2025-12-12T16:44:48Z")

</div>

You might want to try drawing during the foreground phase as that is after all shadow operations are performed. In the foreground phase depth testing and writing are typically disabled so you may want to temporarily turn it on.

```auto
protected override void DrawForeGround(DrawEventArgs e)
{
    e.Display.PushDepthTesting(true);
    e.Display.PushDepthWriting(true);
    e.Display.Draw*(myObjects);
    e.Display.PopDepthWriting();
    e.Display.PopDepthTesting();
}

```
