Page 1 of 1

Irrlicht setMaterialTexture from UIImage (iOS)

Posted: Thu Jul 30, 2015 4:33 pm
by mokka
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

Re: Irrlicht setMaterialTexture from UIImage (iOS)

Posted: Fri Jul 31, 2015 12:48 am
by mongoose7
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.

Re: Irrlicht setMaterialTexture from UIImage (iOS)

Posted: Fri Jul 31, 2015 2:24 am
by chronologicaldot
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.