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.

Irrlicht setMaterialTexture from UIImage (iOS)

Postby mokka » Thu Jul 30, 2015 4:33 pm

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! :)

Posts: 2
Joined: Fri Jul 24, 2015 9:35 am

Re: Irrlicht setMaterialTexture from UIImage (iOS)

Postby mongoose7 » Fri Jul 31, 2015 12:48 am

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

Re: Irrlicht setMaterialTexture from UIImage (iOS)

Postby chronologicaldot » Fri Jul 31, 2015 2:24 am

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.
User avatar
Competition winner
Posts: 556
Joined: Mon Sep 10, 2012 8:51 am

Return to Code Snippets

Who is online

Users browsing this forum: No registered users and 1 guest