need help in multitexturing using opengl shading language (solved)

Started by
18 comments, last by _the_phantom_ 19 years, 3 months ago
Oh! So, if I declare 4 float attribute, it means 4x4 float in fact?
Advertisement
Quote:Original post by Ademan555
hrm, thats what i thought, so how would you set the attributes then for his shader? because wouldnt attribute0 be position? and such? so youd have to know which attribute his floats were being assigned to.


You ask OGL where a certain attribute is via the GLSL C API, I'm pretty sure that you can also tell OGL what attribute to put into what position pre-linking.

So, in this case you'd ask where "texturesin1" is and then assign a value to that location
Quote:Original post by fazekaim
GL_MAX_VERTEX_ATTRIBS_ARB:32
I excedeed the 32 attributes? How?


What vertex streams do you have active?
As you've used 9 that I can see (the 4 texturesin, the 4 texture coords and the gl_Vertex) just from that shader, however given that you've got 32 I'd be impressed if you've run out, it might be a driver bug, in which case contacting someone at ATI might be a plan...
Well, seeing those kindw of numbers for a 9600 makes me want to migrate to glsl :-D, sooo..... i gotta ask, this is the extension for glsl functionality right? http://oss.sgi.com/projects/ogl-sample/registry/ARB/shader_objects.txt

edit: UGH, so many new functions... is there a way to create a static lib for an existing dll? its about time someone made a lib for it and made glext into a bunch of import functions (wrong term probably) ie: extern "C" { FUNCS };

thanks
-Dan

[Edited by - Ademan555 on January 1, 2005 6:07:45 PM]
When General Patton died after World War 2 he went to the gates of Heaven to talk to St. Peter. The first thing he asked is if there were any Marines in heaven. St. Peter told him no, Marines are too rowdy for heaven. He then asked why Patton wanted to know. Patton told him he was sick of the Marines overshadowing the Army because they did more with less and were all hard-core sons of bitches. St. Peter reassured him there were no Marines so Patton went into Heaven. As he was checking out his new home he rounded a corner and saw someone in Marine Dress Blues. He ran back to St. Peter and yelled "You lied to me! There are Marines in heaven!" St. Peter said "Who him? That's just God. He wishes he were a Marine."
Quote:What vertex streams do you have active?
As you've used 9 that I can see (the 4 texturesin, the 4 texture coords and the gl_Vertex) just from that shader, however given that you've got 32 I'd be impressed if you've run out, it might be a driver bug, in which case contacting someone at ATI might be a plan...


im not 100% sure but if its anythjing like varying its the number of components that counts
eg 1 texture coord prolly counts as 4
(this caught me out before with varying stuff)
Quote:Original post by Ademan555
edit: UGH, so many new functions... is there a way to create a static lib for an existing dll? its about time someone made a lib for it and made glext into a bunch of import functions (wrong term probably) ie: extern "C" { FUNCS };


Thats what stuff like GLee is for, check the forum FAQ.
Quote:Original post by zedzeek
im not 100% sure but if its anythjing like varying its the number of components that counts
eg 1 texture coord prolly counts as 4
(this caught me out before with varying stuff)


I did consider that, but given how the Orange book shows things lineing up that doesnt make sense, as it has gl_Vertex as one attribute for example, which is 4 floats.

However, given his problems and your point about varying it could well be the issue as 9*4 gives 36floats used up, above the limit which would explain the error
It's working! I used vec4 attribute with vbo.

Thanks, guys.
>>I did consider that, but given how the Orange book shows things lineing up that doesnt make sense, as it has gl_Vertex as one attribute for example, which is 4 floats.<<

i looked at the gl spec last night, and im now pretty sure u were correct, ie the size of each attribute is not important (unlike the varying variables) also it states an app must support at least 16attributes
didnt think i was going crazy [wink]
Which doesnt explain why it doesnt work as he's only use up 9 attributes o.O
Maybe I'll remember to ask ATI devrel about it at some point...

This topic is closed to new replies.

Advertisement