RESOLVED: Blend Modes and the View3D Background

Software: Away3D 4.x

blastframe, Newbie
Posted: 19 September 2011 10:11 PM   Total Posts: 8

Hi,
I’m drawing the frames of a video to the View3D’s background in an enter frame loop and I want to blend a bitmap on top of it. When I was using a regularly-playing video and a drawing the graphics for a sprite instance with its Blend Mode set to MULTIPLY, it was working.

I know Blend Modes between the Display List and StageVideo don’t work, but Is it possible to get blend modes within Stage3D? Perhaps by compositing the graphics and video before drawing to the View3D background? I don’t have any ideas of how to go about this and could really use some guidance. Thank you!

   

Avatar
Alejandro Santander, Administrator
Posted: 19 September 2011 11:35 PM   Total Posts: 414   [ # 1 ]

Hey blastframe,

Materials have a blendMode property that should do what you need. Something like this should demonstrate what you can do with blend modes in Stage3D:

var redBmd:BitmapData = new BitmapData(512512false0xFF0000);
   
view.backgroundImage redBmd;

   var 
blueMat:ColorMaterial = new ColorMaterial(0xFF0000);
   
blueMat.bothSides true;
   
blueMat.lights [cameraPointLight];

   var 
greenMat:ColorMaterial = new ColorMaterial(0x00FF00);
   
greenMat.lights [cameraPointLight];
   
greenMat.blendMode BlendMode.ADD;

   var 
plane:Plane = new Plane(blueMat);
   
plane.500;
   
plane.width plane.height 1000;
   
view.scene.addChild(plane);

   var 
cube:Cube = new Cube(greenMat);
   
view.scene.addChild(cube); 
   

blastframe, Newbie
Posted: 20 September 2011 06:05 AM   Total Posts: 8   [ # 2 ]

Thank you very much, Alejandro! :D

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X