Thu, Nov 28, 4:05 PM CST

Renderosity Forums / Poser - OFFICIAL



Welcome to the Poser - OFFICIAL Forum

Forum Coordinators: RedPhantom

Poser - OFFICIAL F.A.Q (Last Updated: 2024 Nov 28 11:20 am)



Subject: Adjusting Shadow Map Size -vs- Shadow Cam views


Nance ( ) posted Fri, 11 October 2002 at 12:43 AM ยท edited Fri, 25 October 2024 at 9:40 AM

file_27000.jpg

Haven't tried explaining this in a while so here goes again.

While it is often recommended, and commonly accepted, that adjusting a lights ShadowMap Size will clear up most fuzzy or disappearing shadows, this is actually very misleading information.

At the risk of further spitting in the wind, may I once again suggest that adjusting the shadow map size will only be successful in limited situations. By far, the major controlling factor in determining shadow resolution for a given light setting is each lights ShadowCams field of view, NOT the overall size of the shadow map.

Now, before relating how many times its worked for you, just try to fix this simple example where it does not:

-Load a scene with the Factory Default Preferences (so we can all start the demonstration from the same place) .

-Turn on the Ground and zoom the Main Camera back until you can see the figures feet.

-Turn off lights #1 and #3 so that only #2 remains on, and change it to a Spotlight .

-Move Light 2 four units, up, out & left and adjust the rotations, so that it is hitting the guy from the front, top, left with these settings:

Angle Start 0
Angle End 70
Dist Start 0
Dist End 0
shadowStrength 1
MapSize 256
xrot -35
yrot -45
zrot 0
scale 1
RED 0.7813
GREEN 0.8086
BLUE 0.7578
INTENSITY 1
xtran -4.000
ytran 4.000
ztran 4.000

Although this represents a fairly typical light placement, without changing anything else, you can adjust the Shadow Map Size to your hearts content and you are still never going to get the sharp edged shadow as shown in the image above, or any shadow at all. (I tried map sizes up to 10,000 pixels)

To actually get a shadow, go to the Shadow Lite 2 Cam, and Zoom/Scale it from 100% to 8%.

Try the render again, and you can even set the Light 2 Shadow map size back down to something simple like 256. (Remember, you have to square the maps dimensions, so a shadow map set at 10,000 requires over 1500 times the system resources of one set at 256).

Hopefully (this time) this example clearly demonstrates that the ShadowMap size is by far secondary to the ShadowCam View in the control of shadows. Its just logical that the total number of pixels in the map size is much less important than the number of pixels in that map that are actually covering the objects that need to cast shadows.

Yet, we still regularly see nubies being told that all they have to do is increase the map size and the shadows will reappear -- with never (that Ive seen) any mention of manipulating the lights Shadow Cam views.

Having banged the drum on this for some time (to no avail), I'm just curious if perhaps Ive explained it really poorly, or if the results are simply not repeatable for the rest of you guys. (or if its just a big practical joke on olNance)

Anyone NOT able to get the same results?


Nance ( ) posted Fri, 11 October 2002 at 1:05 AM

file_27001.jpg

Perhaps I should have also pointed out that it is the view from each ShadowCam from which the light's ShadowMaps are generated.

Here are the views from the ShadowCams in the example above:


Spanki ( ) posted Fri, 11 October 2002 at 1:25 AM

Thanks Nance - I'll look into this... I'd never seen this discribed before (it's certainly not in the manual and I guess I've missed any earlier explanations by you or others related to this).

Cinema4D Plugins (Home of Riptide, Riptide Pro, Undertow, Morph Mill, KyamaSlide and I/Ogre plugins) Poser products Freelance Modelling, Poser Rigging, UV-mapping work for hire.


Nance ( ) posted Fri, 11 October 2002 at 1:44 AM

Not sure about this part, but it appears the antialiasing of the shadowmaps is based on a percentage of the total map size rather than a specific number of pixels.

That would explain why, if the field of view is really wide and the shadow casting object very tiny in that view, that increasing the size of the map will never produce a shadow.

For example, if the antialiasing is 3% of the total map size in pixels, and the shadow casting object occupies less than 3% of the field of view, it's shadow will always be antialiased out regardless of map size.


Spanki ( ) posted Fri, 11 October 2002 at 2:09 AM

That makes some sense... my current questions revolve around controlling the anti-aliasing. If you get 'crisp' shadows with a 256 map size by adjusting the ShadowCamera scaling as you suggest here, how do you get 'blurry' ones again? ;). Without mucking with the scaling, 256 size maps usually produce much blurrier shadows than say a 1024 or 2048 size map. I guess you can adjust the scaling and map size to get what you're looking for (up to a point). I'll play around with this some later.

Cinema4D Plugins (Home of Riptide, Riptide Pro, Undertow, Morph Mill, KyamaSlide and I/Ogre plugins) Poser products Freelance Modelling, Poser Rigging, UV-mapping work for hire.


Nance ( ) posted Fri, 11 October 2002 at 3:47 AM

file_27002.jpg

That's it. Zoom-in = sharper. Zoom-out = softer. Zoom out too far and the edges get feathered until the shadow disappears.

In these three the light parameters, including shadowmap size was constant, and only the ShadowCam's zoom value was changed.


Ajax ( ) posted Fri, 11 October 2002 at 3:51 AM

Thanks Nance. This is the first time I've heard of this too. It makes perfect sense though. However, I mostly use infinite lights (I confess to being hopeless at lighting) and the story there doesn't seem to be quite the same. Poser adjusts the shadow light cam for infinite lights so that all shadow casting objects in the scene fit completely within the field of view. That's why Spanki's trick of turning off shadow casting for the ground plane works. At render time, Poser readjusts the field of view to include all objects for which shadow casting is turned on and only those objects, zeroing in on the figure in his example. That means that if you use infinite lights for shadow casting, your options seem to be: 1) turning off shadow casting for anything that doesn't need it or won't be seen in your render 2) increasing the shadow map size 3) waiting until you're absolutely sure you aren't going to add anything to or delete anything from the scene and then fiddling with the shadow light cam settings, being careful to keep in view the particular parts of things that you need to cast shadows for your render. Since the cam has already adjusted it's field of view to only include those things that are set to cast shadows, the gains from number 3 will usually not be large ones. Personally, I'd go with a combo of the first two in almost every infinite light situation. I would find it very difficult to try to guage, while viewing through the shadow light cam, which bits of things are going to have their shadows visible in the view where I plan to render.


View Ajax's Gallery - View Ajax's Freestuff - View Ajax's Store - Send Ajax a message


Spanki ( ) posted Fri, 11 October 2002 at 4:07 AM

Thanks for the updates.. I hadn't had a chance to play with it again yet. Good catch on infinate vs spot lights Ajax... I was indeed using infinate lights in that render. Nance, in your images above, does that sphere have a hole in it, or not? ;) The shadow seems to suggest that it does.

Cinema4D Plugins (Home of Riptide, Riptide Pro, Undertow, Morph Mill, KyamaSlide and I/Ogre plugins) Poser products Freelance Modelling, Poser Rigging, UV-mapping work for hire.


Nance ( ) posted Sat, 12 October 2002 at 12:45 AM

Ya got me there. I never use the infinate lights so have not seen the ShadowCam readjustment. I'll have to go and play with it. Thanks!


Privacy Notice

This site uses cookies to deliver the best experience. Our own cookies make user accounts and other features possible. Third-party cookies are used to display relevant ads and to analyze how Renderosity is used. By using our site, you acknowledge that you have read and understood our Terms of Service, including our Cookie Policy and our Privacy Policy.