Advertisement

Decals

Started by January 23, 2000 09:08 AM
9 comments, last by Ghastly 25 years, 1 month ago
How would I put decals in my game like Half-Life did bloodstains, numbers, taunts, etc...
Could you give a bit more detail about the type of game you''re making and the graphics API (if any) you''re using?
Advertisement
This is a 3D action game like Quake my API is Software and GL currently my engine supports 8-bit colour software and 16-bit colour gl it has frame interpolation (gl) couloured ligting (gl)console etc...
Hm..I wish i could speak for OpenGL, But it should work the same way...
I know you can do this with directx not sure though when it comes to OpenGl...
find the location of the texture in the object structure/memory. Open the texture in memory and blit the graphics (blood spots or whatever)close the texture and update the object and texture map...i know this may be a bit bland..but i am not fluent in OpenGL. so i can''t be that specific..
-Lucas

E-mail with questions, comments, and retorts.
InvalidSyntax@icqmail.com
-Lucas
What does that all mean I need more details
OKay..are you trying to add decals to a model in a modeler or your game...if so what modeling program are you using or how are you putting the texture on your object (source code), paste your routine that you use to put textures on a object...i will try to help more but i need more specifics
-Lucas


E-mail with questions, comments, and retorts.
InvalidSyntax@icqmail.com
-Lucas
Advertisement
Hmm, I have the same question too (how to do decals). I''m interested in how to do it using Direct3D IM. I have no previous knowledge regarding decals but there''s two ways that I have thought of doing it:

1. render decal as a quad on top of object
2. use multitexturing

Which way would be better? I need to be able to do this while the game is running so I can''t just draw a bloodstain on a texture beforehand. The code will be used to put blood spots on monsters from damage from weapons. Thanks!

Don''t get fooled by GL_DECAL.

Decals are just textures that drawn on top of another texture. You probably don''t need to multitexturing since it isn''t blending the two textures. You do want to take advantage of the alpha channel so a blood splotch isn''t a triangle or quad.

The big problem is gtting the graphics to resolve two polys in the same space with the same Z coords. OGL can enable the GL_POLYGON_OFFSET which kind-of, sort-of takes care of this for you. I remember there was one part in half-life where "SURRENDER FREEMAN" was painted on the wall but as I moved around it started showing wierd bands. I thought it was an easter egg at first.

You also probably want to keep the decal data seperated from the mesh data a little.
-the logistical one-http://members.bellatlantic.net/~olsongt
Rendering a separate quad is the best you can do
multitexturing is not a good option, since you also need to draw the 2nd texture when there is no decal. This reduces texturing speed.

However:
GL_POLYGON_OFFSET did not work for me. I used the GL_LEQUAL depth test instead of GL_LESS. Never had any problems with that.

In D3DIM there should be a SetRenderState call that sets the Z compare function to ''pass test if new-Z is less or equal existing-Z''

DaBit


I really wasnt trying to put a decal on a model although that would be cool (never thought about that) I was trying to put it on a bsp texture like walls,floor,ceiling etc I am using 3DSM for modeling and Quark and Worldcraft for BSPs

This topic is closed to new replies.

Advertisement