Sign in to follow this  
King_DuckZ

Vertex shader and local array

Recommended Posts

King_DuckZ    128
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
King_DuckZ    128
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   
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this