Wreckage Shortcut [texture overlays]
Posted: 04 Dec 2007, 13:16
Well, I'm in the middle of the process of creating the wreckages for SWS.
It really is a pretty awful job, having to make multiple-stage wreckages for every unit you have produced.
In order to speed up the process, I've worked out a means of using a number of premade 'scarred' layers, opacity and blending options to very quickly give premade textures a 'shelled out' look.
One thing I was wondering was whether it would be possible to make this process procedural-based within the Spring engine.
What this would mean would be to have textures overlayed (with a certain amount of alpha) on other textures when a certain event occured. This would work vaguely similarly to how groundscars are currently used on maps.
The result of this would allow me to make a handful of 'wreckage overlays', and then when units die, simply have the wreckage model load the original unit texture, and then overlay the specified 'wreckage overlay'. This would cut out a significant amount of workload from my end, as well as reducing the processing-hit in terms of simultaneously loaded textures (as the overlays could be reused across multiple units), as well as reducing the filesize of my mod (~5-10 texture files compared to ~100).
An offshoot advantage of something like this would be the ability to have units dynamically show battle damage as the battle wears on. So, say you produce a "battle damage overlay" texture, when a unit/structure is at say, 90% health, the battle damage texture is overlayed on the unit/building at 10% opacity. (Ideally this damage would be optionally reduced/removed during repairs by working in the opposite manner)
That way, you would have a visual cue of how damaged units are, as well as having your battle-weary armies look battle-weary. I'm sure people can think of all sorts of other visual things to do if they have the ability to dynamically change textures according to in-game actions.
Please note that yes, I have investigated the possibilities of doing this in lua, but it seems that while vaguely possible, the efficiency of doing it so would make it unfeasible, making a hard-coded option preferable.
It really is a pretty awful job, having to make multiple-stage wreckages for every unit you have produced.
In order to speed up the process, I've worked out a means of using a number of premade 'scarred' layers, opacity and blending options to very quickly give premade textures a 'shelled out' look.
One thing I was wondering was whether it would be possible to make this process procedural-based within the Spring engine.
What this would mean would be to have textures overlayed (with a certain amount of alpha) on other textures when a certain event occured. This would work vaguely similarly to how groundscars are currently used on maps.
The result of this would allow me to make a handful of 'wreckage overlays', and then when units die, simply have the wreckage model load the original unit texture, and then overlay the specified 'wreckage overlay'. This would cut out a significant amount of workload from my end, as well as reducing the processing-hit in terms of simultaneously loaded textures (as the overlays could be reused across multiple units), as well as reducing the filesize of my mod (~5-10 texture files compared to ~100).
An offshoot advantage of something like this would be the ability to have units dynamically show battle damage as the battle wears on. So, say you produce a "battle damage overlay" texture, when a unit/structure is at say, 90% health, the battle damage texture is overlayed on the unit/building at 10% opacity. (Ideally this damage would be optionally reduced/removed during repairs by working in the opposite manner)
That way, you would have a visual cue of how damaged units are, as well as having your battle-weary armies look battle-weary. I'm sure people can think of all sorts of other visual things to do if they have the ability to dynamically change textures according to in-game actions.
Please note that yes, I have investigated the possibilities of doing this in lua, but it seems that while vaguely possible, the efficiency of doing it so would make it unfeasible, making a hard-coded option preferable.