How to use SampleGrad in Unity shader

The code in hlsl but I can’t use it.

Unity says “sampler2D object does not have methods”

Here are the detail about Object.SampleGrad SampleGrad (DirectX HLSL Texture Object) - Win32 apps | Microsoft Learn

The article that related to A Closer Look At Parallax Occlusion Mapping - Graphics and GPU Programming - Tutorials - GameDev.net

Unity is DX9 HLSL based. The equivalent function is tex2Dgrad(), though in Unity you can also use the CG style tex2D() which has an override that works exactly the same as tex2Dgrad().

Thank you, you are a live saver :smile: