Need help with TextureMultiPassMaterial

Software: Away3D 4.x

Mell Rebook, Newbie
Posted: 30 June 2013 10:53 PM   Total Posts: 2

Hello everybody!

I had just tried to use TextureMultiPassMaterial.
When i changed my old TextureMaterial, my eyes saw beatyfull error

RangeErrorError #1125: Index 0 is out of range 0.
 
at away3d.materials::MaterialBase/passRendersToTexture()[/Users/robbateman/Documents/Adobe Flash Builder 4.7/away3d-core-fp11/src/away3d/materials/MaterialBase.as:299]
 at away3d
.core.render::DefaultRenderer/drawRenderables()[/Users/robbateman/Documents/Adobe Flash Builder 4.7/away3d-core-fp11/src/away3d/core/render/DefaultRenderer.as:184]
 at away3d
.core.render::DefaultRenderer/draw()[/Users/robbateman/Documents/Adobe Flash Builder 4.7/away3d-core-fp11/src/away3d/core/render/DefaultRenderer.as:112]
 at away3d
.core.render::RendererBase/executeRender()[/Users/robbateman/Documents/Adobe Flash Builder 4.7/away3d-core-fp11/src/away3d/core/render/RendererBase.as:279]
 at away3d
.core.render::DefaultRenderer/executeRender()[/Users/robbateman/Documents/Adobe Flash Builder 4.7/away3d-core-fp11/src/away3d/core/render/DefaultRenderer.as:58]
 at away3d
.core.render::RendererBase/render()[/Users/robbateman/Documents/Adobe Flash Builder 4.7/away3d-core-fp11/src/away3d/core/render/RendererBase.as:243]
 at away3d
.containers::View3D/render()[/Users/robbateman/Documents/Adobe Flash Builder 4.7/away3d-core-fp11/src/away3d/containers/View3D.as:679]
 at Project
/onEnterFrame()[C:\Users\MellRebook\Adobe Flash Builder 4.6\Project\src\Project.as:188] 

Code:

cubeMaterial = new TextureMultiPassMaterial(Cast.bitmapTexture(DataClassDiff));
   
cubeMaterial.lightPicker lightPicker;
   
cubeMaterial.mipmap =false;
   
cubeMaterial.bothSides=true;
   
cubeMaterial.specularMap Cast.bitmapTexture(DataClassSpec);
   
cubeMaterial.normalMap Cast.bitmapTexture(DataClassNormals); 

.

Glad for any help!

   

Avatar
80prozent, Sr. Member
Posted: 30 June 2013 11:50 PM   Total Posts: 430   [ # 1 ]

Hi

I just tried the code you posted.
For me its working fine.

So either its the away3d-version you are using (best use the one from github/dev), or something is not right with your textures or lights.

Hope thats any help

[edit:] it seams like the material.bothSides does not work on TextureMultiPassmaterial…..

 Signature 

sorry…i hope my actionscript is better than my english…

   

Mell Rebook, Newbie
Posted: 01 July 2013 12:31 AM   Total Posts: 2   [ # 2 ]

That was becouse of .bothSides!

Thanks a lot!

EDIT:

I have another question.
When i try implement shadows based on TextureMultiPassMaterial, i received weird error:

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] 

I had looking for tutorial about it, but i can’t find clear examples.
Can someone show me how easy use TextureMultiPassMaterial and CascadeShadowMethod to make some nice shadows smile?
Thanks Again!

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X