Jump to content


dx11 and texture projection...


2 replies to this topic

#1 David Gallagher

    New Member

  • Members
  • PipPip
  • 69 posts

Posted 14 January 2012 - 10:48 PM

I'm in the process of moving from dx9 to 11 and in my old shaders i was able to use tex2dproj to project a texture to a mesh. Does anyone know how this is now done in shader model 5? thanks for any hints in the right direction to go.

#2 Reedbeta

    DevMaster Staff

  • Administrators
  • 5344 posts
  • LocationSanta Clara, CA

Posted 14 January 2012 - 11:40 PM

I don't believe there is a specific function for projective texture lookup now. Instead, you must do the divide by w yourself and then do a regular sample.

// DX9
tex2Dproj(sampler, uvw);

// DX10/11
float2 uv = uvw.xy / uvw.w;
texture.Sample(sampler, uv);

reedbeta.com - developer blog, OpenGL demos, and other projects

#3 David Gallagher

    New Member

  • Members
  • PipPip
  • 69 posts

Posted 15 January 2012 - 12:32 AM

That worked a treat! now I understand, I really appreciate the help with this, thank you!





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users