Background Flickering

Software: Away3D 4.x

ricovitch, Newbie
Posted: 12 August 2011 08:27 PM   Total Posts: 22

Hi.

I got a problem with my 3d scene. For some reason, the background (whose color is set to white) is flickering to black when i move the mouse through the view.

I tried to do a simple project that replicate the issue with no luck till now. So i post the link here in case anyone has a hint for this. I may eventually send the sources of this project in private.

This happened suddenly with the commit number :
Commit:38edc4c5c7118354129e9fa5553c7da610e6b025 (refactoring of mouse event handling flow…)

Here is a link to the current flickering version :
http://eric.helier.free.fr/needtoo/vir3d_1308/ away3d:away3d

Thank you,
Eric

   

Avatar
80prozent, Sr. Member
Posted: 12 August 2011 08:30 PM   Total Posts: 430   [ # 1 ]

your link asks me for a login

 Signature 

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

   

ricovitch, Newbie
Posted: 12 August 2011 08:32 PM   Total Posts: 22   [ # 2 ]

@80prozent
login : away3d
password : away3d

   

ricovitch, Newbie
Posted: 16 August 2011 06:59 PM   Total Posts: 22   [ # 3 ]

Still investigating on my side for this.
I just found that flickering disappear if i set all 3d objects to mouseEnabled=false, and removes all MouseEvent3D events listeners…

   

ricovitch, Newbie
Posted: 16 August 2011 07:40 PM   Total Posts: 22   [ # 4 ]

I also don’t get flickering if i disable stage3DProxy setter/getter in Mouse3DManager.

This setter actually proxy HitTestManager stage3DProxy setter so maybe the problem is located somewhere in there…

   

ricovitch, Newbie
Posted: 18 August 2011 06:57 PM   Total Posts: 22   [ # 5 ]

Hi,

I finally achieved to reproduce the problem on a very simple project :
This produces flickering when the mouse moves on the view3d instance.
Flickering does not happen if i don’t set mouseEnabled on cube.

package
{
 import away3d
.containers.View3D;
 
import away3d.events.MouseEvent3D;
 
import away3d.lights.DirectionalLight;
 
import away3d.materials.ColorMaterial;
 
import away3d.primitives.Cube;
 
 
import flash.display.Sprite;
 
import flash.display.StageAlign;
 
import flash.display.StageScaleMode;
 
import flash.events.Event;
 
 
// swf compiled with white bg color
 
[SWF(width="1024"height="768"frameRate="60"backgroundColor="#FFFFFF")]
 
public class Away3D_BGFlickerTest extends Sprite
 {
  
private var _view:View3D;
  private var 
_cube:Cube;
  
  public function 
Away3D_BGFlickerTest()
  
{
   stage
.align StageAlign.TOP_LEFT;
   
stage.scaleMode StageScaleMode.NO_SCALE;
   
   
_view = new View3D ();
   
_view.antiAlias 2;
   
// view background color set to white
   
_view.backgroundColor 0xFFFFFF;
   
// view size smaller than stage
   // bug seems to occur only when mouse move on view3d
   
_view.width 800;
   
_view.height 400;
   
addChild(_view);
   
   
// add a cube
   
var cubeMaterial:ColorMaterial = new ColorMaterial (0x888888);
   
_cube _view.scene.addChild(new Cube (cubeMaterial)) as Cube;
   
   
// comment this two lines to stop flickering :
   
_cube.mouseEnabled true;
   
_cube.addEventListener (MouseEvent3D.MOUSE_OVERonCubeMouseOver);
   
   
addEventListener(Event.ENTER_FRAMEonEnterFrame);
  
}
  
  
private function onCubeMouseOver (evt:MouseEvent3D) : void
  {
   trace 
("onCubeMouseOver");
  
}
  
  
private function onEnterFrame (evt:Event) : void
  {
   _cube
.rotationX += 2;
   
_cube.rotationZ += 2;
   
_view.render();
  
}
 }
   

Avatar
theMightyAtom, Sr. Member
Posted: 18 August 2011 08:58 PM   Total Posts: 669   [ # 6 ]

Hi Ricovitch,

I tried your example, with same result.
I think you should log a bug on GitHub.

In the meantime, the only workaround I could find was putting a large white plane behind everything in the scene. It’s a hack, but it does stop the flickering.

Your original code:
http://videometry.net/broomstick/background/FlickerTest00.html

Background added in scene:

var plane:Plane = new Plane(new ColorMaterial(0xFFFFFF1), 1000010000);
   
plane.1000;
   
_view.scene.addChild(plane); 

Result: http://videometry.net/broomstick/background/FlickerTest.html

I hope a fix comes soon, I can see this has been driving you mad for days!

Cheers

 

   

ricovitch, Newbie
Posted: 19 August 2011 07:28 AM   Total Posts: 22   [ # 7 ]

Hi theMightyAtom,

Glad i’m not the only one to see this issue.
I filed a bug on github already yesterday.

I tried with a large plane in background, but anyway, mouseevents don’t fire normally.

Thank you for taking the time to test.

   

Avatar
theMightyAtom, Sr. Member
Posted: 19 August 2011 08:45 AM   Total Posts: 669   [ # 8 ]

My next suggestion, after seeing your app (cool btw!) was a white Skymap.

   

ricovitch, Newbie
Posted: 19 August 2011 12:03 PM   Total Posts: 22   [ # 9 ]

Thanks mighty,

Waiting to this issue to be resolved i work with an old commit of the fp11 repository that don’t show the issue.

If this can not be resolved i will try one of this approach (big plane or skybox)

Eric

   

ricovitch, Newbie
Posted: 20 August 2011 09:09 PM   Total Posts: 22   [ # 10 ]

Oh and thanks for the compliments about my app.
There are some points i’m not really satisfied about at this time, but i’ve had some work on this.

Among the problems that i did not solve as i wanted :
- I got some difficulty setting lights correctly
- Walls are made with LinearExtrude class, but i did not find a way to texture each part of the extrusion separatly
- For the repeated little spots, i had to use a big transparent plane, overlayed on walls
- I’d like the text on boxes to be more readable. Maybe i should try some other fonts. I’d like a 3d vector text method in away3d4
- The whole catalog should be able to switch at runtime, but i got difficulty disposing / recreating everything…

Still some work to do wink

   

Avatar
theMightyAtom, Sr. Member
Posted: 06 September 2011 11:40 AM   Total Posts: 669   [ # 11 ]

I’ve found a quick fix for this…

_view.backgroundImage = new BitmapData(512, 512, false, 0xFFFFFF);

Where the color is your desired background color.
It seems to occur in the HitTestRenderer class, that clears the buffer and paints it black(?!)

_context.clear(0, 0, 0, 1);

I tried putting other values in, but everything gave an error, so I guess there’s a good reason it’s black wink

   

ricovitch, Newbie
Posted: 06 September 2011 04:08 PM   Total Posts: 22   [ # 12 ]

Hello theMighty,

Thank you for your feedback solution !
I will try this fix on my projet. I finally adopted your other solution that consists of adding a SkyBox.

Thanks again,
Eric

   

ricovitch, Newbie
Posted: 06 September 2011 08:20 PM   Total Posts: 22   [ # 13 ]

Hi again,

I applied this fix on my project and it works well.
Don’t know why i didn’t think of this solution sooner !

Thank you for the help.

   

Avatar
theMightyAtom, Sr. Member
Posted: 06 September 2011 08:33 PM   Total Posts: 669   [ # 14 ]

Cheers ricovitch :O)
I’m sure this bug will be quashed soon, but in the meantime…

   

TomByrne, Newbie
Posted: 01 November 2011 07:11 AM   Total Posts: 11   [ # 15 ]

I am having a similar issue and was wondering if anyone knew what the core issue is here.

Basically I have my own instance of HitTestRenderer (i.e. not the one created by Mouse3DManager), which I pass references of my View3D and Stage3DProxy to.

I use this instance to test whether screen points hit certain objects (i.e. not the mouse point), and this works fine.

Unfortunately, every time the mouse rolls over the View3D (from another 2D DisplayObject) the scene flashes black.

I have tried adding in the background image but it didn’t help.

Any help would be greatly appreciated.

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X