Page 1 of 1

alphatest-based building

Posted: 04 Aug 2006, 13:58
by KDR_11k
A simple idea: Instead of using the normal wireframe building graphic, let modders choose to have it use alphatest instead. That'd work as follows:

During construction, the model is drawn normally instead of wireframed or anything like that, however it is done while setting glAlphaFunc to GL_GEQUAL and the completion percentage of the build job. The source alpha channel could be one channel from the second texture assigned to s3os.

Purpose: This would allow a modder to define exactly how a unit is built. A vertical gradient across the unit would mean a simple buildup as it's today, other variations would e.g. building the torso of a unit first and having the limbs grow from it, a building appearing bit by bit (by having each bit have a single alpha value) or an infection spreading across the land. This could also be applied to ground decals so they don't just pop into existence.

Posted: 04 Aug 2006, 15:07
by jcnossen
Cool idea, but it needs to come after an abstraction of the unit drawing system, it's too messy already.
Very nice though, never thought about it myself that way.

Posted: 04 Aug 2006, 23:17
by FizWizz
Wow, awesome concept!

Posted: 05 Aug 2006, 02:46
by SinbadEV
I was thinking of giving the scriptor/or model degfinition some "while building" code would give this type of effect... but this implimentation would give a quick and dirty but functional implimentation... hurray for divergent mental processes.

Posted: 05 Aug 2006, 07:37
by KDR_11k
You could use the Create() function of the BOS for scripted building as long as the wireframes are disabled (which IIRC is a feature in the next version of Spring).

In combination with this you could have a construction scaffold build up before the actual building appears and have the scaffold disappear bit by bit when the building nears completion. Would probably work well for realism mods.

Posted: 05 Aug 2006, 11:23
by Cabbage
an infection spreading across the land.
I love it!

Posted: 09 Aug 2006, 08:41
by FireCrack
Ver good idea, as jc said we probably need cleanup first though.

Posted: 09 Aug 2006, 14:15
by rattle
Cabbage wrote:
an infection spreading across the land.
I love it!
Time to unleash the rabbits of doom on that cabbage infestation.


But nice idea, really. Would be cool if the build up could use a scripted animation too, like an animated crane which only appears during construction and then disappears back into the ground and hides.

Posted: 09 Aug 2006, 15:34
by AF
They already can despite someone (is it you) continuosly sayign it's impossible.

The onyl reason building startups havent been scritped in any units yet is because the nanoframe makes it look stupid. However i myself added an fbi tag that turns off the nanoframe in the next version so it's once again feasable. Nanospray can be turned off now too.

Posted: 09 Aug 2006, 16:39
by jcnossen
It needs cleanup, and actually I don't want you to add new tags that I have to support again when I clean it up.

Posted: 09 Aug 2006, 17:18
by rattle
No I'm not saying it's impossible, but I haven't done any animation scripting yet thus I didn't know that. Well I guess I do now. :oops: