Skip to content

Modifying vertex buffer on WebGL is disabled #14

@oktomus

Description

@oktomus

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.

void* RenderAPI_OpenGLCoreES::BeginModifyVertexBuffer(void* bufferHandle, size_t* outBufferSize)
{
# if SUPPORT_OPENGL_ES
return 0;
# else
glBindBuffer(GL_ARRAY_BUFFER, (GLuint)(size_t)bufferHandle);
GLint size = 0;
glGetBufferParameteriv(GL_ARRAY_BUFFER, GL_BUFFER_SIZE, &size);
*outBufferSize = size;
void* mapped = glMapBuffer(GL_ARRAY_BUFFER, GL_WRITE_ONLY);
return mapped;
# endif
}

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

'GL_WRITE_ONLY' is undefined

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions