Hi folks!
Here is my problem: I need to render video on a plane in irrlicht.
I can play video just fine with iOS by fetching each frame of the image. Do you think it is possible to then use the UIImage I fetch and bind it to the plane?
My OpenGL is bad, so if you can show me some code i'd appreciate it!
Cheers
Irrlicht setMaterialTexture from UIImage (iOS)
Re: Irrlicht setMaterialTexture from UIImage (iOS)
In principle, you texture the plane with an image. Then, every frame, you lock the texture, copy the new pixels to it, and unlock it. I don't have any code. Maybe Google for video in opengl or for locking a texture in memory.
-
- Competition winner
- Posts: 688
- Joined: Mon Sep 10, 2012 8:51 am
Re: Irrlicht setMaterialTexture from UIImage (iOS)
Actually, you don't need to know OpenGL. Just use the render-to-target system.
Create a RenderTargetTexture for the scene element, and every frame, draw video to that texture. You may even skip some frames and only draw when the actual frame changes in the video (i.e. synch with video framing), and that way, you aren't rendering to it every time. However, every frame, you will have to render that RenderTargetTexture as the texture of the scene element.
Sorry, I don't have code for you.
Create a RenderTargetTexture for the scene element, and every frame, draw video to that texture. You may even skip some frames and only draw when the actual frame changes in the video (i.e. synch with video framing), and that way, you aren't rendering to it every time. However, every frame, you will have to render that RenderTargetTexture as the texture of the scene element.
Sorry, I don't have code for you.