Unity-Technologies / NativeRenderingPlugin

C++ Rendering Plugin example for Unity
https://docs.unity3d.com/Manual/NativePluginInterface.html
MIT License
815 stars 163 forks source link

SUPPORT_OPENGL_ES - fix for modify vertex buffer #31

Open nfynt opened 1 year ago

nfynt commented 1 year ago

Due to unavailability of glMapBuffer and glUnmapBuffer on GLES version 3.0 and before, the current implementation simply skips the update vertex buffer update.

This fix maintains a temporary CPU bound m_VertexBufferPtr which is used to update the Unity mesh bufferHandle using glBufferSubData. Thus fixing mesh vertex buffer modify for OpenGLES support, affecting platforms - WebGL, Android, linux embed, and iOS.