vs 5_0 texture sampling

Started by
2 comments, last by ekba89 9 years, 11 months ago

I have a height map in my vertex shader that I use to move the vertex to right height. I use r32g32b32 texture. But when I create graphics device with debug flag I get the error below. Even though it shows me error everything works fine I mean I get the right height for the terrain. So do I need to change the format of my texture or is there a way to sample r32g32b32 textures on vertex shader?


D3D11 ERROR: ID3D11DeviceContext::DrawIndexed: The Shader Resource View in slot 1 of the Vertex Shader unit is using the Format (R32G32B32_FLOAT). This format does not support 'Sample', 'SampleLevel', 'SampleBias' or 'SampleGrad', at least one of which may being used on the Resource by the shader. The exception is if the corresponding Sampler object is configured for point filtering (in which case this error can be ignored). This also only applies if the shader actually uses the view (e.g. it is not skipped due to shader code branching). [ EXECUTION ERROR #371: DEVICE_DRAW_RESOURCE_FORMAT_SAMPLE_UNSUPPORTED]
Advertisement

This is calling itself an error but my reading of it is that it really should be just a warning. Let's look at the message itself:

This format does not support 'Sample', 'SampleLevel', 'SampleBias' or 'SampleGrad', at least one of which may being used on the Resource by the shader. The exception is if the corresponding Sampler object is configured for point filtering (in which case this error can be ignored).

So, if you're using Load you're OK. If you're using point sampling you're also OK. I assume that with height mapping either or both are true (although filtering modes don't make sense with Load); in that case you can quite safely ignore it.

If it really bothers you, you could switch to using DXGI_FORMAT_R32G32B32A32_FLOAT which should suppress the message. You may even be able to stash some extra needed data into that free alpha channel.

Direct3D has need of instancing, but we do not. We have plenty of glVertexAttrib calls.

Thanks for the answer. Yeah I need linear filtering so I will try changing my texture to r32g32b32a32.

Yeah that fixed my problem thanks for the help.

This topic is closed to new replies.

Advertisement