No overload for tex3Dlod takes 2 parameters....?

Hi all,

I am trying to do a vtf on a cube map, and I am getting a syntax error on this in my vertex shader:-

float h = tex3Dlod(heightMapSampler, t).r;

“No overload for tex3Dlod takes 2 parameters”

It’s a Window DX project and I have gont to SM 5, anyone know why It’s doing this, really would like ti use it for some mesh displacement :slight_smile:


Is heightMapSampler maybe defined as sampler2D? It should be sampler3D or sampler.
And then there is always the more modern alternative:
texture.SampleLevel(sampler, float3(1,1,1), 1);

1 Like

No, defo a sampler3D, in the pixel shader I am sailing it to render the map on the mesh for now.

I only get this error with a sampler2D, with a sampler3D it works fine. No idea what could be different in your case.

1 Like

I’ll dump the whole shader here, its a simple beast.

2 ticks

As ever @markus, you are a star, while I was not using sampler2D, I was using samplerCUBE, which I thought was OK, but changed it to sampler3D and now I don’t get the error :slight_smile:

Changes my VTF to texCUBElod, and it runs :smiley:

Silly me :stuck_out_tongue:

Displacement working now, thank you :smiley:

1 Like