Strange Artifacts when RTT

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
Proxx
Posts: 6
Joined: Sat Mar 02, 2013 3:57 pm

Strange Artifacts when RTT

Post by Proxx »

Hello,

I want to add some post processing effects like bloom etc to my rendering. For this, I need to first render my scene to a texture, apply the effects and then render it to a quad that is directy in front of the camera.
This is already basically working fine, but I ran into a problem I cant solve. Here is a screenshot to show my problem:

Image

The first image is rendere well. But on the second image you can see some black lines on the walls. That is, because my walls consists of several pieces. When I move the camera back, these lines even get bigger. I dont want these artifacts.

The first image shows my scene rendered by a simple call to the scene managers DrawAll() method:

Code: Select all

 
    this.driver.SetRenderTarget(null, true, true, this.clearColor);
    this.SceneManager.DrawAll();
 
The second image is my scene first rendered to a texture and then used by a rendered quad:

Code: Select all

 
    this.driver.SetRenderTarget(myTexture, true, true, this.clearColor);
    this.SceneManager.DrawAll();
 
    this.driver.SetRenderTarget(null, true, true, new Color(0x0));
    this.screenQuad.Material.SetTexture(0, myTexture);
    this.screenQuad.Render(this.driver);
 
Does anybody have an idea what i could have done wrong?

//EDIT: updated a better fitting image
Mel
Competition winner
Posts: 2292
Joined: Wed May 07, 2008 11:40 am
Location: Granada, Spain

Re: Strange Artifacts when RTT

Post by Mel »

The most probable reason for that is that your model isn't well built, or exported. or... Weld the vertices and make sure there aren't any triangles in the middle.

What file format do you use to export and what video driver are you using?
"There is nothing truly useless, it always serves as a bad example". Arthur A. Schmitt
dorrax
Posts: 9
Joined: Tue Mar 26, 2013 1:14 am

Re: Strange Artifacts when RTT

Post by dorrax »

I don't think you need to draw your texture on a quad, I've been rendering to texture then using the draw2Dimage() function to draw to the screen. Works pretty well so far, not sure if it has any advantages or disadvantages over drawing on a quad.
hendu
Posts: 2600
Joined: Sat Dec 18, 2010 12:53 pm

Re: Strange Artifacts when RTT

Post by hendu »

The quad is automatically fullscreen (no matter the source texture size), and allows you to use shaders on the image. For draw2dimage you need to give the screen dimensions, and can't easily use shaders.
Post Reply