Irrlicht setMaterialTexture from UIImage (iOS)

Post those lines of code you feel like sharing or find what you require for your project here; or simply use them as tutorials.
Post Reply
mokka
Posts: 2
Joined: Fri Jul 24, 2015 9:35 am

Irrlicht setMaterialTexture from UIImage (iOS)

Post 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
mongoose7
Posts: 1227
Joined: Wed Apr 06, 2011 12:13 pm

Re: Irrlicht setMaterialTexture from UIImage (iOS)

Post 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.
chronologicaldot
Competition winner
Posts: 684
Joined: Mon Sep 10, 2012 8:51 am

Re: Irrlicht setMaterialTexture from UIImage (iOS)

Post 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.
Post Reply