I would like to process OpenGLES with the Unity plug-in (dll side) and reflect it to Unity side.
Find out how
https://docs.unity3d.com/ja/540/Manual/NativePluginInterface.html
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
glEnable(GL_TEXTURE_2D);
glGenTextures(1,&m_TexID);
glBindTexture(GL_TEXTURE_2D, m_TexID);
Call to generate textures on the dll side and draw them on the Unity side
on the dll sideglClearColor(r,g,b,a);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
Use to clear the screen or
glViewport(x,y,w,h);
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.
Also
https://docs.unity3d.com/ja/540/ScriptReference/GL.InvalidateState.html
GL.InvalidateState();
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
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.
(However,
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...)
581 PHP ssh2_scp_send fails to send files as intended
915 When building Fast API+Uvicorn environment with PyInstaller, console=False results in an error
611 GDB gets version error when attempting to debug with the Presense SDK (IDE)
618 Uncaught (inpromise) Error on Electron: An object could not be cloned
© 2024 OneMinuteCode. All rights reserved.