Jump to content
  • Advertisement
Sign in to follow this  
Bosduif

[HLSL] Vertex mapping in vs_4_0

This topic is 2860 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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.

Share this post


Link to post
Share on other sites
Advertisement
TextureObject.sampleLevel(SamplerStateObject, location, mipMapLevel);

"location" has a different type depending on whether TextureObject is a Texture2D, Texture3D etc. object.

Share this post


Link to post
Share on other sites
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 :(

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!