|
-
Qwaizang:syntax_entity_
[F8] Custom Sprites: layering and lightmapping
Hi everyone,
Before I begin on a large project, I would like to ask advice regarding the plans I have for my engine.
Premise
First of all, I want to achieve effects like dynamic lighting and highly flexible user-customizable colors.
Composite Sprites
The basic idea is to use sprites that are divided up into cohesive elements (a head layered on top of a torso, etc) and are first drawn in grayscale, then exported as a set of discrete graphical layers whose opaque fill is white.
The layer that corresponds to the darkest value of a sprite element is then transformed to the desired color, per default for the sprite or the user's selection.
The other layers that correspond to the lighter values of the sprite element remain white and are given an opacity equal to 100 divided by the total number of layers in the sprite element.
When all of these layers combine, they yield a "modeled" sprite element whose base color is user definable.
Lightmapping
You're right if you immediately said "it would be easier to transform a grayscale image without all these layers." The reason I nominated the approach above is because of my need for lightmapping.
Each sprite's lightmap is made up of the layers that provide the appearance of modeling, as well as any additional layers that simulate any sort of lighting-specific interaction between the sprite and its environment.
The lightmap needs to change to reflect either a change in lightsource direction or color and some other effects as well. By keeping the layers seperate, a greater range of subtleties can be achieved through fewer loaded resources.
When the lightmap is updated in realtime within the environment, the sprite will (hopefully) seem to be immersed in its surroundings.
I find it noteworthy to point out that I will not be using any gradient fills.
Refresh Rate
The bottom line is the framerate. Nobody enjoys choppy games. If engine performance suffers, the whole experience suffers.
Thus, all of this rests on what is best practice in terms of rendering speed.
Any warnings on the pitfalls of these plans or tips on optimizing the process are appreciated.
Qwai•zang \kwî-'zan\ n [origin unknown] 1 : abstract designer, esp. of complex real-time experiments, c. 21st century
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|