brlrt / away3d

Automatically exported from code.google.com/p/away3d
0 stars 0 forks source link

FogFilter runtime exception in simple scene if visibility set to false #127

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
Code below will reproduce problem
package test{
    import away3d.containers.View3D;
    import away3d.core.filter.FogFilter;
    import away3d.core.math.Number3D;
    import away3d.core.render.BasicRenderer;
    import away3d.materials.BitmapMaterial;
    import away3d.materials.ColorMaterial;
    import away3d.primitives.Cube;
    import away3d.sprites.Sprite3D;

    import flash.display.BitmapData;

    import flexunit.framework.*;
    import flexunit.framework.TestCase;

    public class FogTest extends TestCase{      
        private var view:View3D;
        private var cube:Cube = new Cube({width:10, height:10, depth:10});
        private var sprite:Sprite3D;
        public override function runStart():void{
            view = new View3D();
            view.renderer = new BasicRenderer(new FogFilter({material:new ColorMaterial(0x080808), maxZ:2000, minZ:600, subdivisions:10}));
            view.scene.addChild(cube);
            cube.visible = false;
            sprite = new Sprite3D(new BitmapMaterial(new BitmapData(100, 100, true, 0x000000)));
            sprite.visible = false;
            view.scene.addSprite(sprite);
            view.camera.z = -300;
            view.camera.lookAt(new Number3D());
        }
        public function testFog():void{
            for(var i:int = 0; i < 5; ++i){
                view.render();
            }
        }
    }
}

What is the expected output? What do you see instead?
It should not crash if nothing is visible in the scene.

What version of the product are you using? On what operating system?
This occurs on the latest trunk, 3.5.1

Please provide any additional information below.
The exception will not occur if the cube visibility is true or the sprite 
visibility is true.

Original issue reported on code.google.com by rentakni...@gmail.com on 15 Aug 2010 at 10:22

GoogleCodeExporter commented 8 years ago
This problem is occurring in my game project now, does anyone know a work 
around to this?

TypeError: Error #1010: A term is undefined and has no properties.
    at away3d.core.filter::FogFilter/filter()[C:\Users\Stephen\Adobe Flash Builder 4\Away3D_src\away3d\core\filter\FogFilter.as:186]
    at away3d.core.render::BasicRenderer/render()[C:\Users\Stephen\Adobe Flash Builder 4\Away3D_src\away3d\core\render\BasicRenderer.as:91]
    at away3d.core.session::AbstractSession/render()[C:\Users\Stephen\Adobe Flash Builder 4\Away3D_src\away3d\core\session\AbstractSession.as:429]
    at away3d.core.session::AbstractSession/render()[C:\Users\Stephen\Adobe Flash Builder 4\Away3D_src\away3d\core\session\AbstractSession.as:424]
    at away3d.core.session::AbstractSession/render()[C:\Users\Stephen\Adobe Flash Builder 4\Away3D_src\away3d\core\session\AbstractSession.as:424]
    at away3d.containers::View3D/render()[C:\Users\Stephen\Adobe Flash Builder 4\Away3D_src\away3d\containers\View3D.as:793]
    at core.render::RenderSystem/run()[C:\Users\Stephen\Adobe Flash Builder 4\AwayProject\src\core\render\RenderSystem.as:81]
    at core::GameMain/run()[C:\Users\Stephen\Adobe Flash Builder 4\AwayProject\src\core\GameMain.as:172]

Original comment by rentakni...@gmail.com on 30 Aug 2010 at 4:38