Rendering: Clamp texture object on custom node

Hi everyone, I’m trying to sample a texture object parameter into a custom node in order to manipulate the UV. But im struggling to change its sample state to clamp, it seems that the default value it wrapped mode. I want to modify the UV to move and scale the texture, avoiding the texture repetition. Is there a way to set the sample state via hlsl? I have attached some images to make it more clear.

image

image

Here you can see I move the circle to the right, but because wrapped mode, other circle is appearing from the left, I only want one circle on the texture.

Thank you.

I was also having the same issue so here is the answer i found on the internet

replace “GoboTextureSampler” with “View.MaterialTextureBilinearClampedSampler”

hope it helps

1 Like

Hi RIn-chan!

It works like a charm! thank you for the answer, I will mark it as solved.

Kind regards,

Alejandro.

Hi! Can you show what you have in .ush code, please?
I really need this item!

Hi mihas49!

this is the code:

image
and this is the custom node and the output

1 Like

Thank you so much! It is working!
It is also a good example for learning hlsl interactions!

1 Like