Movieclip over View3D with blendMode applied = no blend effect of View3D.

Software: Away3D 4.x

cbrown, Jr. Member
Posted: 28 August 2011 06:01 PM   Total Posts: 39

Hi all,

Just wondering if anyone knows why movieclips with blend modes applied do not affect the 3d scene when placed over it?  Is this a Stage3D issue?  I searched all over the web but can’t find any mention of it. 

Here’s my sample code:

import away3d.containers.View3D;
import away3d.containers.Scene3D;
import away3d.core.render.DefaultRenderer;
import flash.events.Event;
import away3d.primitives.Sphere;
import away3d.materials.ColorMaterial;
import away3d.lights.PointLight;
import flash.geom.Vector3D;
import flash.display.MovieClip;
import flash.display.BlendMode;

var 
scene:Scene3D = new Scene3D();
var 
renderer:DefaultRenderer = new DefaultRenderer();
var 
view:View3D = new View3D(scenenullrenderer);
view.backgroundColor 0xCCCCFF;
addEventListener(Event.ENTER_FRAMErenderscene);

addChild(view);

var 
light:PointLight = new PointLight();
light.position = new Vector3D(-220200, -400);
scene.addChild(light);

var 
orangeMat:ColorMaterial = new ColorMaterial(0xFFCC33);
orangeMat.gloss 50;
orangeMat.specular 0.6;
orangeMat.lights [light];

var 
sphere:Sphere = new Sphere(orangeMat2005050);
scene.addChild(sphere);

var 
mc:MovieClip = new MovieClip();
mc.graphics.beginFill(0x99FF99);
mc.graphics.drawRect(0,0,256,256);
mc.graphics.endFill();
mc.blendMode BlendMode.MULTIPLY;

addChild(mc);

function 
renderscene(e:Event):void{
 view
.render();

Thanks for any help.

Craig

 Signature 
signature_image

whatever is good to know is difficult to learn

   

Avatar
theMightyAtom, Sr. Member
Posted: 28 August 2011 08:48 PM   Total Posts: 669   [ # 1 ]

The Molehill layer(s) is completely separate from the Flash display list, so it’s not available to the CPU for blending operation. Sadly there’s no easy cure for this.

You could take your 2D content into Molehill, and then you would have access to it for blending on GPU. Away3D offers some blend modes (including MULTIPLY) though I have never experimented with them.
They are implemented on all materials.
https://github.com/away3d/away3d-core-fp11/blob/master/src/away3d/materials/MaterialBase.as

Good Luck!

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X