Is it possible to have the Unity plug-in perform OpenGLES operations?

Asked 3 months ago, Updated 3 months ago, 13 views

I would like to process OpenGLES with the Unity plug-in (dll side) and reflect it to Unity side.

Find out how

in such a way that Unity generates the substance of the texture and rewrites the content. Samples and contents were listed.
(There were a lot of articles that verified the above in the search results to see if the method of investigation was bad.)

What I want to implement is

on the dll side
glBindTexture(GL_TEXTURE_2D, m_TexID);

Call to generate textures on the dll side and draw them on the Unity side

on the dll side

Use to clear the screen or


Is it possible to use to specify a viewport?

実行 The running environment is Unity 5.6.0f3, and
Player Setting to work with OpenGLES Changing the Auto Graphics API.


as described in the .

Is it necessary to use ?
(I couldn't even find a GL.InvalidateState use case, so
I couldn't decide whether the reference content is relevant or when to use it.)

I would appreciate it if you could let me know if anyone is familiar with it.

unity3d opengl-es

2022-09-30 11:38

1 Answers

After trial and error, we found that it is possible for Unity to draw the contents created on the dll side.
To actually reflect the above content
Do it in a col routine, etc., and

yield return new WaitForEndOfFrame();

Wait until

GL.IssuePluginEvent (RenderEventFunc(), eventID);

must call dll-side action to handle OpenGL in render events.

If you do not wait until WaitForEndOfFrame() The operation specified on the dll side is not drawn.
for example, transforming textures and polygons created on the Unity side. It seems to be applied to objects that already exist.)

In addition, GL.InvalidateState(); was not required to be used.
(What is GL.InvalidateState() for...)

2022-09-30 11:38

If you have any answers or tips

© 2023 OneMinuteCode. All rights reserved.