TextureMultiPassMaterial and CascadeShadows

Software: Away3D 4.x

Griva, Newbie
Posted: 05 July 2013 01:12 PM   Total Posts: 3

Hi, Me and my friend have big problem with TextureMultiPassMaterial,

ErrorNearShadowMapMethod requires a light that has a CascadeShadowMapper instance assigned to shadowMapper.
at away3d.materials.methods::CascadeShadowMapMethod()[C:\Users\MellRebook\Adobe Flash Builder 4.6\Project\src\away3d\materials\methods\CascadeShadowMapMethod.as:36]
at Project
/initLights()[C:\Users\MellRebook\Adobe Flash Builder 4.6\JajaBiskupa\src\JajaBiskupa.as:194]
at Project
()[C:\Users\MellRebook\Adobe Flash Builder 4.6\Project\src\Project.as:140] 

Cascade method is bad !?
How to use TextureMultiPassMaterial and CascadeShadowMapMethod ?
Can someone show me how use it ?(exemple/code)

   

Avatar
GoroMatsumoto, Sr. Member
Posted: 05 July 2013 02:44 PM   Total Posts: 166   [ # 1 ]

At first, try compiling this example with latest dev branch.

Example: Advanced_MultiPassSponzaDemo.as
https://github.com/away3d/away3d-examples-fp11/blob/dev/src/Advanced_MultiPassSponzaDemo.as

You can download assets and other examples.
https://github.com/away3d/away3d-examples-fp11/tree/dev

Latest dev:
https://github.com/away3d/away3d-core-fp11/tree/dev

_cascadeShadowMapper = new CascadeShadowMapper(3);
_directionalLight = new DirectionalLight(-1, -151);
_directionalLight.shadowMapper _cascadeShadowMapper
_baseShadowMethod = new FilteredShadowMapMethod(_directionalLight);
_cascadeMethod = new CascadeShadowMapMethod(_baseShadowMethod); 
   

Griva, Newbie
Posted: 05 July 2013 04:06 PM   Total Posts: 3   [ # 2 ]

I saw it, rewrited and i have this error.
But i dont understand this sentence:
NearShadowMapMethod requires a light that has a CascadeShadowMapper instance assigned to shadowMapper.
I did’t use NearShadowMapMethod, i need Cascade…

   

Avatar
GoroMatsumoto, Sr. Member
Posted: 05 July 2013 04:34 PM   Total Posts: 166   [ # 3 ]

It seems just a mistake of text.
See CascadeShadowMapMethod.as line34.
It has been fixed in latest dev.
https://github.com/away3d/away3d-core-fp11/blob/dev/src/away3d/materials/methods/CascadeShadowMapMethod.as

Anyway, this error occurs with a light that dosen’t have CascadeShadowMapper instance.

_directionalLight.shadowMapper _cascadeShadowMapper

Check your code again, or show me the modified part.
I often use the shadow, but I have not seen this error.

Cheers.

   

Avatar
GoroMatsumoto, Sr. Member
Posted: 05 July 2013 04:35 PM   Total Posts: 166   [ # 4 ]

It seems just a mistake of text.
See CascadeShadowMapMethod.as line34.
And it has been fixed in latest dev.
https://github.com/away3d/away3d-core-fp11/blob/dev/src/away3d/materials/methods/CascadeShadowMapMethod.as

Anyway, this error occurs with a light that dosen’t have CascadeShadowMapper instance.

_directionalLight.shadowMapper _cascadeShadowMapper

Check your code again, or show me the modified part.
I often use the shadow, but I have not seen this error.

Cheers.

   

Griva, Newbie
Posted: 05 July 2013 06:03 PM   Total Posts: 3   [ # 5 ]

Its working !
Oh, thank you very very much smile

I changed order of few lines and probably constructor or somethin was earlier than constructor of Mapper.
Anyway thanks cool smile

   

Avatar
Baks, Newbie
Posted: 27 January 2014 10:57 AM   Total Posts: 22   [ # 6 ]

Hi

we have mesh, lightmap, CascadeShadowMapMethod with SoftShadowMapMethod, CascadeShadowMapper for light and TextureMultiPassMaterial

I need to add LightMapMethod to TextureMultiPassMaterial (this material has tile texture on first UV channel and lightmap on second)

——-

How to use this logic correctly:

var multiMaterial1:TextureMultiPassMaterial = new TextureMultiPassMaterial(bmTexture.texture);
multiMaterial1.repeat = true;
multiMaterial1.lightPicker = model.mainModel.lightPicker;
multiMaterial1.shadowMethod = Methods._cascadeMethod;

var s:SubGeometry = (mesh.geometry.subGeometries[0] as CompactSubGeometry).cloneWithSeperateBuffers();        s.updateSecondaryUVData(mesh.geometry.subGeometries[0].UVData.concat());
     
mesh.geometry.scaleUV(5, 5);

multiMaterial1.addMethod(new LightMapMethod(meshLight.texture, LightMapMethod.MULTIPLY, true));
     
——-

Thanks

   

Avatar
Baks, Newbie
Posted: 27 January 2014 10:59 AM   Total Posts: 22   [ # 7 ]

It seems LightMapMethod doesn’t work with TextureMultiPassMaterial

is it truth ?

   

Avatar
Baks, Newbie
Posted: 29 January 2014 06:16 PM   Total Posts: 22   [ # 8 ]

returned to simple TextureMaterial.. all is fine

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X