webcraft: WebGL2 / WebGPU voxel sandbox

176 views
Skip to first unread message

Ivan Popelyshev

unread,
Aug 18, 2021, 6:54:39 PM8/18/21
to WebGL Dev List
I'm helping a guy with his MC clone, for now it works only on PC's.

Posting this in case someone wants to try some graphics algorithms and doesnt want to do it from scratch.

Here's the repo: https://github.com/sciner/webcraft

Here's the server: https://webcraft.whiteframe.ru/

Both webGL and webGPU renderers were made from scratch.

The interesting detail is that I had to make anisotropic mips manually, because in windows its not possible to use anisotropy with NEAREST, which is required by pixel 3d. Yes, it cant be enabled in both webgl and webgpu.

Ken Russell

unread,
Aug 20, 2021, 1:41:49 AM8/20/21
to WebGL Dev List
Very cool! Thanks Ivan for sharing this and making it open-source!

Only tried the WebGL version hosted on the server. It performs reasonably well though might be constrained by the integrated GPU in my dual-GPU MacBook Pro. Have you considered specifying { powerPreference: 'high-performance' } in your context creation attributes?

How efficient is the inner draw loop? Could WEBGL_multi_draw help speed it up?

-Ken



--
You received this message because you are subscribed to the Google Groups "WebGL Dev List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to webgl-dev-lis...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/webgl-dev-list/8d1816be-d288-4abe-a5bc-8870c5c43ee4n%40googlegroups.com.

Ivan Popelyshev

unread,
Aug 20, 2021, 5:50:41 AM8/20/21
to WebGL Dev List
oh, right, we just added 3d-chunks, that increased number of drawcalls on spawn to 460.

The problem is that i use instanced quads to save memory. Suppose I somehow put many chunks in same buffer - i dont see the way to put instance offsets in multi_draw.

I can put several chunks in same buffer - that will drop down number of DC's , but will affect the architecture bad way

-Ivan

пятница, 20 августа 2021 г. в 08:41:49 UTC+3, Kenneth Russell:

Ken Russell

unread,
Aug 21, 2021, 12:44:34 AM8/21/21
to WebGL Dev List
On Fri, Aug 20, 2021 at 2:50 AM Ivan Popelyshev <ivan.po...@gmail.com> wrote:
oh, right, we just added 3d-chunks, that increased number of drawcalls on spawn to 460.

The problem is that i use instanced quads to save memory. Suppose I somehow put many chunks in same buffer - i dont see the way to put instance offsets in multi_draw.

Would WEBGL_multi_draw_instanced_base_vertex_base_instance provide the API you need? The working group's finally close to agreement to promoting it to Community Approved (have been waiting on multiple implementations), and it would be great to know there's another use case waiting for it.

-Ken

 
I can put several chunks in same buffer - that will drop down number of DC's , but will affect the architecture bad way

-Ivan

пятница, 20 августа 2021 г. в 08:41:49 UTC+3, Kenneth Russell:
Very cool! Thanks Ivan for sharing this and making it open-source!

Only tried the WebGL version hosted on the server. It performs reasonably well though might be constrained by the integrated GPU in my dual-GPU MacBook Pro. Have you considered specifying { powerPreference: 'high-performance' } in your context creation attributes?

How efficient is the inner draw loop? Could WEBGL_multi_draw help speed it up?

-Ken



On Wed, Aug 18, 2021 at 3:54 PM Ivan Popelyshev <ivan.po...@gmail.com> wrote:
I'm helping a guy with his MC clone, for now it works only on PC's.

Posting this in case someone wants to try some graphics algorithms and doesnt want to do it from scratch.

Here's the repo: https://github.com/sciner/webcraft

Here's the server: https://webcraft.whiteframe.ru/

Both webGL and webGPU renderers were made from scratch.

The interesting detail is that I had to make anisotropic mips manually, because in windows its not possible to use anisotropy with NEAREST, which is required by pixel 3d. Yes, it cant be enabled in both webgl and webgpu.

--
You received this message because you are subscribed to the Google Groups "WebGL Dev List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to webgl-dev-lis...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/webgl-dev-list/8d1816be-d288-4abe-a5bc-8870c5c43ee4n%40googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "WebGL Dev List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to webgl-dev-lis...@googlegroups.com.

Ivan Popelyshev

unread,
Aug 21, 2021, 6:17:21 AM8/21/21
to WebGL Dev List
yes, both 
and 
will be useful for me

I had to spam vertexAttribPointer's with offset on instanced attributes in previous project :(

I have special algorithm that can handle buffer memory management, together with this thing we'll be able to show very big worlds :)

суббота, 21 августа 2021 г. в 07:44:34 UTC+3, Kenneth Russell:

Ken Russell

unread,
Aug 23, 2021, 9:54:49 PM8/23/21
to WebGL Dev List, Jeff Gilbert, Shrek Shao
OK, good to know these extensions will help you. CC'ing Jeff Gilbert and Shrek Shao explicitly; it would be great to get these extensions over the finish line.

-Ken



Reply all
Reply to author
Forward
0 new messages