Sign in to follow this  

VertexAttribute with mat3

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

THere doesn't exist a function like you want, unfortunantely. You will have to set it as 3 column (or row, have to test) vectors with 3 VertexAttrib3fv calls.

/edit: the attribute indices have to be consecutive, and you can refer to it with the attrib index for the first vec3 of the 3 that make up the mat3

To make it a tad clearer, say you have in your vertex shader: attribute mat3 my_mat. In your program, you get the location of my_mat with glGetAttribLocation -> GLuint loc, and then set the mat3 as 3 vectors, with indices loc, loc+1, loc+2.

[Edited by - deavik on March 5, 2006 9:16:50 PM]

Share this post


Link to post
Share on other sites
ok thanks but why did the ARB decide this way?

looks like this is not possible on apple drivers - bug

[Edited by - Eitsch on March 6, 2006 11:53:12 AM]

Share this post


Link to post
Share on other sites
Quote:
Original post by Eitsch
ok thanks but why did the ARB decide this way?

I'm not sure but I think it's because they don't encourage you to pass a large data structure like a matrix down the pipeline per vertex.
Quote:
looks like this is not possible on apple drivers - bug

I wouldn't jump to conclusions, there might be a mistake in my explanation as well ... what are the problems you are having?

Share this post


Link to post
Share on other sites
if i pass any data in the way you have described it i get this image:




without the glVertexAttrib calls it looks like this:




but i don't use this attribute in the shader.

[Edited by - Eitsch on March 7, 2006 1:29:38 PM]

Share this post


Link to post
Share on other sites
I don't know this is probably my bad ... if you don't need the mat attrib forget it. But if you do, post some of the code you use to set te attrib from the API. Also, check the attrib locations for a) the mat3 and b) the next attrib which you are using in your vertex shader (because that is the one that looks like it is getting overwritten) and let me know.

Share this post


Link to post
Share on other sites

This topic is 4304 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.

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