nikolaiwarner / aframe-chromakey-material

A chromakey material for green screening in A-Frame. Perfect for blockbuster hollywood effects in VR! 🤗🎬💚
MIT License
69 stars 22 forks source link

Show content (other than camera stream) behind #3

Open calebguy opened 4 years ago

calebguy commented 4 years ago

Currently using to overlay alpha video on top of an image, but where the image (background) should be showing, I am only seeing the camera feed (essentially looking through the background image). Is there anyway to see the background image properly with alpha transparent video on top?

ravikundu commented 4 years ago

hi @calebcarithers, did you find an answer for the issue you mentioned? If so, can you share it with me please.

calebguy commented 4 years ago

Hey @ravikundu unfortunately not. Best of luck.

ivanho521 commented 4 years ago

put the a-image element below the a-video

<a-video></a-video>
<a-image></a-image>

Apart from 3d position , it seems there is a rendering sequence. In the code, write the "backthings" first.

lijualivenow commented 3 years ago

Hi, I found the solution, add this component https://www.npmjs.com/package/aframe-render-order-component. After that add some higher render order like render-order="50".

Here is my sample code.

         <a-entity id="modelVideo" position="-0.3 0.2 -0.3" rotation="0 90 0" class="cantap"
            render-order="50"
            material="shader: chromakey; src: #alphavideoModel ; color: 0.1 0.9 0.2; side : double;transparent: true; alphaTest: 0.5; opacity: 1;"
            geometry="primitive: plane; height: .42; width: .75;">
        </a-entity>