Render To Texture Problem

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!

Render To Texture Problem

Postby Brainsaw » Sun Oct 23, 2011 10:33 am

Hi,

I've got a problem when rendering to a texture. I render some UI stuff to a texture in order to get a nice cockpit for my cars/planes/helicopters, but for some reason unknown to me it messes up the "normal" UI. This happens under 32Bit Windows, the program is compiled with MinGW and running with OpenGL. Here are some screenshots:

First off: this is how it should look, RTT is disabled
Image

Next up: the error. RTT enabled:
Image

I also uploaded the test project:
[url]bulletbyte.de/rtt/RenderToTarget_problem.zip[/url]
The "main" function has a flag "bUseRenderToTarget" to toggle the render to target stuff. If this flag is set to "false" the error does not appear.

The problem disappears when I skip the replacement of the texture. It works like this:

- load the scene
- iterate all scenenodes
- check all textures
- replace the "dummy" textures specified in the RTT class construction by the render target

It works if I outcommet this line:
cpp Code: Select all
m_pTarget=m_pDrv->addRenderTargetTexture(cSize,"cockpit",video::ECF_A8R8G8B8);

(IRenderToTexture.h:55)

The console shows an "Unsupported texture format" warning, but the texture appears as it should.

Does anyone have an idea what this could be?
User avatar
Brainsaw
 
Posts: 1038
Joined: Wed Jan 07, 2004 12:57 pm
Location: Bavaria

Re: Render To Texture Problem

Postby hybrid » Sun Oct 23, 2011 10:37 am

This should be fixed in SVN. I don't remember exactly what the problem was, but I fixed a very similar situation a few month back.
hybrid
Admin
 
Posts: 13947
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany

Re: Render To Texture Problem

Postby Brainsaw » Mon Oct 24, 2011 5:55 am

OK, then I'll update to SVN instead of using the release version.
User avatar
Brainsaw
 
Posts: 1038
Joined: Wed Jan 07, 2004 12:57 pm
Location: Bavaria

Re: Render To Texture Problem

Postby Brainsaw » Thu Mar 01, 2012 7:56 am

This fix didn't make it into 1.7.3, did it? At least I still get the errors, should I finally update to 1.8 trunk for a fix?
User avatar
Brainsaw
 
Posts: 1038
Joined: Wed Jan 07, 2004 12:57 pm
Location: Bavaria

Re: Render To Texture Problem

Postby hybrid » Fri Mar 02, 2012 12:11 pm

Probably not in 1.7.x as it changed several things in RTT handling, and I always try reducing such larger bug fixes in the stable branches.
hybrid
Admin
 
Posts: 13947
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany

Re: Render To Texture Problem

Postby Brainsaw » Mon Mar 05, 2012 9:30 am

It's no big issue. I'll have to do some more research the next days, maybe the problem is caused when rendering a 3d scene to a texture (and I do a lot of GUI RTT at the moment).
User avatar
Brainsaw
 
Posts: 1038
Joined: Wed Jan 07, 2004 12:57 pm
Location: Bavaria


Return to Advanced Help

Who is online

Users browsing this forum: No registered users and 1 guest