Jump to content

  • Log In with Google      Sign In   
  • Create Account

FREE SOFTWARE GIVEAWAY

We have 4 x Pro Licences (valued at $59 each) for 2d modular animation software Spriter to give away in this Thursday's GDNet Direct email newsletter.


Read more in this forum topic or make sure you're signed up (from the right-hand sidebar on the homepage) and read Thursday's newsletter to get in the running!


Strange MRT Problem


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
4 replies to this topic

#1 Endemoniada   Members   -  Reputation: 312

Like
0Likes
Like

Posted 31 December 2013 - 08:31 PM

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, 31 December 2013 - 08:34 PM.


Sponsor:

#2 Mona2000   Members   -  Reputation: 629

Like
1Likes
Like

Posted 31 December 2013 - 10:22 PM

MRTs in Direct3D9 have to be the same size.



#3 unbird   Crossbones+   -  Reputation: 6020

Like
0Likes
Like

Posted 01 January 2014 - 05:33 AM

Correct:

All surfaces of a multiple render target should have the same width and height.

 
The D3D debug layer will complain if you try:

[2688] Direct3D9: (ERROR) :Dimensions of render target 1 do not match target 0.


#4 Endemoniada   Members   -  Reputation: 312

Like
0Likes
Like

Posted 01 January 2014 - 10:18 AM

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.



#5 unbird   Crossbones+   -  Reputation: 6020

Like
0Likes
Like

Posted 01 January 2014 - 12:36 PM

Direct3D Programming Tip #5: Use The Debug Runtime




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS