NativeRenderingPlugin icon indicating copy to clipboard operation
NativeRenderingPlugin copied to clipboard

Modifying vertex buffer on WebGL is disabled

Open oktomus opened this issue 4 years ago • 1 comments

Hi, I'm trying to run the plugin sample under WebGL. It works fine in Editor, but the mesh is completely flat in web.

Looking at the code, it seems that modifying the mesh was intentionally disabled for WebGL.

https://github.com/Unity-Technologies/NativeRenderingPlugin/blob/cebe85af2de836c7ee6198f7ca4b488519f2db78/PluginSource/source/RenderAPI_OpenGLCoreES.cpp#L280-L294

When removing the check on SUPPORT_OPENGL_ES, I get the following error when building from Unity :

'GL_WRITE_ONLY' is undefined

image

oktomus avatar Nov 02 '20 11:11 oktomus

Due to unavailability of glMapBuffer and glUnmapBuffer on GLES version 3.0 and before, the current implementation simply skips modifying vertex buffer by returning 0. Here, I've raised a pull request fixing this, which you may find helpful.

nfynt avatar Apr 01 '23 14:04 nfynt