imgui-ws icon indicating copy to clipboard operation
imgui-ws copied to clipboard

32-bit vertex indices

Open ggerganov opened this issue 5 years ago • 7 comments

Can this be achieved? Seems like WebGL only support 16-bit integer indices.

ggerganov avatar Jul 01 '19 21:07 ggerganov

ImDrawList: Support for large meshes (64k+ vertices) with 16-bits indices I am a game developer, imgui-ws can not draw large meshes, do you plan to support it ?

Eragon-Brisingr avatar May 08 '22 08:05 Eragon-Brisingr

Thanks for the link. This will be supported, but I cannot provide ETA at the moment.

ggerganov avatar May 08 '22 08:05 ggerganov

It seems in order to support large meshes with 16-bit indices, you need the OpenGL renderer to support the glDrawElementsBaseVertex() function:

https://github.com/ocornut/imgui/commit/b3dd03f5822aa34be03008db3dd1ad35618cb141#diff-55777f445e451bfff7805abb611c00b44c025149fae791c7d1a1535818788c5fR107-R113

Currently, it seems to not be supported by WebGL, so not sure if we can do anything at the moment

ggerganov avatar May 28 '22 08:05 ggerganov

You mean is WebGL not support this feature? I am sorry to know less about WebGL.

Eragon-Brisingr avatar May 28 '22 09:05 Eragon-Brisingr

It turns out that some browsers actually support 32-bit vertex indices, so I just created a branch that uses this:

https://github.com/ggerganov/imgui-ws/pull/23

See https://computergraphics.stackexchange.com/questions/3637/how-to-use-32-bit-integers-for-element-indices-in-webgl-1-0 for more information.

@Eragon-Brisingr You can give it a try and see if it works for you. See instructions in the PR

ggerganov avatar May 28 '22 09:05 ggerganov

Thank you, I will try it~

Eragon-Brisingr avatar May 28 '22 09:05 Eragon-Brisingr

OES_element_index_uint work very good. Seem Browser compatibility is full support.

Eragon-Brisingr avatar May 28 '22 11:05 Eragon-Brisingr