Bullet marks on wall

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
Electron
Posts: 874
Joined: Sun Mar 14, 2004 12:05 am
Location: Massachusetts USA

Bullet marks on wall

Post by Electron »

Anyone know how to do this? Ignoring for a moment that you'd need a texture layer for the bullet and your wall would probably have normal texture coords + lightmap and irrlciht only allows 2 texture layers, how couldo one set the bullet texture so that it appeared in the right spot in the wall.
Only solution I can think of is finding the vertices where the mark is supposed to be (probably not a quick task) and changing the 2nd set of UV coords so the texture will be displayed there (all vertices other than ones where bullet should be are set with UV coords outside range and is set to not tile textures for coords outside range(not sure if irrlciht has method for that or if would have to add one)).
That is not a very fast operation, does anyone know anything better?
You do a lot of programming? Really? I try to get some in, but the debugging keeps me pretty busy.

Crucible of Stars
Fussel
Posts: 22
Joined: Fri Apr 09, 2004 1:47 pm

Post by Fussel »

try placing a sprite where the bullet hits a wall..seems to be far more simple than changing the texture of the mesh
Electron
Posts: 874
Joined: Sun Mar 14, 2004 12:05 am
Location: Massachusetts USA

Post by Electron »

thanks, that would probabl ywork fairly well
You do a lot of programming? Really? I try to get some in, but the debugging keeps me pretty busy.

Crucible of Stars
bal
Posts: 829
Joined: Fri Jun 18, 2004 5:19 pm
Location: Geluwe, Belgium

Post by bal »

Check the techdemo, just don't draw a particle but your bullet hole sprite :)
General Tools List
General FAQ
System: AMD Barton 2600+, 512MB, 9600XT 256MB, WinXP + FC3
Electron
Posts: 874
Joined: Sun Mar 14, 2004 12:05 am
Location: Massachusetts USA

Post by Electron »

anyone knwo how professional games do it? I believe it's with a seperate texture layer, but I"m not really sure.
You do a lot of programming? Really? I try to get some in, but the debugging keeps me pretty busy.

Crucible of Stars
calimero
Posts: 45
Joined: Sun Aug 08, 2004 4:31 pm
Location: Nice, France

Post by calimero »

hello electron,
not very sure but i think commercial games use texture on the initial object (with a second layer probably) because if you use another object it may be a bad render effect due to rounds in the Z-buffer.

I think the effect you want is called "decals" and use the 2nd channel texture.
Electron
Posts: 874
Joined: Sun Mar 14, 2004 12:05 am
Location: Massachusetts USA

Post by Electron »

yes, that is what I was thinking originally. It just seemed that everyone was telling me to use sprites, which would be a bit easier but would probably not look as good.
You do a lot of programming? Really? I try to get some in, but the debugging keeps me pretty busy.

Crucible of Stars
Masdus
Posts: 186
Joined: Tue Aug 26, 2003 1:13 pm
Location: Australia

Post by Masdus »

sprits where used in some earlier games, but they do lead to problems such as the bullets holes appearing to be detached from the walls at some angles. Decals is one way and i think flipcode.com has a tutorial on this. Might also be able to do it with a shader but as irrlicht doesn't yet support shaders its not really an option.
Captain_Kill
Posts: 124
Joined: Sun Jun 27, 2004 11:02 am
Contact:

Post by Captain_Kill »

Quake 3 (Plus most Q1 and Q2 engine mods) makes a decal out of polygons then uses the surface normals to attach it onto the level mesh. Check out Q1 or Q2 engine mods for code. No games that I know of use textures. They all use polygons. (Which is why most games have decal limits, lots of decals = lots of polys)
2.8GHz P4 with HT - 512MB DDR - ATI Radeon 9600XT 256MB - Windows XP - VC++ 6 and VC++ 2003

Dark Reign 3 Home Page: http://darkreign3.notwhatyouthink.org/
Dark Reign 3 Forums: http://notwhatyouthink.org/darkreign3bb/
Electron
Posts: 874
Joined: Sun Mar 14, 2004 12:05 am
Location: Massachusetts USA

Post by Electron »

thanks. I guess I'll have to investigate both types and see which one works best
You do a lot of programming? Really? I try to get some in, but the debugging keeps me pretty busy.

Crucible of Stars
MessiaH
Posts: 55
Joined: Tue Jul 06, 2004 6:37 pm
Location: RUSSIA

DECALS

Post by MessiaH »

OK.
But if a decal is made of polys...
Imagine that we are making rocket decal(which is surely big :) )
And we are shooting in the edge of a wall.
But in this case some part of our polgonal decal will be out of triangle!
Should we make the decal out of many*many polys,and for each poly check collision with the triangle?!
This is not the ideal way...
Guest

Post by Guest »

i wrote a little class to do this stuff... let me know if you still need it
Armen138
Posts: 298
Joined: Mon Feb 23, 2004 3:38 am

Post by Armen138 »

last post was mine.. :) forgot to log in
if you're looking for me, start looking on irc, i'm probably there.
calimero
Posts: 45
Joined: Sun Aug 08, 2004 4:31 pm
Location: Nice, France

Post by calimero »

armen138,

what is the method you use ? if it's decals your code interest me, please post it, thanks
Armen138
Posts: 298
Joined: Mon Feb 23, 2004 3:38 am

Post by Armen138 »

yes, its decals... i'll change around the code a little and post it
if you're looking for me, start looking on irc, i'm probably there.
Post Reply