render to texture offscreen?

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
Post Reply
UncleBob
Posts: 106
Joined: Fri May 01, 2009 8:46 am

render to texture offscreen?

Post by UncleBob »

For something akin to a meshviewer, I want to render a preview pic of the meshes. Render to texture seems just the thing for that, but the tutorial only deals with rendering stuff present in the scene to texture. Is it somehow possible to do this offscreen, without having the meshes on the screen first? Or is it simpler to process the sceen completely and just draw a splash-screen over it so the user doesn't notice?
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: render to texture offscreen?

Post by CuteAlien »

The RenderToTexture tutorial renders the scene a second time to get it on the screen. Just don't do that and you have it only in the texture.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
UncleBob
Posts: 106
Joined: Fri May 01, 2009 8:46 am

Re: render to texture offscreen?

Post by UncleBob »

Sorry, I was inprecise. What I mean is rendering a mesh to a texture without even the mesh being visible in the scene.
hendu
Posts: 2600
Joined: Sat Dec 18, 2010 12:53 pm

Re: render to texture offscreen?

Post by hendu »

Yes, that's what RTTs do. The example just does more.
UncleBob
Posts: 106
Joined: Fri May 01, 2009 8:46 am

Re: render to texture offscreen?

Post by UncleBob »

:oops:

Only now I realise what the switch of render target really means in the tutorial... so the whole scene is effectively rendered to the texture instead of on the screen, and then another time on the screen. Somehow that passed me by completely.

Thanks a lot to both of you!
Post Reply