Sign in to follow this  

Knife scratch and bullet holes in CSS

This topic is 4805 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Uh, no. It's totally done with ublar l337 deformable terrain that you can shoot a rocket launcher at and break out a wall because it's such a ubl4r l33t engin3.

...Actually, Mushu's right. It's a decal, layered onto the background. If you set max decals to 0, you won't even see them.

Share this post


Link to post
Share on other sites
Quote:
Original post by Boku San
Uh, no. It's totally done with ublar l337 deformable terrain that you can shoot a rocket launcher at and break out a wall because it's such a ubl4r l33t engin3.

...Actually, Mushu's right. It's a decal, layered onto the background. If you set max decals to 0, you won't even see them.


Yeah, it is decals. I was fooled by my eyes again...
Then how to make the glass window? It seems shape of the
hole is random.

Share this post


Link to post
Share on other sites
I think the glass gets decomposed into a series of quads with a texture that uncludes full transparencies.

One thing I'd like to see though, is on metallic materials, have a decal that isn't just a black dot but is a normal map showing an indentation, so that the bullet dent is seen with just bump mapping and specular lights.

Share this post


Link to post
Share on other sites
I'm not sure what you mean by that, Dominicds.

I was in the Beta of CS:S, but now I happen to be too broke to buy it (well...more like not willing to spend money until HL2 reviews come out), so...a picture would be nice.

EDIT: It looks like you had some pictures...did you link them incorrectly (referring to deleted post)?

[Edited by - Boku San on October 12, 2004 12:02:48 PM]

Share this post


Link to post
Share on other sites
Quote:
Original post by Boku San
I'm not sure what you mean by that, Dominicds.


Yeah, now I realize I wasn't very clear, maybe these images will clear things up a bit.


The bullet hole decal is mapped onto both sides of the pillar.


The "No War" spray paint is mapped onto both the ground and the stump.

Share this post


Link to post
Share on other sites
Quote:
Any suggestions on easy ways to clip the decals? Or to bend them around corners where they lay on multiple faces?


The best reference I know of on this is Eric Lengyel's article 'Applying Decals to Arbitrary Surfaces' in GPG2. The book also comes with code for the implementation on a CD. My decal system is based on this method, and it works great.

The basic idea is as follows. You construct the decal from an intersection point (i.e. where a bullet hits) and the surface normal at that point. From this info you create a rectangular volume centered on the intersection point and aligned with the normal. The width and height of the volume are the desired width and height of the decal, and the depth is chosen as appropriate to include the appropriate polygons.

Then what you do is take each surface that intersects this volume, and add its triangles to the decal one by one. As the triangles are added, they are clipped to the volume so that only the portions inside the volume remain.

What you are left with is a decal surface that perfectly follows the contour of the surfaces it affects. You can then use the z-tweaking method of your choice to avoid z-fighting.

The implementation is a little involved, but it's not too bad. If you don't have GPG2, I highly recommend picking it up for the source code if nothing else.

Share this post


Link to post
Share on other sites
Quote:
So is this a multi-texturing effect rather than a texture mapped quad?


If you're refering to the Lengyel method, no, it doesn't use multitexturing. Multitexturing would require that the exact input tris be used, but in this case the tris must be clipped to get the right results.

Also, it's only a quad in the simplest case, i.e. a flat surface with no clipping. In the general case, it's a mesh of tris that maps to the underlying surface.

Not sure if I answered your question, though...

Share this post


Link to post
Share on other sites
Maybe a good idea to check for the 3 closest point on the 3 triangle-edges, if a point lies in the bullet-hole area then check which triangle shares the same edge, where the point was on, and put another decal on that point facing it to the normal of that triangle. should work too

Share this post


Link to post
Share on other sites
To get stuff on to multiple surfaces you clip the decal to each of the multiple surfaces. You can see Quake 3 doing this with triangle outlining on (/r_showtris 1), I'm sure there are similar commands for other games. There's a tutorial on decals over at flipcode, although the links to the example images and the source code are unfortunately broken.

Share this post


Link to post
Share on other sites
Quote:
Original post by Cypher19
One thing I'd like to see though, is on metallic materials, have a decal that isn't just a black dot but is a normal map showing an indentation, so that the bullet dent is seen with just bump mapping and specular lights.


Actually, what i'd like to see is decals with bumpmapping+parallax mapping, so they would have depth, and actually look like a hole.
Should be coded just like a regular decal, but with a nice shader.
I wonder if anyone has tried that yet... there were talks of "geometry decals" a while ago to carve smallish holes in walls, but parallax makes it much simpler.

Share this post


Link to post
Share on other sites

This topic is 4805 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this