Managing decals

Started by
3 comments, last by onnel 21 years, 7 months ago
I''ve added a decalling system to my game (using squares made of two triangles and a zbias to make sure they''re on top of the other object). I plan on limiting the total number of decals allowed in the game and therefore keeping a list of all the decals currently in use. Whenever the max number of decals is reached, I''ll simply pop the last one off the list and add a new one. Does anyone see this approach as better or worse than a timer approach where most decals time out? Maybe I should use both..timed decals for things that are less important and a list of decals for important decals (bullet holes on the player''s vehicle, for example). In any case, my decalling system works quite well when decalling on to non-moving objects (right now I store the world coordinates and rotation for the decal, so it doesn''t even have to know what object it is sitting on). How should I go about adding decals to moving objects? Should the decal reference the parent object and then simply store the rotation and transformation needed to get from the center of the parent object to the decal location? Should I notify decals when their parent object moves and let them update themselves (probably wasteful)? How have others implemented this? Onnel
Advertisement
I know Unreal Tournament uses both a max decal and decal timeout scheme, with smaller and more frequent decals timing out earlier than big fat ones. About the attachment issue: if you''re using skeletal animation, you can attach the vertices of the decal to the bone it belongs to, that should work fine.

- JQ
Full Speed Games. Coming soon.
~phil
Right, seems like a mixture of decal management schemes is the way to go.

Unfortunately, I''m not using skeletal animation..especially not for things like boxes or barrels that may have decals and that can certainly move (but don''t need skeletal animation).

So the management shouldn''t be a problem, now I just need to figure out how to keep them correctly positioned on moving objects.

Onnel
Just store them in model space, barrels won''t usually have any moving parts, it''s usually the whole thing that moves. Often, it''s even advantageous to share vertices (obviously only on a geometry basis, not the actual vertices in the vertex buffer/array.

- JQ
Full Speed Games. Coming soon.
~phil
Right...storing them in local space is easy enough...it means that the decals will now need a reference to the parent objects (which I didn''t have in them before). This makes sense, though since I can now decide whether to render a decal or not based on whether the parent object is going to be rendered.

Thanks for the ideas!

Onnel

This topic is closed to new replies.

Advertisement