The flicker appears on startup, and affects only the objects in my View3D.
It seems to be the lighting that changes for a splitsecond, it seems to initialize with the default light.ambient setting, and then changes to my brighter ‘0.9’.
Commenting
light.ambient = 0.9;
resolves the issue.
Example: (horizontal plane) http://mark.me/test/ (Refresh page to repeat if you didn’t see it)
(I use the latest version from Git)
Code:
package {
import flash.display.MovieClip;
import away3d.entities.Mesh;
import away3d.containers.View3D;
import away3d.primitives.PlaneGeometry;
import away3d.materials.lightpickers.StaticLightPicker;
import away3d.lights.DirectionalLight;
import away3d.materials.methods.FilteredShadowMapMethod;
import flash.geom.Vector3D;
import flash.events.Event;
import away3d.materials.ColorMaterial;
import away3d.debug.AwayStats;
public class Main extends MovieClip {
var view:View3D;
public function Main() {
view = new View3D();
var light:DirectionalLight = new DirectionalLight();
light.ambient = 0.9;
view.scene.addChild(light);
view.camera.position=new Vector3D(0,50,-400);
view.backgroundColor = 0xFFFFFF;
view.addEventListener(Event.ENTER_FRAME,entr);
var _lightPicker:StaticLightPicker = new StaticLightPicker([light]);
var _groundMaterial:ColorMaterial = new ColorMaterial(0xEEEEEE);
_groundMaterial.shadowMethod = new FilteredShadowMapMethod(light);
_groundMaterial.lightPicker = _lightPicker;
var msh:Mesh = new Mesh(new PlaneGeometry(400, 400),_groundMaterial);
view.scene.addChild(msh);
addChild(view);
var stats:AwayStats = new AwayStats(view);
stage.addChild(stats);
}
function entr (e:Event) {
view.render();
}
}
}