Render to Texture and Clamp/Wrap (Solved - Hardware Issue)

Started by
7 comments, last by rkshelton21 14 years, 11 months ago
I am trying to render a repeated texture that I draw to. If I use D3DXCreateTextureFromFile it works fine. (no render to texture) But when I use D3DXCreateTextureFromFileEx, and specify it as a render target, the texture no longer wraps. All my other textures wrap correctly but this one gets clamped. Is there something I am missing? [Edited by - rkshelton21 on May 5, 2009 11:23:42 AM]
Advertisement
The texture addressing mode is specified in your sampler description - it doesn't have anything to do with the creation of a texture/render target. Take a look at your sampler state and make sure you are setting the address modes appropriately like so (this syntax is from an effect file, but you can also do this programmatically):

AddressU = Wrap;
AddressV = Wrap;

Hope that helps.
Yeah, I already have.

SetSamplerState( 0, D3DSAMP_ADDRESSU, D3DTADDRESS_WRAP );
SetSamplerState( 0, D3DSAMP_ADDRESSV, D3DTADDRESS_WRAP );

And the wrapping works just fine as long as I don't set the texture as a render target. But as soon as I do, that particular texture gets clamped instead of wrapped.
Are you getting any messages from the D3D debug output? Perhaps you are binding the texture while it is still set as a render target?
Quote:Original post by Jason Z
Are you getting any messages from the D3D debug output? Perhaps you are binding the texture while it is still set as a render target?


Nope, the output is fine. The texture even appears correctly with w/e I draw on it. Except that instead of repeating it is clamped after the first 0-1 tex coords.
Try to render the scene with the reference rasterizer to see if you have a driver bug or if you are doing something that isn't allowed. If it works with the reference rasterizer, it would probably be a driver implementation issue. If not, then for some reason you aren't supposed to be able to do a wrap interpolation mode.
Ok, using the ref rasterizer it works. Obviously really slow :) But, how do I find out what the device is lacking to perform this operation?

Also, thanks Jason!
What kind of hardware are you running on? If a laptop, then often there is not much luck in getting updated drivers. I have had similar issues that could only be corrected when Dell updated my driver to the latest level of Nvidia reference drivers.

Unfortunately, this problem is out of your hands... You could always try to report the issue. Perhaps the vendor has some work arounds that you could use. Good luck!
The one I was running it on was just a Radeon X1300 I ran it on another machine and it works just fine. Updated the drivers for the X1300 but still a bust.

Oh well, I'll just run it on the other machine. Any work around probably isn't worth the time for me to implement it.

This topic is closed to new replies.

Advertisement