> About those shaders. Have you actually tried to use the switching
> mechanism? Since I gues switching in shaders won't make it much
> faster(rather slower).
Oh, you mean if-statements and similar inside vertex and fragment shaders
? The performance depends _very much_ on the hardware.

But that is not necessary in your case - you could just have _different_
shaders prepared, and switch _the whole shader_ depending on the material
you want to render.
Yeah, that's what I meant, switching to a new fragment/vertex shader. Replacing the two shaders with two different multiple times per model can't be good for the framerate.
But i've not actually tested it, so i'm not sure.

> And another problem, how do I need to set those
> uniform variables for a whole model, using VBO's? I gues that's not
> possible, so I would almost need to make a VBO per mesh(or use that
> instancing).
No, uniform variables are set as attributes to the current shader, see
e.g.
http://developer.3dlabs.com/documents/GLmanpages/glUniform.htm
Yes, I knew that. But what I was trying to say was:
If I have my vertex, normal and texture coordinates stored in vertex buffer objects, how can I make sure that the right values are sent to the shaders, at the right time(because different parts of the model needs different material properties)?

> Since i'm trying to make a game, I gues I don't have a real need for
> specular and diffuse color.  I gues just goodlooking textures would be
> fine. But if you still have some ideas, please let me know.
a _game_ ? Well, on the contrary: then I guess shaders would improve the
game's looks a _lot_ :-)
I hope so :-p

Hylke

--
T----------------------------W-E-L-C-O-M-E------------------------------T
O  The Austria <=> Sweden <=> Germany <=> Netherlands connection.....   H
|  http://www.mpi-sb.mpg.de/~gziegler | http://www.lysator.liu.se/~gz   E
\-----------------------------F-U-T-U-R-E-------------------------------/


-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid0709&bid&3057&dat1642
_______________________________________________
lib3ds-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/lib3ds-devel




-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
lib3ds-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/lib3ds-devel

Reply via email to