Sign in to follow this  
Endemoniada

Strange MRT Problem

Recommended Posts

Hi guys,

 

I can't figure out why this is happening:

IDirect3DSurface9* temp_surface;

// the following two textures are half screen size

color_texture->GetSurfaceLevel(0,&temp_surface);
d3d_device->SetRenderTarget(0,temp_surface);
releaseInterface(temp_surface);

depth_texture->GetSurfaceLevel(0,&temp_surface);
d3d_device->SetRenderTarget(1,temp_surface);
releaseInterface(temp_surface);

// don't even do anything with the two textures above

// the following screen_texture is twice the size of the two textures above

screen_texture->GetSurfaceLevel(0,&temp_surface);
d3d_device->SetRenderTarget(0,temp_surface);
releaseInterface(temp_surface);

// just clear it

d3d_device->Clear(0,NULL,D3DCLEAR_TARGET|D3DCLEAR_ZBUFFER,D3DCOLOR_XRGB(0,32,128),1.0f,0);

That will work perfectly fine if all three textures are the same size. It also works if I comment out the three lines where I set the depth texture. It won't work as is, I just get a black screen.

 

It was working great until I cut some texture sizes in half to speed up processing, that's why I think everything is set up right.

 

Thanks.

Edited by Endemoniada

Share this post


Link to post
Share on other sites

Hey guys,

 

The two MRTs are the same size.

 

After using them all I had to do was this:

 

d3d_device->SetRenderTarget(1,NULL);

 

***

 

Unbird, can I get those D3D debug messages in VS's output window when I compile just like regular errors/warnings ? If I can I have to set that up.

 

Thanks.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this