Merged Mesh and material.shadowMethod

Software: Away3D 4.x

hexvector, Newbie
Posted: 18 July 2011 07:50 PM   Total Posts: 1

If I have:

// define lights, view, ect..
(...)

var 
merge:Merge = new Merge(falsefalse);
var 
meshes:Vector.<Mesh> = new Vector.<Mesh>();

// recieving empty mesh
var recieverMesh:Mesh = new Mesh();

// cube base mesh
var cube:Cube = new Cube(null808080);
var 
clonedMesh:Mesh;

// clone meshes and add to meshes vector
for (var i:uint 0100i++) {
 clonedMesh 
cube.clone() as Mesh;
 
clonedMesh.40 i;
 
meshes.push(clonedMesh);
}

// merge meshes
var mergedMesh:Mesh merge.applyToMeshes(recieverMeshmeshes);

// create and apply material
var material:ColorMaterial = new ColorMaterial(0xcccccc);
material.lights [light];

// crashes - fixed if commented out
material.shadowMethod = new SoftShadowMapMethod(light);

mergedMesh.material material;
mergedMesh.castsShadows true;

view.scene.addChild(mergedMesh); 

The problem with the above code is that it crashes with the line:
material.shadowMethod = new SoftShadowMapMethod(light);

If we remove it, the merged mesh works properly. Is there a limitation or a bug?

Error: More usages removed than exist!
at RegisterPool/removeUsage()[E:Programming ResourcesAway3D FP11srcaway3dmaterialsutilsRegisterPool.as:97]
at away3d.materials.utils::ShaderRegisterCache/removeFragmentTempUsage()[E:Programming ResourcesAway3D FP11srcaway3dmaterialsutilsShaderRegisterCache.as:73]
at away3d.materials.passes::DefaultScreenPass/compileLightingCode()[E:Programming ResourcesAway3D FP11srcaway3dmaterialspassesDefaultScreenPass.as:956]
at away3d.materials.passes::DefaultScreenPass/compile()[E:Programming ResourcesAway3D FP11srcaway3dmaterialspassesDefaultScreenPass.as:574]
at away3d.materials.passes::DefaultScreenPass/reset()[E:Programming ResourcesAway3D FP11srcaway3dmaterialspassesDefaultScreenPass.as:531]
at away3d.materials.passes::DefaultScreenPass/updateProgram()[E:Programming ResourcesAway3D FP11srcaway3dmaterialspassesDefaultScreenPass.as:480]
at away3d.materials.passes::MaterialPassBase/activate()[E:Programming ResourcesAway3D FP11srcaway3dmaterialspassesMaterialPassBase.as:260]
at away3d.materials.passes::DefaultScreenPass/activate()[E:Programming ResourcesAway3D FP11srcaway3dmaterialspassesDefaultScreenPass.as:346]
at away3d.materials::MaterialBase/activatePass()[E:Programming ResourcesAway3D FP11srcaway3dmaterialsMaterialBase.as:320]
at away3d.core.render::DefaultRenderer/drawRenderables()[E:Programming ResourcesAway3D FP11srcaway3dcorerenderDefaultRenderer.as:106]
at away3d.core.render::DefaultRenderer/draw()[E:Programming ResourcesAway3D FP11srcaway3dcorerenderDefaultRenderer.as:62]
at away3d.core.render::RendererBase/executeRender()[E:Programming ResourcesAway3D FP11srcaway3dcorerenderRendererBase.as:335]
at away3d.core.render::RendererBase/render()[E:Programming ResourcesAway3D FP11srcaway3dcorerenderRendererBase.as:310]
at away3d.containers::View3D/render()[E:Programming ResourcesAway3D FP11srcaway3dcontainersView3D.as:363]

   

Richard Olsson, Administrator
Posted: 22 July 2011 11:12 AM   Total Posts: 1192   [ # 1 ]

Sounds like a bug. Can you please file an issue report on GitHub?

Cheers!

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X