[HLSL] Vertex mapping in vs_4_0

Started by
2 comments, last by Bosduif 13 years, 8 months ago
Hi,

In shader model 3.0 you could sample textures in the vertex shader with tex2dlod() instead of the usual tex2d in the pixel shader.
But in shader model 4 textures are objects that call it's sample method like texture.sample( sampler, UV.xy )
So I was wondering, what is the equivalent of this in shader model 4? I really need to sample a texture in my geometry shader.

Thanks in advance.
Advertisement
TextureObject.sampleLevel(SamplerStateObject, location, mipMapLevel);

"location" has a different type depending on whether TextureObject is a Texture2D, Texture3D etc. object.
http://msdn.microsoft.com/en-us/library/bb205146%28VS.85%29.aspx says:

"The geometry shader can perform load and texture sampling operations where screen-space derivatives are not required (samplelevel, samplecmplevelzero, samplegrad)."


Edit: Too slow :(
Thank you both,
strangely enough I didn't find that article before

This topic is closed to new replies.

Advertisement