• Advertisement
Sign in to follow this  

Vertex shader and local array

This topic is 4716 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

Hello. I have an array of texture coordinates I need to read from a vertex shader I'm working on. Is it possible to pass just a pointer to the first element of this array, or do I have to copy the whole array in constant registers? I'm not even sure if it fits, so I hope there's a better solution than copying. I hope I was clear, lately I don't seem able to explain what I want :p

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
Just add it to your Vertex structure.

Share this post


Link to post
Share on other sites
Add the pointer as a DWORD value in my FVF? That's a good idea... Sorry if I ask you more, but I'm new to shaders. How should I redefine the FVF constant? It actually is XYZ|DIFFUSE|TEX1.
And later in the shader, how can I read from that memory? Is this what the address register is made for?

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
I assume the data you want to access is per vertex info, if so you just add it as a TEXCOORD to the FVF, so if you already have some texture info you have a FVF member which is a TEXCOORD0, so just add another of whatever type you want and treat it as TEXCOORD1, and if you have more then add more as you need.

Share this post


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

  • Advertisement