• Advertisement
Sign in to follow this  

Linearfilter, ugly wrapping...

This topic is 4741 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Ok, while trying the different filters I saw that it wraps the edges around when using linear or anisotropic. (What's on the left gets a eeny tiny corner to the right etc)... How do I get past this? Adding and subtracting "0.5/width" (or height) works, but that won't work in all cases (as when NOT at the corner)... I've read something a while back on what should happen with texture coordinates outside 0 and 1, wrapping, border, etc... or perhaps I'm just mistaken with the texture load-flags. ... While on this, when trying lightmaps I found something fun... when I set the filter to linear for sampler 0 (texture) and 1 (lightmap), it worked great... but when I used point-filter for sampler 0... the lightmap gets drawn strange, when looking in a close up, horizontally it looks as it should... but horizontally it doesn't... it's "shading" each pixel (from darker to brighter), like a gradient. This is just side question, would likely never run this way but it's good to know what's wrong... if I'm doing right... the sampler state is for each texture? Thanks in advance Syranide

Share this post


Link to post
Share on other sites
Advertisement
For your first question, I believe you need to use Texture Clamping. I would provide more information, but I haven't yet got onto this... sorry :(

Share this post


Link to post
Share on other sites
Thank you, thank you, searched on texture clamping and found my way into SamplerState (as I thought I already searched through)... there I found texture addressing...

device->SetSamplerState( 0, D3DSAMP_ADDRESSU, D3DTADDRESS_CLAMP );
device->SetSamplerState( 0, D3DSAMP_ADDRESSV, D3DTADDRESS_CLAMP );

There it is, no more irritating corner-wrapping :D
Thanks again!

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement