How to define a custom texture sampler inside the custom material node

I am having some issues with my custom HLSL code and one thing I want to control is the sampling properties.

I am using the function Texture2DSample(Tex, TexSampler, UV); and I want to replace the TexSampler with my custom texture sampler.

How can I do this?

Thank you for your help.

Have you ever found a way to do this?

Sadly, no.

This works for me

return=Tex.SampleGrad(TexSampler,UVs,ddx(UVs),ddy(UVs));

output type cmot float3 or cmot float4 if texture has alpha
Tex is texture object input
UVs is UV input

2 Likes

Worked perfectly for me, thanks!