Jump to content

Alpha Map in Video


PixelPush
 Share

Recommended Posts

I'm trying to use a video to set the alpha information on a standard material. The video displays fine(passed into the diffuse) but can't figure out how to pass this into the alpha with correct results.

My code..

Ref: http://doc.babylonjs.com/tutorials/materials

scene.seaPlane = BABYLON.Mesh.CreateGround("ground1", 36,36, 2, scene);
          

var mat = new BABYLON.StandardMaterial("mat", scene);
var videoTexture = new BABYLON.VideoTexture("video", ["textures/waterRing.mp4"], scene, true, true);
mat.diffuseTexture = videoTexture;

mat.diffuseTexture.hasAlpha = true;
mat.useAlphaFromDiffuseTexture = true;
                      
scene.seaPlane.material = mat;
 videoTexture.video.play();

 

There is no explicit alpha channel in my video file, so perhaps this is where I'm going wrong? Maybe it's better to render the video out as a sequence of pngs

Thanks, 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...