is it possible to use the ubo which is generated by Open GL ES api in Unity?
if ok,how to use?
is it possible to use the ubo which is generated by Open GL ES api in Unity?
if ok,how to use?
That’s really not how shaders in Unity work at all. You’re not working at that low a level.
Thanks for replying!! And I am new for Unity, so , could you tell me where is the unity api like UBO? Thanks…
You should explain us, what exactly you try to solve.
Possibly you are biting a problem from a wrong angle.
Depending on what exactly you want to do you might want to take a look at scripting API for Material Set(Buffer,Float,Texture,Ints, …) methods and also ComputeShader API which has similar methods for passing data to compute shader.
OK, I’m sorry I didn’t explain the problem in detail。
I am decoding the video stream with android api(android.media.MediaCodec).
The video content after decoding will fill to a unity texture to show it.
I fill to the unity texture with some extra info, such as the rotation of the current video content.
My first solution is generating a UBO and fill the extra info to the UBO, in the decoding thread, then reading the UBO in a shader in the unity thread;
the decoding thread has a share egl context from the unity thread.
So, I don’t know how to read the UBO in the unity shader…
You can just pass variables to the material and shader using some of the methods here instead.