[SOLVED] Addressing is misbehaving for volume textures [DX9]
Just in case anybody experience the same problem as me and stumble on this thread, I put out the solution.
The solution was rather simple and it was related to addressing in a kind of way. The problem was that D3DXCreateVolumeTextureFromFile filtered the source data in an incorrect way (at least from my point of view). So I just changed to D3DXCreateVolumeTextureFromFileEx and specified the D3DX_FILTER_POINT method explicitly. In photoshop the texture looked alright, which fooled me to suspect the hardware addressing.
When I loaded the texture with D3DXCreateTextureFromFile the filters worked as I expected (no overlapping on the perimeter). I don't know, maybe the D3DXCreateVolumeTextureFromFile function works as it should, or maybe it's a bug?
Hi
I'm storing skydome data in a volume texture. The data got accessed with float3(zenith angle, azimuth angle, time of day).
The problem I'm facing is that no matter what addressing and filter mode I use the texture is always bleeding into the opposite side on the perimeter (back, front, right, left). See the image below.
In order to make the example more clear I have used point sampling but the artefact is present in linear sampling as well. As you can see the stripe in the middle got colour values blended between right and left edge of the texture, peculiar in my opinion especially since point sampling is used and no blending should occur. This is the setup of the sampler:
Have anybody experienced this before? Does anybody know where this problem come from?
Thanks
Just in case anybody experience the same problem as me and stumble on this thread, I put out the solution.
The solution was rather simple and it was related to addressing in a kind of way. The problem was that D3DXCreateVolumeTextureFromFile filtered the source data in an incorrect way (at least from my point of view). So I just changed to D3DXCreateVolumeTextureFromFileEx and specified the D3DX_FILTER_POINT method explicitly. In photoshop the texture looked alright, which fooled me to suspect the hardware addressing.
When I loaded the texture with D3DXCreateTextureFromFile the filters worked as I expected (no overlapping on the perimeter). I don't know, maybe the D3DXCreateVolumeTextureFromFile function works as it should, or maybe it's a bug?
Hi
I'm storing skydome data in a volume texture. The data got accessed with float3(zenith angle, azimuth angle, time of day).
The problem I'm facing is that no matter what addressing and filter mode I use the texture is always bleeding into the opposite side on the perimeter (back, front, right, left). See the image below.
In order to make the example more clear I have used point sampling but the artefact is present in linear sampling as well. As you can see the stripe in the middle got colour values blended between right and left edge of the texture, peculiar in my opinion especially since point sampling is used and no blending should occur. This is the setup of the sampler:
sampler sampSkydomeLookup =
sampler_state
{
Texture = <texSkydomeLookup>;
MinFilter = POINT;
MagFilter = POINT;
MipFilter = NONE;
AddressU = MIRROR;
AddressV = CLAMP;
AddressW = CLAMP;
};
I have tried different variants but no luck. When I change the texture to regular 2D the problem goes away. I can't see any problems with the coordinates eighter. I have tried the code on both nVidia and ATI machines and both displayed the error.sampler_state
{
Texture = <texSkydomeLookup>;
MinFilter = POINT;
MagFilter = POINT;
MipFilter = NONE;
AddressU = MIRROR;
AddressV = CLAMP;
AddressW = CLAMP;
};
Have anybody experienced this before? Does anybody know where this problem come from?
Thanks
Last edited by a moderator: