# Shadow Map size

**URL:** <https://discourse.mcneel.com/t/shadow-map-size/59516>\
**Category:** Rhino for Windows\
**Created:** [April 2, 2018, 4:28pm UTC](https://discourse.mcneel.com/t/shadow-map-size/59516 "2018-04-02T16:28:36Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jarek](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/jarek/32/511212_2.png) [@Jarek](https://discourse.mcneel.com/u/Jarek)\
**Post date:** [April 2, 2018, 4:28pm UTC](https://discourse.mcneel.com/t/shadow-map-size/59516/1 "2018-04-02T16:28:36Z")

</div>

I was wondering if the min-max shadow map size setting for DisplayModes is the same on all systems, or depends on the video card somehow as well? In all systems I have access to it looks the same but they are quite similar, so curious if everyone has the same range available for shadow quality ( 16 Kb - 260 Mb )

 ![Shadows](https://global.discourse-cdn.com/mcneel/original/3X/5/2/526d24ee58f9ac75a8f566af63c0dcf7fdada63e.jpg)

–jarek

---

<div class="post-metadata">

**Author:** ![Jarek](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/jarek/32/511212_2.png) [@Jarek](https://discourse.mcneel.com/u/Jarek)\
**Post date:** [April 2, 2018, 8:45pm UTC](https://discourse.mcneel.com/t/shadow-map-size/59516/2 "2018-04-02T20:45:52Z")

</div>

Hi @Jeff - is that range a hard-coded setting, or system-dependent ?

---

<div class="post-metadata">

**Author:** ![jeff](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/jeff/32/523696_2.png) [@jeff](https://discourse.mcneel.com/u/jeff)\
**Post date:** [April 3, 2018, 3:20am UTC](https://discourse.mcneel.com/t/shadow-map-size/59516/3 "2018-04-03T03:20:44Z")

</div>

It’s hard coded. I guess I could make it a percentage of the overall GPU memory… I just don’t want people blowing out their GPU memory because their shadows are a little better…but then everything else is toast.

Are you finding that 260MB for your shadow maps is still not enough?

-J

---

<div class="post-metadata">

**Author:** ![Jarek](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/jarek/32/511212_2.png) [@Jarek](https://discourse.mcneel.com/u/Jarek)\
**Post date:** [April 3, 2018, 6:25am UTC](https://discourse.mcneel.com/t/shadow-map-size/59516/4 "2018-04-03T06:25:53Z")

</div>

Jeff - thanks for confirming that. I think the range is good as-is, considering the security measure not to let users accidentally blow up the video memory.  
I needed this info for a plugin where as a part of functionality I can toggle between low quality and high-quality shadows quickly to control the display speed.

In general with Rhino 6 I am struggling to find a good balance of quality and speed in Render mode, when using both Skylight and Sun cast shadows. At the high/highest quality, when using both, the view speed reduction is quite significant and moving around the vport is not smooth anymore.  
At the same time, whether it is Skylight-only, or Sun-Shadows only (high-quality), the speed is still blazing fast.

Of course the best look is when both are ON. But in general visually lower Skylight quality is much more passable than low cast shadow quality. In ideal world we should be able to have grainy Skylight effect for speed (that still adds a lot of “meat” to the view) but sharp-edged shadows from high-quality cast-shadow setting. I wonder if such combination is possible and if it would result with a lot of speed gain.  
We would only care about super-smooth Skylight for screencaptures; a bit grainy for navigation is fine.

I was suggesting making two separate controls for Skylight and Cast Shadow quality earlier in Beta, not even knowing the speed slowdown effect now tested and described above. Now it comes up again with more thorough testing on real-life projects in V6.

> [@Viewport Render Shadow Quality](https://discourse.mcneel.com/t/viewport-render-shadow-quality/50019/25):
>
> Hi David - so it looks like the Skylight shadow quality is now hooked up to the main display mode shadows memory size / quality slider? Are they really connected ‘behind the scenes’ or this is just so there is no new UI introduced? There are some scenarios when one may want sharper/better quality cast shadows but just fast AO… so I thought the idea was to have a separate slider for Skylight quality. Also, now the Skylight quality actually affects its darkness/density, so the high quality shad…

@Andy, @DavidEranen - in case you see this, any ideas how to marry good quality cast shadows with Skylight that doesn’t slow down the display too much?

thanks,

–jarek

---

<div class="post-metadata">

**Author:** ![ec2638](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/ec2638/32/478589_2.png) [@ec2638](https://discourse.mcneel.com/u/ec2638)\
**Post date:** [April 3, 2018, 12:35pm UTC](https://discourse.mcneel.com/t/shadow-map-size/59516/5 "2018-04-03T12:35:41Z")

</div>

> [@Jarek](#):
>
> In general with Rhino 6 I am struggling to find a good balance of quality and speed in Render mode

And you’re a highly proficient user…unless this is simply some funk between skylight and sun, that can be fleshed out? (I haven’t delved in 6 yet beyond a cursory look)

> [@Jarek](#):
>
> In ideal world we should be able to have grainy Skylight effect for speed (that still adds a lot of “meat” to the view) but sharp-edged shadows from high-quality cast-shadow setting. I wonder if such combination is possible and if it would result with a lot of speed gain.

I perceive your ask as part of the ‘secret-sauce’ of Keyshot, and its quality level presets.

---

<div class="post-metadata">

**Author:** ![Patt](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/patt/32/480176_2.png) [@Patt](https://discourse.mcneel.com/u/Patt)\
**Post date:** [April 3, 2020, 8:07am UTC](https://discourse.mcneel.com/t/shadow-map-size/59516/6 "2020-04-03T08:07:04Z")

</div>

Sorry for reviving a dead thread. @jeff It would be **incredibly** useful to override the 260MB limit on shadow maps on more powerful systems with modern GPU’s. The real-time shadows in Rendered display mode are just such a handy piece of instantaneous feedback, but they can easily look grainy on larger scenes, and I frequently have to adjust the clipping bubble to improve them.

Are there any numbers I can change in the Advanced section of the Rhino settings menu?

(My usage case is modelling Architectural shade devices. I’ve just been deep diving through the Rhino6 display settings trying to wring more performance out of my display modes with my GTX1060)

---

<div class="post-metadata">

**Author:** ![Jarek](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/jarek/32/511212_2.png) [@Jarek](https://discourse.mcneel.com/u/Jarek)\
**Post date:** [April 3, 2020, 8:39am UTC](https://discourse.mcneel.com/t/shadow-map-size/59516/7 "2020-04-03T08:39:00Z")

</div>

hi Patt,

I agree it would be handy to have higher values exposed in the UI (maybe only in advanced options) to take advantage of the high end video cards.  
In the meantime, you can try this small script - it should let you set custom size of the shadow map beyond the UI setting:

[SetDisplayModeShadowQualityCustom.rvb](https://discourse.mcneel.com/uploads/short-url/xD8p4vsjFDcK9TFgJOXZbdDAo5u.rvb) (279 Bytes)

if you look at the script code, it is using 16512 as the shadow value, which translates to double the size allowed by Rhino UI. I use this one as highest setting since it is close to the max texture size my video card allows (listed under Rhino Options \> View ? OpenGL settings ) here :  
 ![image](https://global.discourse-cdn.com/mcneel/uploads/default/original/3X/9/3/939a2e5550978ad27e7166ae0edf3cfb93d287db.png)

if you have better card/larger texture size allowed, you can experiment with changing the number in the script. To get back to lower quality, just use Rhino UI.

hth,

–jarek

---

<div class="post-metadata">

**Author:** ![Patt](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/patt/32/480176_2.png) [@Patt](https://discourse.mcneel.com/u/Patt)\
**Post date:** [April 6, 2020, 2:34am UTC](https://discourse.mcneel.com/t/shadow-map-size/59516/8 "2020-04-06T02:34:17Z")

</div>

Thank you **so much**. That’s such an amazing help. With your script, I’ve boosted the shadow map up to 21,696‬ with good results, but the value you set is a little faster. The shadows are so sharp, this is brilliant, thanks.

It would be great if Rhino could scale the shadow clipping radius dynamically depending on the distance from the camera target for large scenes (like having different levels of detail in depending on scale in Google maps). It could be set to generate a detailed shadow map when up the camera is at the zoom level defined as ‘close’, and then a less detailed one when further away. Maybe this could be based on starting template/accuracy. That would probably get the best balance of performance and detail from real-time shadows.

---

<div class="post-metadata">

**Author:** ![Jarek](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/jarek/32/511212_2.png) [@Jarek](https://discourse.mcneel.com/u/Jarek)\
**Post date:** [April 6, 2020, 9:57am UTC](https://discourse.mcneel.com/t/shadow-map-size/59516/9 "2020-04-06T09:57:50Z")

</div>

Hi Patt,

> [@Patt](#):
>
> I’ve boosted the shadow map up to 21,696‬ with good results, but the value you set is a little faster.

good to see it works on your end. Here is a tip regarding the performance - I bet if you don’t use the Skylight shadows (AO), the display performance is very fast with just cast shadows, even with your highest map setting (at least that’s the case here). It is the Skylight shadows that slow things down with higher shadow map value settings. Obviously things look best when both types of shadows are enabled. The problem is, the Skylight shadows and Cast Shadows use the same setting for quality, even though much lower values of Skylight work quite well, but when you try to achieve sharp edges cast shadows and ramp up the map size, it bogs down the display because Skylight map is also ramped up, which is not noticeable in display quality, but only in slower performance. Currently there is not that much that can be done about this except for one small setting:  
You can try Options \> Advanced and find Rhino.Options.OpenGL.SkylightShadowResolutionScaleDynamic, and set it to 3 (instead of default 2):  
 ![image](https://global.discourse-cdn.com/mcneel/uploads/default/original/3X/0/8/0888c22478a711c28ab7f353046ea68b21ebb3f3.png)  
What it does is it tells Rhino to use 1/4 of the Shadow Map size to generate the Skylight shadows. It can help a bit to alleviate the effect of ramping up the map size for sharp cast shadows.  
You can see the explanation for these values (1,2 or 3) here:

> [@What are these Advanced Options for SkylightShadows?](https://discourse.mcneel.com/t/what-are-these-advanced-options-for-skylightshadows/80761/7):
>
> Here’s how they work: SkylightShadowResolutionScale and SkylightShadowResolutionScaleDynamic control the resolution (i.e. the amount of pixels) the skylight shadows are rendering at. Valid values are between 1-3. SkylightShadowResolutionScale = 1 means native resolution. A value of 2 means the pixel resolution is halved, a value of 3 means it’s one quarter of native resolution. SkylightShadowResolutionScaleDynamic is the same as above, except this one is used when rendering a dynamic display…

Maybe that helps a bit on your end.

@andy, @DavidEranen, @jeff - this is another example of what I was bringing up several times regarding the display performance and shadows. Hope you agree there is some room for improvement:

1. with the newer video cards, the shadow map quality cap may be too low now. If not in main slider, maybe the upper value can be exposed in Advanced Options for users to type any number they want? Or Rhino to cap it there at the maximum supported texture size per-system?

2. Ramping up the shadow quality is used to achieve sharp edge shadows on larger scale models (always the case in architecture). The shadow bubble often doesn’t cut it and is also cumbersome to use. High quality cast shadows on their own look great and display is fast, but as stated above, having them and Skylight shadows together causes the display to slow down a lot, due to Skylight being slow with very high shadow map sizes, with no noticeable Skylight quality improvement. Basically Skylight looks good with much lower values. At the same time both shadow types enabled give us the best look, so we need to find a way to have them both work well.

1. Ideal solution would be having separate Shadow Quality slider for Skylight and Cast Shadows. That would give users full control of the look vs. display performance. My understanding from past talk with David E is that under the hood these two are separated and it’s only current UI that connects them. Would you consider separate controls for there before it’s too late in V7 (UI lock?)

2. The workaround I suggested to Patt (using lower dynamic display Skylight map degradation value) somehow helps, but with ramping up the map sizes a lot, 1/4 degradation is still not enough. @DavidEranen - would it be possible to enable steps 4 or 5 (1/8 and 1/16) or even 1/32 for Dynamic Display degradation in Advanced Options? If we have separate shadows sliders, there would be no need for this, but if not, this could be a life-saver. The problem with this method is that it is global, not per-display mode, so other display modes that use skylight shadows and lower values can suffer and we would need to switch this setting back-and forth; so separate sliders per-display mode would be better IMHO.

Hope this is reasonable and you can consider these suggestions.

thanks,

–jarek

---

<div class="post-metadata">

**Author:** ![Patt](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/patt/32/480176_2.png) [@Patt](https://discourse.mcneel.com/u/Patt)\
**Post date:** [April 6, 2020, 11:50am UTC](https://discourse.mcneel.com/t/shadow-map-size/59516/10 "2020-04-06T11:50:17Z")

</div>

Thanks for that tweak, display performance is faster with no noticeable loss of quality when adjusting SkylightShadowScaleDynamic. And turning off the skylight all-together was a fantastic speed boost - vector like shadows go a long way in convincing some in the Architecture community that Rhino may be more viable and useful than SketchUp, as insane as that sounds (now if only we could get a few tweaks to the walkthrough tools).

Yes, the current clipping bubble seems a bit clunky and unintuitive. It would be great to have an option to set it to ‘Auto’ mode to set it based on a distance from Camera target (with a few brackets eg factor of 10 or factor of 3).

I’d second a call for a separate slider for Skylight shadows and Sun Shadows, it seems like that would really boost the capabilities of the Rendered viewport mode without adding much to the complexity from the user’s side. (And while we’re at it, a variable slider for ambient occlusion diameter, to add on to the wishlist 😛). Thanks for the tips, I love the community around Rhino.

---

<div class="post-metadata">

**Author:** ![nPoika](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/npoika/32/683662_2.png) [@nPoika](https://discourse.mcneel.com/u/nPoika)\
**Post date:** [September 5, 2021, 5:44am UTC](https://discourse.mcneel.com/t/shadow-map-size/59516/11 "2021-09-05T05:44:58Z")

</div>

Hello @Jarek ! I know I’m in the wrong neck of the woods, but is there any chance of converting that script to Python so I can run it on my MacOS version? (If that’s even possible).

---

<div class="post-metadata">

**Author:** ![Jarek](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/jarek/32/511212_2.png) [@Jarek](https://discourse.mcneel.com/u/Jarek)\
**Post date:** [September 5, 2021, 6:26am UTC](https://discourse.mcneel.com/t/shadow-map-size/59516/12 "2021-09-05T06:26:03Z")

</div>

Hi Nathan,

What version of Rhino are you on? If 7, that script is not useful anymore since Rhino 7 allows for much higher map size via UI, which was limited in older versions and only available through that trick.

Otherwise it is probably possible to convert the script to python (or write similar that just changes the display mode shadow map size) but unfortunately I will not be able to help with that in the near future.

Best,

–jarek

---

<div class="post-metadata">

**Author:** ![nPoika](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/npoika/32/683662_2.png) [@nPoika](https://discourse.mcneel.com/u/nPoika)\
**Post date:** [September 5, 2021, 7:46am UTC](https://discourse.mcneel.com/t/shadow-map-size/59516/13 "2021-09-05T07:46:38Z")

</div>

Thanks for the reply! Using 7 - however it shadows still look kind of ordinary, perhaps there is no solution in a shaded view ☹

Is below about as good as it gets? (referring to the jaggies around the curved edge) I’m aiming for sharp shadows (sketchup-esque)

 ![Screen Shot 2021-09-05 at 5.43.01 pm](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/1/9/b/19b45a38a791e1a6166e28bd06702b039a6e7781.png)

Thanks again for the reply!

---

<div class="post-metadata">

**Author:** ![nPoika](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/npoika/32/683662_2.png) [@nPoika](https://discourse.mcneel.com/u/nPoika)\
**Post date:** [September 5, 2021, 8:05am UTC](https://discourse.mcneel.com/t/shadow-map-size/59516/14 "2021-09-05T08:05:59Z")

</div>

Ah! Found another one of your posts where you can override the value in the display.ini export, (could bump it up to 3300mb) which made it look a little better, buuuut isn’t practical and I assume will create stability issues. Guess I’ll just have to do proper renders for decent hard shadow shots.

---

<div class="post-metadata">

**Author:** ![Jarek](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/jarek/32/511212_2.png) [@Jarek](https://discourse.mcneel.com/u/Jarek)\
**Post date:** [September 5, 2021, 8:09am UTC](https://discourse.mcneel.com/t/shadow-map-size/59516/15 "2021-09-05T08:09:23Z")

</div>

Assuming you maxed out the shadow map size/quality slider in the display mode, there are a couple of other things to look at to possibly improve.  
Rhino shadows will never be as sharp as Sketchup since they use shadow map and not vectror, so the more you zoom in, the more pixelated they are.  
However, they are calculated based on the overall visible scene bouding box, so if you have some objects very far from where you are looking at, this affects the quality. So I would look for that in the first place, try to make the model as “small” (not vast) as possible.  
Another thing to try is objects that don’t “casts” shadow don’t contribute to the size of the shadow map, so for example if you have a scene with a large ground plane that only needs to receive shadows but not cast, try in its properties unchecking “Cast Shadows” and only use “Receive”, this may help.  
Last resort could be using the display mode’s “Camera-Based Clipping Bubble” slider, but it is not very convernient - view based, depends on the camera target distance that is not obvious for most users where it actually is and keep changing on its own while navigating the view in most cases, and overall pretty bad workaround, I would not say it is not very useful in real-life production workflow.

Hope that helps, V7 shadow map size improved a lot, but also may be limited by your video card memory, not sure if all cards can handle the max map size the slider allows.

-j

---

<div class="post-metadata">

**Author:** ![Jarek](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/jarek/32/511212_2.png) [@Jarek](https://discourse.mcneel.com/u/Jarek)\
**Post date:** [September 5, 2021, 8:11am UTC](https://discourse.mcneel.com/t/shadow-map-size/59516/16 "2021-09-05T08:11:54Z")

</div>

of course you can experiment with that but I find that V7 max UI shadow map value (1GB) works very well for sharp shadows in quite large scenes. Of course if you have model of a few blocks of a city and try to zoom in to the base of a chair, this will not work well for shadows quality if you keep all objects on, only way is the dreaded camera clipping bubble…

---

<div class="post-metadata">

**Author:** ![nPoika](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/npoika/32/683662_2.png) [@nPoika](https://discourse.mcneel.com/u/nPoika)\
**Post date:** [September 5, 2021, 8:14am UTC](https://discourse.mcneel.com/t/shadow-map-size/59516/17 "2021-09-05T08:14:05Z")

</div>

awesome! thanks for the tips, I’ll give them a whirl. I think you’re right about it being contingent on the specific GPU I have got an M1 mac (16GB) which doesn’t have dedicated GPU ram so it might be a little more conservative.

Thanks again!

---

<div class="post-metadata">

**Author:** ![Jarek](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/jarek/32/511212_2.png) [@Jarek](https://discourse.mcneel.com/u/Jarek)\
**Post date:** [September 5, 2021, 8:15am UTC](https://discourse.mcneel.com/t/shadow-map-size/59516/18 "2021-09-05T08:15:20Z")

</div>

I see, sorry I have zero knowledge about Macs but maybe some of the above tips could help you improve the display. It’s all about the scene bounding box size…

---

<div class="post-metadata">

**Author:** ![Czaja](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/czaja/32/472252_2.png) [@Czaja](https://discourse.mcneel.com/u/Czaja)\
**Post date:** [September 5, 2021, 8:49am UTC](https://discourse.mcneel.com/t/shadow-map-size/59516/20 "2021-09-05T08:49:01Z")

</div>

> [@Jarek](#):
>
> Last resort could be using the display mode’s “Camera-Based Clipping Bubble” slider, but it is not very convernient

True, when I had it turned on for the first time I thought I had some kind of display bugs. If one understands how it works it may be possible to control its behavior but as you said it’s rather inconvenient.

_Last video of this post - rather unexpected behavior of camera clipping bubble_

> [@A Lot of troubles with Display Modes](https://discourse.mcneel.com/t/a-lot-of-troubles-with-display-modes/120830/2):
>
> Rhino 7.6.21124.9001 
> 
> > **SYSTEM INFO**
> >
> > Rhino 7 SR6 2021-5-4 (Rhino 7, 7.6.21124.09001, Git hash:master @ 1a9a92254a9f347268c4c9c7f2dec50bcd90215e) License type: Edukacyjna, build 2021-05-04 License details: Cloud Zoo Windows 10.0.19042 SR0.0 or greater (Physical RAM: 32Gb) Computer platform: LAPTOP - Plugged in [91% battery remaining] Non-hybrid graphics configuration. Primary display and OpenGL: NVIDIA GeForce GTX 1070 (NVidia) Memory: 8GB, Driver date: 4-8-2021 (M-D-Y). OpenGL Ver: 4.6.0 NVID…

Maybe Rhino should have Cascaded Shadow Maps? Or some other, modern solution.

---

<div class="post-metadata">

**Author:** ![jnavarro1](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/jnavarro1/32/480378_2.png) [@jnavarro1](https://discourse.mcneel.com/u/jnavarro1)\
**Post date:** [January 28, 2022, 9:16pm UTC](https://discourse.mcneel.com/t/shadow-map-size/59516/21 "2022-01-28T21:16:28Z")

</div>

I’ve noticed too that distance influence in the quality of the edge. I have this test both on 1gb to have this sharp shadows but as soon as i put a geometry far away, the quality of the edge gets jagged

 ![TEST RENDER 001](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/5/5/c/55c7edf3bdb224436325239fdb089d876330ba41.jpeg)  
Object on the background

 ![TEST RENDER 02](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/0/5/b/05b579b33ad8906b231b3cd31107bc45730c3a03.jpeg)  
Object deleted

See how quality on edges changes. I hope this could be solved in the future. Maybe adding a threshold for quality depending on distance of the camera, like LOD’s

[Next page](https://discourse.mcneel.com/t/shadow-map-size/59516.md?page=2)
