From pub...@ Thu Aug 1 12:08:38 2019 From: pub...@ (Takahiro Aoyagi (...@...)) Date: Thu, 1 Aug 2019 12:08:38 -0700 Subject: [Public WebGL] WEBGL_video_texture shader error on Chrome Canary Message-ID: Hi all, I watched SIGGRAPH 2019 khronos BOF yesterday and I want to experiment WEBGL_video_texture extension because Chromium build supports now. I tried on Chrome Canary, but it doesn't seem to accept "#extension GL_WEBGL_video_texture : require" in shader even though it returns non-null from gl.getExtension('WEBGL_video_texture'). Is it intentional and Canary doesn't expose WEBGL_video_texture extension yet to users? Or am I missing something? I already reported to Chromium bugs https://bugs.chromium.org/p/chromium/issues/detail?id=776222#c32 but no response yet. I decided to post here too because I think not only I but also other people may be interested in WEBGL_video_texture from yesterday's BOF and want to test. And I hope someone here knows about the solution or status. Environment: WIndows 10 Chrome Canary (78.0.3871.0 (Official Build) canary (64-bit)) WebGL Draft Extensions is enabled via chrome://flags Sample code: const shaderSource = ` #extension GL_WEBGL_video_texture : require precision mediump float; varying vec2 v_texCoord; uniform samplerVideoWEBGL uSampler; void main(void) { gl_FragColor = texture2D(uSampler, v_texCoord); } `; const canvas = document.createElement('canvas'); const gl = canvas.getContext('webgl'); const extension = gl.getExtension('WEBGL_video_texture'); console.log(extension); const shader = gl.createShader(gl.FRAGMENT_SHADER); gl.shaderSource(shader, shaderSource); gl.compileShader(shader); const success = gl.getShaderParameter(shader, gl.COMPILE_STATUS); if (!success) { console.error('Compile error:' + gl.getShaderInfoLog(shader)); } // result -> WebGLVideoTexture {} // gl.getExtension('WEBGL_video_texture') returns non-null -> Compile error:ERROR: 0:2: 'GL_WEBGL_video_texture' : extension is not supported ERROR: 0:6: 'uSampler' : syntax error Thanks Takahiro -------------- next part -------------- An HTML attachment was scrubbed... URL: From pub...@ Fri Aug 2 11:36:37 2019 From: pub...@ (Ken Russell (...@...)) Date: Fri, 2 Aug 2019 11:36:37 -0700 Subject: [Public WebGL] WEBGL_video_texture shader error on Chrome Canary In-Reply-To: References: Message-ID: Hi Takahiro, Thanks for reporting the issue. Shaobo Yan from Intel (CC'd) has been driving the video texture work and hopefully can diagnose what's going wrong. I think the implementation of WEBGL_video_texture may not be following the draft specification completely. -Ken On Thu, Aug 1, 2019 at 12:09 PM Takahiro Aoyagi (taoyagi...@) < public_webgl...@> wrote: > Hi all, > > I watched SIGGRAPH 2019 khronos BOF yesterday and I want to experiment > WEBGL_video_texture extension because Chromium build supports now. > > I tried on Chrome Canary, but it doesn't seem to accept "#extension > GL_WEBGL_video_texture : require" in shader even though it returns non-null > from gl.getExtension('WEBGL_video_texture'). > > Is it intentional and Canary doesn't expose WEBGL_video_texture extension > yet to users? Or am I missing something? > > I already reported to Chromium bugs > https://bugs.chromium.org/p/chromium/issues/detail?id=776222#c32 but no > response yet. > > I decided to post here too because I think not only I but also other > people may be interested in WEBGL_video_texture from yesterday's BOF and > want to test. And I hope someone here knows about the solution or status. > > Environment: > > WIndows 10 > Chrome Canary (78.0.3871.0 (Official Build) canary (64-bit)) > WebGL Draft Extensions is enabled via chrome://flags > > Sample code: > > const shaderSource = ` > #extension GL_WEBGL_video_texture : require > precision mediump float; > varying vec2 v_texCoord; > > uniform samplerVideoWEBGL uSampler; > > void main(void) { > gl_FragColor = texture2D(uSampler, v_texCoord); > } > `; > > const canvas = document.createElement('canvas'); > const gl = canvas.getContext('webgl'); > const extension = gl.getExtension('WEBGL_video_texture'); > > console.log(extension); > > const shader = gl.createShader(gl.FRAGMENT_SHADER); > gl.shaderSource(shader, shaderSource); > gl.compileShader(shader); > const success = gl.getShaderParameter(shader, gl.COMPILE_STATUS); > if (!success) { > console.error('Compile error:' + gl.getShaderInfoLog(shader)); > } > > // result > -> WebGLVideoTexture {} // gl.getExtension('WEBGL_video_texture') returns > non-null > -> Compile error:ERROR: 0:2: 'GL_WEBGL_video_texture' : extension is not > supported > ERROR: 0:6: 'uSampler' : syntax error > > Thanks > > Takahiro > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From pub...@ Sun Aug 4 17:42:01 2019 From: pub...@ (Yan, Shaobo (...@...)) Date: Mon, 5 Aug 2019 00:42:01 +0000 Subject: [Public WebGL] WEBGL_video_texture shader error on Chrome Canary In-Reply-To: References: Message-ID: Thx for showing intersts, TBH, the sampler type is the last step I?m working on to support it. If you want to try it on windows(other platform not supported yet). You can remove all extension things in shader and directly use sampler2d to replace samplerVideoWEBGL. BR, Yan, Shaobo From: owners-public_webgl...@ [mailto:owners-public_webgl...@] On Behalf Of Takahiro Aoyagi (taoyagi...@) Sent: Friday, August 2, 2019 3:09 AM To: Public WebGL Subject: [Public WebGL] WEBGL_video_texture shader error on Chrome Canary Hi all, I watched SIGGRAPH 2019 khronos BOF yesterday and I want to experiment WEBGL_video_texture extension because Chromium build supports now. I tried on Chrome Canary, but it doesn't seem to accept "#extension GL_WEBGL_video_texture : require" in shader even though it returns non-null from gl.getExtension('WEBGL_video_texture'). Is it intentional and Canary doesn't expose WEBGL_video_texture extension yet to users? Or am I missing something? I already reported to Chromium bugs https://bugs.chromium.org/p/chromium/issues/detail?id=776222#c32 but no response yet. I decided to post here too because I think not only I but also other people may be interested in WEBGL_video_texture from yesterday's BOF and want to test. And I hope someone here knows about the solution or status. Environment: WIndows 10 Chrome Canary (78.0.3871.0 (Official Build) canary (64-bit)) WebGL Draft Extensions is enabled via chrome://flags Sample code: const shaderSource = ` #extension GL_WEBGL_video_texture : require precision mediump float; varying vec2 v_texCoord; uniform samplerVideoWEBGL uSampler; void main(void) { gl_FragColor = texture2D(uSampler, v_texCoord); } `; const canvas = document.createElement('canvas'); const gl = canvas.getContext('webgl'); const extension = gl.getExtension('WEBGL_video_texture'); console.log(extension); const shader = gl.createShader(gl.FRAGMENT_SHADER); gl.shaderSource(shader, shaderSource); gl.compileShader(shader); const success = gl.getShaderParameter(shader, gl.COMPILE_STATUS); if (!success) { console.error('Compile error:' + gl.getShaderInfoLog(shader)); } // result -> WebGLVideoTexture {} // gl.getExtension('WEBGL_video_texture') returns non-null -> Compile error:ERROR: 0:2: 'GL_WEBGL_video_texture' : extension is not supported ERROR: 0:6: 'uSampler' : syntax error Thanks Takahiro -------------- next part -------------- An HTML attachment was scrubbed... URL: