Skip to main content
gamedev.net
🔒 Locked

joining vertex programs?

Started by Madster 4 replies 550+ views
Original Post
Madster
Madster
I have several vertex programs in separate files, handling light, fog, secondary color and per-vertex deform. I have tried putting them in the same vertex program, but i go over the amount of temp variables my card supports. how can I apply several vertex programs to a surface in a single pass, and have the results accumulate?
Working on a fully self-funded project
_DarkWIng_
_DarkWIng_
Quote:
Original post by Madster
how can I apply several vertex programs to a surface in a single pass, and have the results accumulate?

You can't. Only one VP can be enabled at any time. You'll either have to write VPs that handle all things (combine them by hand) or write some parser that puts them together (dynamic creation).
You should never let your fears become the boundaries of your dreams.
benjamin bunny
benjamin bunny
The OpenGL Shading Language (GLSL) supposedly allows shaders to be linked together, although I haven't tried it out personally. [edit: I've tried the GLSL, just not linking multiple vertex/pixel shaders together]

[Edited by - benjamin bunny on June 28, 2004 8:31:33 AM]
Nemesis2k2
Nemesis2k2
Personally, I think it's better just to make two passes, one for lighting, and the other one for textures and other effects.
vincoof
vincoof
DarkWIng and benjamin hit the point : you can't do it easily in the vertex program level. You are asking a feature of a high-level programming language, thus you should use Cg or GLSL that will handle all temporaries/registers/etc for you. So you either have to rewrite the program string yourself, or switch to a higher level of shader programming.

Nemesis : multipass should only be used as a last resort since it has the (annoying) ability to "eat" the *unique* blending stage (which is still limited today).
Madster
Madster
thanks everyone.

Seems we'll be skipping rather quickly to GLSL
(and pray that all compiler bugs are gone by 2.0)
Working on a fully self-funded project

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.