possible bug found: rendering to texture

You discovered a bug in the engine, and you are sure that it is not a problem of your code? Just post it in here. Please read the bug posting guidelines first.

possible bug found: rendering to texture

Postby dehseth » Sat Nov 13, 2010 7:36 pm

hi guys,
in my application, if I use SetRenderTarget function and render scene to a custom texture I get a nice colorful visual render :) If I render it to screen directly I do not get the same render...

I figured out if I draw my texture image without using alpha channel I get this same bad render:

Code: Select all
/* same as directly rendering to back buffer */
driver->draw2DImage(texture, rect1, rect2, 0, 0, false);


If I use alpha channel of texture I got a nice render:

Code: Select all
/* different than directly rendering to back buffer */
driver->draw2DImage(texture, rect1, rect2, 0, 0, TRUE);


So how can I get the same result when rendering to backbuffer directly? thank you all....


I see no comment on this topic... So no idea ppl? :?
Last edited by dehseth on Tue Nov 16, 2010 5:46 pm, edited 1 time in total.
dehseth
 
Posts: 130
Joined: Wed Dec 09, 2009 11:05 am

Postby greenya » Mon Nov 15, 2010 10:48 am

Maybe post two screenshots with the result renderings, so we will see the differece and the meaning of "nice colorful visual render".
User avatar
greenya
 
Posts: 943
Joined: Sun Jan 21, 2007 1:46 pm
Location: Ukraine

Postby dehseth » Mon Nov 15, 2010 11:27 am

here's the render I got when I use backbuffer directly:

Image

and this is the nice texture rendering I got:

Image
dehseth
 
Posts: 130
Joined: Wed Dec 09, 2009 11:05 am

Postby dehseth » Tue Nov 16, 2010 1:27 pm

is this might be the problem:
present.BackBufferFormat = D3DFMT_X8R8G8B8

any idea?
dehseth
 
Posts: 130
Joined: Wed Dec 09, 2009 11:05 am

Postby dehseth » Tue Nov 16, 2010 4:14 pm

well everything has changed suddenly when I realized my shader takes alpha channel variable as last value... and now I have a problem with texture target.. I would like to have my texture without alpha blending...
The problem is when I set

Code: Select all
      driver->setRenderTarget(texture);


I got alpha blended render.. And When I render to backbuffer directly I do not get any alpha blending cause I set

Code: Select all
SIrrlichtCreationParameters
to
Code: Select all
false


so how can I turn off alha blending on rendering to texture target?

and this is how I render the render target texture to backbuffer:

Code: Select all
driver->draw2DImage(texture, rect, recti(vector2di(0,0), dimension), 0,0,false);
dehseth
 
Posts: 130
Joined: Wed Dec 09, 2009 11:05 am

possible bug found, please check here..

Postby dehseth » Tue Nov 16, 2010 4:57 pm

OK I think the problem is when I am rendering to texture the depth buffer is not working and if I render the closer element to cam after others everything's fine, but if I render the closer element before further elements than it overrides pixels..

But If I render the same scene using backbuffer everything is fine!
SO I guess we have a possible bug in here...
dehseth
 
Posts: 130
Joined: Wed Dec 09, 2009 11:05 am

Postby hybrid » Wed Nov 17, 2010 10:17 am

Could you please post the full code of a minimal example reproducing this problem? Also with some image I have access to, in order to check the difference here as well.
hybrid
Admin
 
Posts: 13943
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany

Postby dehseth » Wed Nov 17, 2010 2:37 pm

ok I will prepare a small app. and post source code link here when it's ready..
dehseth
 
Posts: 130
Joined: Wed Dec 09, 2009 11:05 am

Postby dehseth » Thu Nov 18, 2010 5:32 pm

FINALLY!!! I found THE BUG!

If you create your device (directx 9 device) using antialiasing

Code: Select all
SIrrlichtCreationParameters cp;   
   cp.AntiAlias = 2; // can be some other value


and use a render texture target... than device fails on computing z-buffer (it draws every single mesh to texture over and over in given order)... It does not fail on rendering to backbuffer.. If I close anti-aliasing mode, device succeeds on rendering both texture and backbuffer.

I uploaded small code here:

http://jump.fm/AEPRN

you can easily see rendering to backbuffer does not have any problem and rendering to texture has and z-buffer problem. And please remove anti-aliasing in main function and see texture rendering is fine...
dehseth
 
Posts: 130
Joined: Wed Dec 09, 2009 11:05 am

Postby hybrid » Thu Nov 18, 2010 10:08 pm

Ah yeah. That's a problem which occurs on some configurations, probably due to a wrongly chosen, unsupported render texture format. Unfortunately it never happens on my machines, so it's not fixable by me. It would help to create an example which reproduces this problem, and hope for someone to have such a configuration and can debug the dx driver.
hybrid
Admin
 
Posts: 13943
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany


Return to Bug reports

Who is online

Users browsing this forum: No registered users and 1 guest