From eng...@ Thu Feb 21 16:55:10 2019 From: eng...@ (Austin Eng) Date: Thu, 21 Feb 2019 16:55:10 -0800 Subject: [Public WebGL] New multi_draw extensions Message-ID: WebGL community, Two new extensions are in development which provide better batching for draw calls: WEBGL_multi_draw WEBGL_multi_draw_instanced Compared to instancing, which is available as an extension in WebGL 1.0 and is core in WebGL 2.0, multi_draw provides more flexibility. It essentially allows the parameters to multiple calls to drawArrays and drawElements to be assembled in arrays, and sent down to the WebGL implementation with one call. This eliminates a large amount of overhead when repeatedly calling from the JavaScript application down into the WebGL implementation. Per-draw-call data can be sent down in multiple ways, including in uniform buffers (WebGL 2.0) indexed by a new gl_DrawID variable available in shaders. A few examples of how these APIs can be used are in this repository: https://github.com/kenrussell/webgl-animometer The potential speedups are dramatic. Microbenchmarks show anywhere from a 2-3x speedup to a 70x (!) speedup in Chrome, compared to making tiny individual draw calls from JavaScript. Prototypes in other browsers show ~4x speedups too; the benefits are universal. Please give these extensions a try. They?re currently available in Chrome Canary on all platforms by enabling WebGL draft extensions in about:flags, and are coming to more browsers soon. A BaseVertex variant of the extensions is also planned. We would appreciate your feedback on how well the multi_draw extensions work for your applications, and any suggestions for continued enhancement. Thanks to Kai Ninomiya from Google for support in developing these extensions! - Austin Eng -------------- next part -------------- An HTML attachment was scrubbed... URL: From pub...@ Fri Feb 22 10:21:47 2019 From: pub...@ (Austin Eng (...@...)) Date: Fri, 22 Feb 2019 10:21:47 -0800 Subject: [Public WebGL] New multi_draw extensions Message-ID: Resending this because the previous email was likely marked as spam. WebGL community, Two new extensions are in development which provide better batching for draw calls: WEBGL_multi_draw WEBGL_multi_draw_instanced Compared to instancing, which is available as an extension in WebGL 1.0 and is core in WebGL 2.0, multi_draw provides more flexibility. It essentially allows the parameters to multiple calls to drawArrays and drawElements to be assembled in arrays, and sent down to the WebGL implementation with one call. This eliminates a large amount of overhead when repeatedly calling from the JavaScript application down into the WebGL implementation. Per-draw-call data can be sent down in multiple ways, including in uniform buffers (WebGL 2.0) indexed by a new gl_DrawID variable available in shaders. A few examples of how these APIs can be used are in this repository: https://github.com/kenrussell/webgl-animometer The potential speedups are dramatic. Microbenchmarks show anywhere from a 2-3x speedup to a 70x (!) speedup in Chrome, compared to making tiny individual draw calls from JavaScript. Prototypes in other browsers show ~4x speedups too; the benefits are universal. Please give these extensions a try. They?re currently available in Chrome Canary on all platforms by enabling WebGL draft extensions in about:flags, and are coming to more browsers soon. A BaseVertex variant of the extensions is also planned. We would appreciate your feedback on how well the multi_draw extensions work for your applications, and any suggestions for continued enhancement. Thanks to Kai Ninomiya from Google for support in developing these extensions! - Austin Eng -------------- next part -------------- An HTML attachment was scrubbed... URL: From pub...@ Fri Feb 22 10:29:49 2019 From: pub...@ (David Catuhe (...@...)) Date: Fri, 22 Feb 2019 18:29:49 +0000 Subject: [Public WebGL] New multi_draw extensions In-Reply-To: References: Message-ID: Just created an issue to support them ? https://github.com/BabylonJS/Babylon.js/issues/5962 From: owners-public_webgl...@ On Behalf Of Austin Eng (enga...@) Sent: Friday, February 22, 2019 10:22 AM To: public_webgl...@ Subject: [Public WebGL] New multi_draw extensions Resending this because the previous email was likely marked as spam. WebGL community, Two new extensions are in development which provide better batching for draw calls: WEBGL_multi_draw WEBGL_multi_draw_instanced Compared to instancing, which is available as an extension in WebGL 1.0 and is core in WebGL 2.0, multi_draw provides more flexibility. It essentially allows the parameters to multiple calls to drawArrays and drawElements to be assembled in arrays, and sent down to the WebGL implementation with one call. This eliminates a large amount of overhead when repeatedly calling from the JavaScript application down into the WebGL implementation. Per-draw-call data can be sent down in multiple ways, including in uniform buffers (WebGL 2.0) indexed by a new gl_DrawID variable available in shaders. A few examples of how these APIs can be used are in this repository: https://github.com/kenrussell/webgl-animometer The potential speedups are dramatic. Microbenchmarks show anywhere from a 2-3x speedup to a 70x (!) speedup in Chrome, compared to making tiny individual draw calls from JavaScript. Prototypes in other browsers show ~4x speedups too; the benefits are universal. Please give these extensions a try. They?re currently available in Chrome Canary on all platforms by enabling WebGL draft extensions in about:flags, and are coming to more browsers soon. A BaseVertex variant of the extensions is also planned. We would appreciate your feedback on how well the multi_draw extensions work for your applications, and any suggestions for continued enhancement. Thanks to Kai Ninomiya from Google for support in developing these extensions! - Austin Eng -------------- next part -------------- An HTML attachment was scrubbed... URL: From pub...@ Fri Feb 22 10:35:30 2019 From: pub...@ (Ken Russell (...@...)) Date: Fri, 22 Feb 2019 10:35:30 -0800 Subject: [Public WebGL] New multi_draw extensions In-Reply-To: References: Message-ID: Fantastic! For scenes which are well sorted by state/material, the available speedups from these extensions are tremendous. We look forward to what's possible in Babylon and other 3D engines on the web! Great work Austin and Kai! Looking forward to other browsers implementing these, too, and moving them to community approved quickly! -Ken On Fri, Feb 22, 2019 at 10:30 AM David Catuhe (David.Catuhe...@) < public_webgl...@> wrote: > Just created an issue to support them ? > > https://github.com/BabylonJS/Babylon.js/issues/5962 > > > > *From:* owners-public_webgl...@ *On > Behalf Of *Austin Eng (enga...@) > *Sent:* Friday, February 22, 2019 10:22 AM > *To:* public_webgl...@ > *Subject:* [Public WebGL] New multi_draw extensions > > > > Resending this because the previous email was likely marked as spam. > > > > WebGL community, > > > > Two new extensions are in development which provide better batching for > draw calls: > > > > WEBGL_multi_draw > > > WEBGL_multi_draw_instanced > > > > > Compared to instancing, which is available as an extension in WebGL 1.0 > and is core in WebGL 2.0, multi_draw provides more flexibility. It > essentially allows the parameters to multiple calls to drawArrays and > drawElements to be assembled in arrays, and sent down to the WebGL > implementation with one call. This eliminates a large amount of overhead > when repeatedly calling from the JavaScript application down into the WebGL > implementation. > > > > Per-draw-call data can be sent down in multiple ways, including in uniform > buffers (WebGL 2.0) indexed by a new gl_DrawID variable available in > shaders. > > > > A few examples of how these APIs can be used are in this repository: > > https://github.com/kenrussell/webgl-animometer > > > > > The potential speedups are dramatic. Microbenchmarks > > show anywhere from a 2-3x speedup to a 70x (!) speedup in Chrome, compared > to making tiny individual draw calls from JavaScript. Prototypes in other > browsers show ~4x speedups too; the benefits are universal. > > > > Please give these extensions a try. They?re currently available in Chrome > Canary on all platforms by enabling WebGL draft extensions in about:flags, > and are coming to more browsers soon. A BaseVertex variant of the > extensions is also planned. > > > > We would appreciate your feedback on how well the multi_draw extensions > work for your applications, and any suggestions for continued enhancement. > > > > Thanks to Kai Ninomiya from Google for support in developing these > extensions! > > > > - Austin Eng > -------------- next part -------------- An HTML attachment was scrubbed... URL: From pub...@ Fri Feb 22 11:18:46 2019 From: pub...@ (=?UTF-8?Q?Fernando_Serrano_Garc=C3=ADa?= (...@...)) Date: Fri, 22 Feb 2019 20:18:46 +0100 Subject: [Public WebGL] New multi_draw extensions In-Reply-To: References: Message-ID: just a nit: I tried the examples on the slides and I got the following on the console: "Disabling use_ubos. webgl_version is not 2." I guess both urls should include the "&webgl_version=2" isn't it? Excited to give it a try! On Fri, Feb 22, 2019 at 7:36 PM Ken Russell (kbr...@) < public_webgl...@> wrote: > Fantastic! > > For scenes which are well sorted by state/material, the available speedups > from these extensions are tremendous. We look forward to what's possible in > Babylon and other 3D engines on the web! > > Great work Austin and Kai! Looking forward to other browsers implementing > these, too, and moving them to community approved quickly! > > -Ken > > > On Fri, Feb 22, 2019 at 10:30 AM David Catuhe (David.Catuhe...@) > wrote: > >> Just created an issue to support them ? >> >> https://github.com/BabylonJS/Babylon.js/issues/5962 >> >> >> >> *From:* owners-public_webgl...@ >> *On Behalf Of *Austin Eng (enga...@) >> *Sent:* Friday, February 22, 2019 10:22 AM >> *To:* public_webgl...@ >> *Subject:* [Public WebGL] New multi_draw extensions >> >> >> >> Resending this because the previous email was likely marked as spam. >> >> >> >> WebGL community, >> >> >> >> Two new extensions are in development which provide better batching for >> draw calls: >> >> >> >> WEBGL_multi_draw >> >> >> WEBGL_multi_draw_instanced >> >> >> >> >> Compared to instancing, which is available as an extension in WebGL 1.0 >> and is core in WebGL 2.0, multi_draw provides more flexibility. It >> essentially allows the parameters to multiple calls to drawArrays and >> drawElements to be assembled in arrays, and sent down to the WebGL >> implementation with one call. This eliminates a large amount of overhead >> when repeatedly calling from the JavaScript application down into the WebGL >> implementation. >> >> >> >> Per-draw-call data can be sent down in multiple ways, including in >> uniform buffers (WebGL 2.0) indexed by a new gl_DrawID variable available >> in shaders. >> >> >> >> A few examples of how these APIs can be used are in this repository: >> >> https://github.com/kenrussell/webgl-animometer >> >> >> >> >> The potential speedups are dramatic. Microbenchmarks >> >> show anywhere from a 2-3x speedup to a 70x (!) speedup in Chrome, compared >> to making tiny individual draw calls from JavaScript. Prototypes in other >> browsers show ~4x speedups too; the benefits are universal. >> >> >> >> Please give these extensions a try. They?re currently available in Chrome >> Canary on all platforms by enabling WebGL draft extensions in about:flags, >> and are coming to more browsers soon. A BaseVertex variant of the >> extensions is also planned. >> >> >> >> We would appreciate your feedback on how well the multi_draw extensions >> work for your applications, and any suggestions for continued enhancement. >> >> >> >> Thanks to Kai Ninomiya from Google for support in developing these >> extensions! >> >> >> >> - Austin Eng >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From pub...@ Fri Feb 22 11:44:04 2019 From: pub...@ (Wayne Langman (...@...)) Date: Fri, 22 Feb 2019 21:44:04 +0200 Subject: [Public WebGL] New multi_draw extensions In-Reply-To: References: Message-ID: <98FD54C9-C946-4162-9F87-7A2C8ED7A446@gmail.com> Hoping ?all platforms? includes mobile =) Sent from my iPhone > On Feb 22, 2019, at 21:18, Fernando Serrano Garc?a (fserrano...@) wrote: > > just a nit: I tried the examples on the slides and I got the following on the console: "Disabling use_ubos. webgl_version is not 2." > I guess both urls should include the "&webgl_version=2" isn't it? > > Excited to give it a try! > >> On Fri, Feb 22, 2019 at 7:36 PM Ken Russell (kbr...@) wrote: >> Fantastic! >> >> For scenes which are well sorted by state/material, the available speedups from these extensions are tremendous. We look forward to what's possible in Babylon and other 3D engines on the web! >> >> Great work Austin and Kai! Looking forward to other browsers implementing these, too, and moving them to community approved quickly! >> >> -Ken >> >> >>> On Fri, Feb 22, 2019 at 10:30 AM David Catuhe (David.Catuhe...@) wrote: >>> Just created an issue to support them ? >>> >>> https://github.com/BabylonJS/Babylon.js/issues/5962 >>> >>> >>> >>> From: owners-public_webgl...@ On Behalf Of Austin Eng (enga...@) >>> Sent: Friday, February 22, 2019 10:22 AM >>> To: public_webgl...@ >>> Subject: [Public WebGL] New multi_draw extensions >>> >>> >>> >>> Resending this because the previous email was likely marked as spam. >>> >>> >>> >>> WebGL community, >>> >>> >>> Two new extensions are in development which provide better batching for draw calls: >>> >>> >>> WEBGL_multi_draw >>> WEBGL_multi_draw_instanced >>> >>> >>> Compared to instancing, which is available as an extension in WebGL 1.0 and is core in WebGL 2.0, multi_draw provides more flexibility. It essentially allows the parameters to multiple calls to drawArrays and drawElements to be assembled in arrays, and sent down to the WebGL implementation with one call. This eliminates a large amount of overhead when repeatedly calling from the JavaScript application down into the WebGL implementation. >>> >>> >>> Per-draw-call data can be sent down in multiple ways, including in uniform buffers (WebGL 2.0) indexed by a new gl_DrawID variable available in shaders. >>> >>> >>> A few examples of how these APIs can be used are in this repository: >>> https://github.com/kenrussell/webgl-animometer >>> >>> >>> The potential speedups are dramatic. Microbenchmarks show anywhere from a 2-3x speedup to a 70x (!) speedup in Chrome, compared to making tiny individual draw calls from JavaScript. Prototypes in other browsers show ~4x speedups too; the benefits are universal. >>> >>> >>> Please give these extensions a try. They?re currently available in Chrome Canary on all platforms by enabling WebGL draft extensions in about:flags, and are coming to more browsers soon. A BaseVertex variant of the extensions is also planned. >>> >>> >>> We would appreciate your feedback on how well the multi_draw extensions work for your applications, and any suggestions for continued enhancement. >>> >>> >>> Thanks to Kai Ninomiya from Google for support in developing these extensions! >>> >>> - Austin Eng -------------- next part -------------- An HTML attachment was scrubbed... URL: From pub...@ Fri Feb 22 11:51:46 2019 From: pub...@ (Ken Russell (...@...)) Date: Fri, 22 Feb 2019 11:51:46 -0800 Subject: [Public WebGL] New multi_draw extensions In-Reply-To: <98FD54C9-C946-4162-9F87-7A2C8ED7A446@gmail.com> References: <98FD54C9-C946-4162-9F87-7A2C8ED7A446@gmail.com> Message-ID: It does! You can enable draft extensions in Chrome on Android via about:flags; the new extensions already work there in the early-access release channels, including Canary and Dev Channel. -Ken On Fri, Feb 22, 2019 at 11:45 AM Wayne Langman ( eberus.blackcrowned...@) wrote: > Hoping ?all platforms? includes mobile =) > > Sent from my iPhone > > On Feb 22, 2019, at 21:18, Fernando Serrano Garc?a (fserrano...@) > wrote: > > just a nit: I tried the examples on the slides and I got the following on > the console: "Disabling use_ubos. webgl_version is not 2." > I guess both urls should include the "&webgl_version=2" isn't it? > > Excited to give it a try! > > On Fri, Feb 22, 2019 at 7:36 PM Ken Russell (kbr...@) < > public_webgl...@> wrote: > >> Fantastic! >> >> For scenes which are well sorted by state/material, the available >> speedups from these extensions are tremendous. We look forward to what's >> possible in Babylon and other 3D engines on the web! >> >> Great work Austin and Kai! Looking forward to other browsers implementing >> these, too, and moving them to community approved quickly! >> >> -Ken >> >> >> On Fri, Feb 22, 2019 at 10:30 AM David Catuhe (David.Catuhe...@) >> wrote: >> >>> Just created an issue to support them ? >>> >>> https://github.com/BabylonJS/Babylon.js/issues/5962 >>> >>> >>> >>> *From:* owners-public_webgl...@ >>> *On Behalf Of *Austin Eng (enga...@) >>> *Sent:* Friday, February 22, 2019 10:22 AM >>> *To:* public_webgl...@ >>> *Subject:* [Public WebGL] New multi_draw extensions >>> >>> >>> >>> Resending this because the previous email was likely marked as spam. >>> >>> >>> >>> WebGL community, >>> >>> >>> >>> Two new extensions are in development which provide better batching for >>> draw calls: >>> >>> >>> >>> WEBGL_multi_draw >>> >>> >>> WEBGL_multi_draw_instanced >>> >>> >>> >>> >>> Compared to instancing, which is available as an extension in WebGL 1.0 >>> and is core in WebGL 2.0, multi_draw provides more flexibility. It >>> essentially allows the parameters to multiple calls to drawArrays and >>> drawElements to be assembled in arrays, and sent down to the WebGL >>> implementation with one call. This eliminates a large amount of overhead >>> when repeatedly calling from the JavaScript application down into the WebGL >>> implementation. >>> >>> >>> >>> Per-draw-call data can be sent down in multiple ways, including in >>> uniform buffers (WebGL 2.0) indexed by a new gl_DrawID variable available >>> in shaders. >>> >>> >>> >>> A few examples of how these APIs can be used are in this repository: >>> >>> https://github.com/kenrussell/webgl-animometer >>> >>> >>> >>> >>> The potential speedups are dramatic. Microbenchmarks >>> >>> show anywhere from a 2-3x speedup to a 70x (!) speedup in Chrome, compared >>> to making tiny individual draw calls from JavaScript. Prototypes in other >>> browsers show ~4x speedups too; the benefits are universal. >>> >>> >>> >>> Please give these extensions a try. They?re currently available in >>> Chrome Canary on all platforms by enabling WebGL draft extensions in >>> about:flags, and are coming to more browsers soon. A BaseVertex variant of >>> the extensions is also planned. >>> >>> >>> >>> We would appreciate your feedback on how well the multi_draw extensions >>> work for your applications, and any suggestions for continued enhancement. >>> >>> >>> >>> Thanks to Kai Ninomiya from Google for support in developing these >>> extensions! >>> >>> >>> >>> - Austin Eng >>> >> -------------- next part -------------- An HTML attachment was scrubbed... URL: From pub...@ Fri Feb 22 11:51:52 2019 From: pub...@ (Austin Eng (...@...)) Date: Fri, 22 Feb 2019 11:51:52 -0800 Subject: [Public WebGL] New multi_draw extensions In-Reply-To: <98FD54C9-C946-4162-9F87-7A2C8ED7A446@gmail.com> References: <98FD54C9-C946-4162-9F87-7A2C8ED7A446@gmail.com> Message-ID: Thanks Fernando, I fixed the links. Wayne, the uniforms vs. UBOs + multi_draw test is 40ms vs <1 ms CPU time per frame on our Pixel 2 bots. On Fri, Feb 22, 2019 at 11:45 AM Wayne Langman ( eberus.blackcrowned...@) wrote: > Hoping ?all platforms? includes mobile =) > > Sent from my iPhone > > On Feb 22, 2019, at 21:18, Fernando Serrano Garc?a (fserrano...@) > wrote: > > just a nit: I tried the examples on the slides and I got the following on > the console: "Disabling use_ubos. webgl_version is not 2." > I guess both urls should include the "&webgl_version=2" isn't it? > > Excited to give it a try! > > On Fri, Feb 22, 2019 at 7:36 PM Ken Russell (kbr...@) < > public_webgl...@> wrote: > >> Fantastic! >> >> For scenes which are well sorted by state/material, the available >> speedups from these extensions are tremendous. We look forward to what's >> possible in Babylon and other 3D engines on the web! >> >> Great work Austin and Kai! Looking forward to other browsers implementing >> these, too, and moving them to community approved quickly! >> >> -Ken >> >> >> On Fri, Feb 22, 2019 at 10:30 AM David Catuhe (David.Catuhe...@) >> wrote: >> >>> Just created an issue to support them ? >>> >>> https://github.com/BabylonJS/Babylon.js/issues/5962 >>> >>> >>> >>> *From:* owners-public_webgl...@ >>> *On Behalf Of *Austin Eng (enga...@) >>> *Sent:* Friday, February 22, 2019 10:22 AM >>> *To:* public_webgl...@ >>> *Subject:* [Public WebGL] New multi_draw extensions >>> >>> >>> >>> Resending this because the previous email was likely marked as spam. >>> >>> >>> >>> WebGL community, >>> >>> >>> >>> Two new extensions are in development which provide better batching for >>> draw calls: >>> >>> >>> >>> WEBGL_multi_draw >>> >>> >>> WEBGL_multi_draw_instanced >>> >>> >>> >>> >>> Compared to instancing, which is available as an extension in WebGL 1.0 >>> and is core in WebGL 2.0, multi_draw provides more flexibility. It >>> essentially allows the parameters to multiple calls to drawArrays and >>> drawElements to be assembled in arrays, and sent down to the WebGL >>> implementation with one call. This eliminates a large amount of overhead >>> when repeatedly calling from the JavaScript application down into the WebGL >>> implementation. >>> >>> >>> >>> Per-draw-call data can be sent down in multiple ways, including in >>> uniform buffers (WebGL 2.0) indexed by a new gl_DrawID variable available >>> in shaders. >>> >>> >>> >>> A few examples of how these APIs can be used are in this repository: >>> >>> https://github.com/kenrussell/webgl-animometer >>> >>> >>> >>> >>> The potential speedups are dramatic. Microbenchmarks >>> >>> show anywhere from a 2-3x speedup to a 70x (!) speedup in Chrome, compared >>> to making tiny individual draw calls from JavaScript. Prototypes in other >>> browsers show ~4x speedups too; the benefits are universal. >>> >>> >>> >>> Please give these extensions a try. They?re currently available in >>> Chrome Canary on all platforms by enabling WebGL draft extensions in >>> about:flags, and are coming to more browsers soon. A BaseVertex variant of >>> the extensions is also planned. >>> >>> >>> >>> We would appreciate your feedback on how well the multi_draw extensions >>> work for your applications, and any suggestions for continued enhancement. >>> >>> >>> >>> Thanks to Kai Ninomiya from Google for support in developing these >>> extensions! >>> >>> >>> >>> - Austin Eng >>> >> -------------- next part -------------- An HTML attachment was scrubbed... URL: From pub...@ Fri Feb 22 23:36:39 2019 From: pub...@ (Wayne Langman (...@...)) Date: Sat, 23 Feb 2019 09:36:39 +0200 Subject: [Public WebGL] New multi_draw extensions In-Reply-To: References: <98FD54C9-C946-4162-9F87-7A2C8ED7A446@gmail.com> Message-ID: <2A728EF8-5FBC-4D91-BD14-2462B68F5C5B@gmail.com> Thanks Austin / Ken, this looks promising! Sent from my iPhone > On Feb 22, 2019, at 21:51, Austin Eng (enga...@) wrote: > > Thanks Fernando, I fixed the links. > > Wayne, the uniforms vs. UBOs + multi_draw test is 40ms vs <1 ms CPU time per frame on our Pixel 2 bots. > >> On Fri, Feb 22, 2019 at 11:45 AM Wayne Langman (eberus.blackcrowned...@) wrote: >> Hoping ?all platforms? includes mobile =) >> >> Sent from my iPhone >> >>> On Feb 22, 2019, at 21:18, Fernando Serrano Garc?a (fserrano...@) wrote: >>> >>> just a nit: I tried the examples on the slides and I got the following on the console: "Disabling use_ubos. webgl_version is not 2." >>> I guess both urls should include the "&webgl_version=2" isn't it? >>> >>> Excited to give it a try! >>> >>>> On Fri, Feb 22, 2019 at 7:36 PM Ken Russell (kbr...@) wrote: >>>> Fantastic! >>>> >>>> For scenes which are well sorted by state/material, the available speedups from these extensions are tremendous. We look forward to what's possible in Babylon and other 3D engines on the web! >>>> >>>> Great work Austin and Kai! Looking forward to other browsers implementing these, too, and moving them to community approved quickly! >>>> >>>> -Ken >>>> >>>> >>>>> On Fri, Feb 22, 2019 at 10:30 AM David Catuhe (David.Catuhe...@) wrote: >>>>> Just created an issue to support them ? >>>>> >>>>> https://github.com/BabylonJS/Babylon.js/issues/5962 >>>>> >>>>> >>>>> >>>>> From: owners-public_webgl...@ On Behalf Of Austin Eng (enga...@) >>>>> Sent: Friday, February 22, 2019 10:22 AM >>>>> To: public_webgl...@ >>>>> Subject: [Public WebGL] New multi_draw extensions >>>>> >>>>> >>>>> >>>>> Resending this because the previous email was likely marked as spam. >>>>> >>>>> >>>>> >>>>> WebGL community, >>>>> >>>>> >>>>> Two new extensions are in development which provide better batching for draw calls: >>>>> >>>>> >>>>> WEBGL_multi_draw >>>>> WEBGL_multi_draw_instanced >>>>> >>>>> >>>>> Compared to instancing, which is available as an extension in WebGL 1.0 and is core in WebGL 2.0, multi_draw provides more flexibility. It essentially allows the parameters to multiple calls to drawArrays and drawElements to be assembled in arrays, and sent down to the WebGL implementation with one call. This eliminates a large amount of overhead when repeatedly calling from the JavaScript application down into the WebGL implementation. >>>>> >>>>> >>>>> Per-draw-call data can be sent down in multiple ways, including in uniform buffers (WebGL 2.0) indexed by a new gl_DrawID variable available in shaders. >>>>> >>>>> >>>>> A few examples of how these APIs can be used are in this repository: >>>>> https://github.com/kenrussell/webgl-animometer >>>>> >>>>> >>>>> The potential speedups are dramatic. Microbenchmarks show anywhere from a 2-3x speedup to a 70x (!) speedup in Chrome, compared to making tiny individual draw calls from JavaScript. Prototypes in other browsers show ~4x speedups too; the benefits are universal. >>>>> >>>>> >>>>> Please give these extensions a try. They?re currently available in Chrome Canary on all platforms by enabling WebGL draft extensions in about:flags, and are coming to more browsers soon. A BaseVertex variant of the extensions is also planned. >>>>> >>>>> >>>>> We would appreciate your feedback on how well the multi_draw extensions work for your applications, and any suggestions for continued enhancement. >>>>> >>>>> >>>>> Thanks to Kai Ninomiya from Google for support in developing these extensions! >>>>> >>>>> - Austin Eng -------------- next part -------------- An HTML attachment was scrubbed... URL: From pub...@ Thu Feb 28 13:00:04 2019 From: pub...@ (Jeff Gilbert (...@...)) Date: Thu, 28 Feb 2019 13:00:04 -0800 Subject: [Public WebGL] Changes to unwritten fragment output attachment requirements Message-ID: Previously, as long as the fragment shader doesn't (statically) write to a particular fragment output location (or index for gl_FragData[index]), the color-attachment for that location remained unchanged even if enabled via drawBuffers. To do this, the browser generally had to mask out these unwritten attachments under the covers, because the underlying OpenGL specs don't allow this. (unwritten fragment outputs receive undefined values, which may or may not mean they remain unchanged, but usually not) This increased draw call overhead and reduces predictability. In https://github.com/KhronosGroup/WebGL/pull/2780 , I proposed tightening the requirements here, requiring that all drawBuffers-enabled non-null color-attachments must have a declared fragment output: "If any draw buffer with an attachment does not have a defined fragment shader output, draws generate INVALID_OPERATION." Content written according to the OpenGL specifications will continue to work as expected, so Emscripten'd projects should see no changes. I experimentally applied this restriction in Firefox Nightly about a month ago, and I haven't heard of any related content breakage, so we will be merging this proposal into the WebGL specs. ----------------------------------------------------------- You are currently subscribed to public_webgl...@ To unsubscribe, send an email to majordomo...@ with the following command in the body of your email: unsubscribe public_webgl -----------------------------------------------------------