-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: adds condition to avoid texture duplication
- Loading branch information
Showing
12 changed files
with
40 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
AFRAME.registerShader("transparent-video",{schema:{src:{type:"map"}},init:function(e){var r=new THREE.VideoTexture(e.src),a=new THREE.VideoTexture(e.src);r.format=THREE.RGBAFormat,a.format=THREE.AlphaFormat,e.transparent=!0,this.material=new THREE.ShaderMaterial({vertexShader:"\n varying vec2 vUv;\n \n void main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n }\n ",fragmentShader:"\n varying vec2 vUv;\n uniform sampler2D videoTexture;\n uniform sampler2D alphaTexture;\n\n void main() {\n vec4 videoColor = texture2D(videoTexture, vUv);\n vec4 alphaColor = texture2D(alphaTexture, vUv);\n\n gl_FragColor = vec4(videoColor.rgb, alphaColor.a);\n }\n ",uniforms:{videoTexture:{type:"t",value:r},alphaTexture:{type:"t",value:a}},transparent:!0})}}); | ||
AFRAME.registerShader("transparent-video",{schema:{src:{type:"map"}},applyWebmShader:function(e){var a=new THREE.VideoTexture(e);a.format=THREE.RGBAFormat,this.material=new THREE.MeshBasicMaterial({map:a,transparent:!0})},applyHEVCShader:function(e){var a=new THREE.VideoTexture(e),r=new THREE.VideoTexture(e);a.format=THREE.RGBAFormat,r.format=THREE.AlphaFormat,this.material=new THREE.ShaderMaterial({vertexShader:"\n varying vec2 vUv;\n \n void main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n }\n ",fragmentShader:"\n varying vec2 vUv;\n uniform sampler2D videoTexture;\n uniform sampler2D alphaTexture;\n\n void main() {\n vec4 videoColor = texture2D(videoTexture, vUv);\n vec4 alphaColor = texture2D(alphaTexture, vUv);\n\n gl_FragColor = vec4(videoColor.rgb, alphaColor.a);\n }\n ",uniforms:{videoTexture:{type:"t",value:a},alphaTexture:{type:"t",value:r}},transparent:!0})},init:function(e){var a,r=e.src,t=new URL(r.currentSrc).pathname.split("."),n=null==(a=t[t.length-1])?void 0:a.toLowerCase();e.transparent=!0,"webm"===n?this.applyWebmShader(r):this.applyHEVCShader(r)}}); | ||
//# sourceMappingURL=aframe-transparent-video-shader.cjs.map |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.