Shadow Quality

Software: Away3D 4.x

Richard, Newbie
Posted: 18 July 2011 03:47 PM   Total Posts: 7

Hello friends,

I’m struggling to get high(er) resoltion shadows in my flash 11 (broomstick) demo I’m building.  As you can see from this screen shot (http://postimage.org/image/1x5waoow4/full/) they are very blocky :( 

I’ve using the SoftShadowMapMethod with a step size (though I’m not exactly sure what this does) of 0.0006;

How can I improve the apperance of shadows in my application?

Thanks smile

   

Somokon, Member
Posted: 18 July 2011 05:09 PM   Total Posts: 75   [ # 1 ]

The step size does indeed affect what the shadows look like (default for SoftShadowMapMethod is 0.00025).  Also, changing the value of the lens.far property of your view camera affects the quality of shadows.

   

Richard, Newbie
Posted: 18 July 2011 07:40 PM   Total Posts: 7   [ # 2 ]

Thanks for the info smile Do larger or smaller values for step size improve quality?  How / why does the far property affect shadows?!

   

Richard, Newbie
Posted: 19 July 2011 09:03 AM   Total Posts: 7   [ # 3 ]

I’ve tried adjusting the step values for the shadow method but I’m unable to get a satisfactory result :(  Is there anyway I can get smooth shadows in my application?

Thanks again.

   

John Brookes, Moderator
Posted: 19 July 2011 09:33 AM   Total Posts: 732   [ # 4 ]

Higher the far value to more blocky/pixellated
Higher the stepsize the more the shadows spread.

The shadow is made up of a few shadows so increasing the stepSize spreads them out to give a softer(ish) shadow edge.

To get a crisp shadow you seem to need a very shallow near to far distance. To low for what I needed :(


No idea why far is used.

   

Richard, Newbie
Posted: 19 July 2011 11:58 AM   Total Posts: 7   [ # 5 ]

Hey guys, I changed the near/far values and this did improve the shadow quality but in doing so forced the engine into culling way too much of my scene :(  This seems to be the same issue you encountered John.

Thanks for your help,
If you do happen to know of another solution I’d love to hear it.

   

John Brookes, Moderator
Posted: 19 July 2011 12:07 PM   Total Posts: 732   [ # 6 ]

Have you tried SlowFilteredShadowMapMethod instead?
Seems to give better results for me.
Bigger far value before looking to pixellated.

   

Richard, Newbie
Posted: 19 July 2011 12:41 PM   Total Posts: 7   [ # 7 ]

I’ve not been able to get that method to function - When I swap out my SoftShadowMapMethod for SlowFilteredShadowMapMethod my application crashes with:

Error: Error #3613: The native shader compilation failed.
at flash.display3D::Program3D/upload()
at away3d.core.managers::AGALProgram3DCache/setProgram3D()[Away3D\src\away3d\core\managers\AGALProgram3DCache.as:113]
at away3d.materials.passes::MaterialPassBase/updateProgram()[Away3D\src\away3d\materials\passes\MaterialPassBase.as:316]
at away3d.materials.passes::DefaultScreenPass/updateProgram()[Away3D\src\away3d\materials\passes\DefaultScreenPass.as:482]
at away3d.materials.passes::MaterialPassBase/activate()[Away3D\src\away3d\materials\passes\MaterialPassBase.as:260]
at away3d.materials.passes::DefaultScreenPass/activate()[Away3D\src\away3d\materials\passes\DefaultScreenPass.as:346]
at away3d.materials::MaterialBase/activatePass()[Away3D\src\away3d\materials\MaterialBase.as:320]
at away3d.core.render::DefaultRenderer/drawRenderables()[Away3D\src\away3d\core\render\DefaultRenderer.as:106]
at away3d.core.render::DefaultRenderer/draw()[Away3D\src\away3d\core\render\DefaultRenderer.as:48]
at away3d.core.render::RendererBase/executeRender()[Away3D\src\away3d\core\render\RendererBase.as:336]
at away3d.core.render::RendererBase/render()[Away3D\src\away3d\core\render\RendererBase.as:311]
at away3d.containers::View3D/render()[Away3D\src\away3d\containers\View3D.as:329]

   

Richard Olsson, Administrator
Posted: 22 July 2011 10:42 AM   Total Posts: 1192   [ # 8 ]

The shader compilation should crash obviously. Please file a bug on GitHub if you haven’t already.

The far value (size of frustum) is relevant because the shadow is calculated by rendering the scene from the point of view of the light source. Smaller frustum means a smaller area needs to be rendered, which in turn means more fidelity per pixel. This is my layman understanding anyway (I’m by no means a shader guru) but David would be able to confirm or give a better explanation.

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X