Archive 17/01/2023.

Clamp UV of a texture unit

sabotage3d

Hi,
Is it possible to clamp UV coords of a texture unit inside a quad command?
I am trying to offset the uvs in the shader but I am getting repeat by default.

For example if I have texture unit in the diffuse slot inside a quad command.

And I want to clamp the UV coords.

[code]

[/code]

Would this work or it is not supported?

cadaver

The UV addressing mode of the texture must have been set beforehand to what you want, the renderpath commands are not going to change it.

sabotage3d

Thanks cadaver.
Do you mean something like this? And then passing this to the texture unit.

Texture2D* texture = cache->GetResource<Texture2D>(filepath); texture->SetAddressMode(COORD_U, ADDRESS_CLAMP); texture->SetAddressMode(COORD_V, ADDRESS_CLAMP);

cadaver

Yes, or using the xml definition file alongside the texture.