Results 1 to 10 of 10

Thread: Rendering damaged walls/objects

  1. #1

    Rendering damaged walls/objects

    Hi guys

    At the moment i'm playing Half life 2 and i must say that it's the best game i've played so far. Especially the graphics and the physics are great. When you try to destroy/damage something with e.g my crowbar, a hole appears in the object.
    the HL2 engine uses parallax-mapping to make these holes look realistic (with real depth, while it's just a flat texture).
    So that raises a question:
    How can i add damage to an object. (doesn't need to be with parallax-mapping). Just a hole that appears on the 'damaged place'.
    How do they do that?? Is it some kind of multitexturing??

    Can someone explain this?? :?
    Coders rule nr 1: Face ur bugz.. dont cage them with code, kill'em with ur cursor.

  2. #2

    Rendering damaged walls/objects

    What you are looking for is decals

    I saw a very good (but mathy) article a few years ago which I sadly can't find anymore, but this might also be a solution: http://www.gamedev.net/reference/art...rticle1986.asp
    Peregrinus, expectavi pedes meos in cymbalis
    Nullus norvegicorum sole urinat

  3. #3

    Rendering damaged walls/objects

    So it's not just texturing... polygons and triangles also need to be modified isn't it??

    Pitty there aren't much articles on this The simple/beginner stuff is very well documented, but when you want to get further.... :?

    P.S Gamedev.net is down :x Stupid hackers... why on earth hack Gamedev.. what's the point :?
    Coders rule nr 1: Face ur bugz.. dont cage them with code, kill'em with ur cursor.

  4. #4

    Rendering damaged walls/objects

    HL2 still uses flat decals to render "holes" in walls. No polygons are modified. The texture on the decal makes it look like it has taken a chunk out of the wall, but it is just a visual illusion. If you hit a wall enough times, you will see the first "holes" start disappearing as it recycles decals.

  5. #5

    Rendering damaged walls/objects

    Okay... that technique was called 'parallax mapping'.. isn't it

    But i've one question:

    How can i map a texture on a wall at a specific location.
    The decals aren't tiled in any way... so how to position them on a mesh Do i need to use textures with transparent borders, and stretch the borders so the rest of the object seems untextured??
    Are there other methods? :?
    Coders rule nr 1: Face ur bugz.. dont cage them with code, kill'em with ur cursor.

  6. #6

    Rendering damaged walls/objects

    You'll have to know the normal of the face of the mesh that the decal will cover.
    With that you can create a new plane which your decal will reside on. This plane however must be a bit displaced so it will not be culled by depth. Or you could disable depth testing when you draw the new quad on the plane.

    You will ofcourse need an alpha mask or colorkey transparency to make the decal fade correct with the mesh
    Peregrinus, expectavi pedes meos in cymbalis
    Nullus norvegicorum sole urinat

  7. #7

    Rendering damaged walls/objects

    Yeah i get it and when a grenade explodes in the corner of a room, a smart algorithm should create a decal mesh that covers e.g a piece of the floor, the front and the right wall. isn't it.

    Things will get a lot harder when the decal must be mapped on different objects e.g the terrain and a rock. Apperantly you should create an algo that determins the most important mesh(es) to apply the decal on.
    But i dont think there are any multi-object-decal games/engines around yet... because it must be very computational intensive.
    Having nice 'parallax-mapped' decals like HL2 does, seems sufficient to me.
    Coders rule nr 1: Face ur bugz.. dont cage them with code, kill'em with ur cursor.

  8. #8

    Rendering damaged walls/objects

    Actually I was talking about a paper which would explain computionally inexpensive clipping of decals over complex geometry
    Peregrinus, expectavi pedes meos in cymbalis
    Nullus norvegicorum sole urinat

  9. #9

    Rendering damaged walls/objects

    The gamedev article?? i've quickly looked at it when you posted.
    I initialy thought the article was about changing existing geomitry (creating holes/damage in the mesh). ops:

    Unfortunatly i cant take a look at it because Gamedev is down for a few days
    bloody hackers :x
    Coders rule nr 1: Face ur bugz.. dont cage them with code, kill'em with ur cursor.

  10. #10

    Rendering damaged walls/objects

    No not that one. I couldn't find the other article. It might reside on gamasutra but I can't remember anymore...
    Peregrinus, expectavi pedes meos in cymbalis
    Nullus norvegicorum sole urinat

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •