• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.
Sign in to follow this  
Followers 0
lanceking

Knife scratch and bullet holes in CSS

15 posts in this topic

I wonder how to implement knife scratch and bullet holes just like what is in counter strike source? Anyone can give me any ideas so I can start? Many thanks!!
0

Share this post


Link to post
Share on other sites
I thought it was done with decals - basically textured quads slapped over the surface where the bullet/kinfe hit.

Just a random guess, though.
0

Share this post


Link to post
Share on other sites
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.
0

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.
0

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.
0

Share this post


Link to post
Share on other sites
A simple way to have 'random' holes, is to have a few decals and use one randomly whenever you need one (if you use decals, remember to clip them, so you don't have bits hanging off the edges of scenery.)
0

Share this post


Link to post
Share on other sites
In CS: Source, the decals such as bullet holes and spray paint can be stretched accross multiple quads. How is this effect implemented?
0

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]
0

Share this post


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

Onnel
0

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.
0

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.
0

Share this post


Link to post
Share on other sites
Quote:
Original post by jyk
... Smart stuff...


So is this a multi-texturing effect rather than a texture mapped quad?
0

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...
0

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
0

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.
0

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.
0

Share this post


Link to post
Share on other sites

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  
Followers 0