Jump to content
  • Advertisement
Sign in to follow this  
JExoskeleton

using Vertex Texture Fetches in HLSL

This topic is 4747 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 all, Im currently trying to implement Vertex texture fetches in HLSL, but realised that the current HLSL doesnt support it, is there a workaround to this other than writing the shader in asm? I read up on Shader Fragments and am still not sure of how to link asm with HLSL. Any kind of advice/help will do. Thanks in Advance ~JExoskeleton

Share this post


Link to post
Share on other sites
Advertisement
Are you sure it is not supported? Have you tried using text2D() or tex2Dlod() in VS?
Anyway, you could try to ask microsoft directly (directx@microsoft.com), as this looks like serious bug...

Share this post


Link to post
Share on other sites
Quote:
Original post by JExoskeleton
Hi all,

Im currently trying to implement Vertex texture fetches in HLSL, but realised that the current HLSL doesnt support it, is there a workaround to this other than writing the shader in asm?
I read up on Shader Fragments and am still not sure of how to link asm with HLSL. Any kind of advice/help will do.

Thanks in Advance
~JExoskeleton


Use tex2Dlod,example:

sampler T;

float4 main(float2 coord : TEXCOORD ) : POSITION
{
return tex2Dlod(T,float4(coord, 0, 0));
}

produces:

vs_3_0
def c0, 1, 0, 0, 0
dcl_texcoord v0
dcl_2d s0
dcl_position o0
mul r0, c0.xxyy, v0.xyxx
texldl o0, r0, s0

Share this post


Link to post
Share on other sites
Hi,

The vertex texture must be on a certain format : D3DFMT_R32F or D3DFMT_A32B32G32R32F (32 bits floating point textures)
It also must be created in the default pool.
Other than that, it's available only on recent hardware (GeForce 6xxx series, I don't know if ATI handles it) and throught sm 3.0 (EvilDecl81 gave the functions to access vertex textures in shaders)

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Hi again,

You sure it worked in VS 3.0 profile and not PS 3.0?
I was reading up on the mdsn directX page and all the texture fetch operations in HLSL doesn't support vs 3.0...
Maybe I'll try again later and see what happens.
I hope its just a mis-documentation of their API.. :)
Thanks all
~JExoskeleton

Share this post


Link to post
Share on other sites
Quote:
Original post by Anonymous Poster
Hi again,

You sure it worked in VS 3.0 profile and not PS 3.0?
I was reading up on the mdsn directX page and all the texture fetch operations in HLSL doesn't support vs 3.0...
Maybe I'll try again later and see what happens.
I hope its just a mis-documentation of their API.. :)
Thanks all
~JExoskeleton


Yup it works, thanks a million :)

~JExoskeleton

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!