Page 1 of 1

How to create the effect of bullet marks?

Posted: Mon Oct 25, 2010 7:38 am
by klikli234
I mean what examples help me. Or key functions

Posted: Mon Oct 25, 2010 8:35 am
by Bear_130278
Fastest way - simple geometry planes with alphed textures 8)))

Posted: Mon Oct 25, 2010 12:04 pm
by slavik262
To explain a little more, a common technique is to create quads wherever the bullet hit and texture that with a bullet hole. This works best on flat surfaces, though.

Posted: Mon Oct 25, 2010 12:52 pm
by klikli234
Bear_130278 wrote:Fastest way - simple geometry planes with alphed textures 8)))
sorry, I can't understand.

did you have example?
you say geometry planes not like billboard or particle system in the irrEdit?

Posted: Mon Oct 25, 2010 1:27 pm
by Bear_130278
Fastest way - simple geometry planes with alphed textures
simple geometry planes - really a quads (2 triangles)
alphed textures - a simple diffuse map for the bullet hole with alpha channel.

Like slavik262 said....

Posted: Mon Oct 25, 2010 1:40 pm
by klikli234
Bear_130278 wrote:Fastest way - simple geometry planes with alphed textures
simple geometry planes - really a quads (2 triangles)
alphed textures - a simple diffuse map for the bullet hole with alpha channel.

Like slavik262 said....
What function can be draw a quads?
and Collision detection can get intersection position but a quads need four points position

Posted: Mon Oct 25, 2010 1:59 pm
by RuggJack93
Well, there are many ways to draw a quad in irrlicht, just choose one that suits you: use the function addPlaneMesh();, draw a cube scene node an set its Z scale to 0, create a plane mesh and load it or even create your own custom scene node (if you really have to...) and others...

Then, when you have your quad, use the collision intersection point as center for your node (you also have to rotate it accordingly to the normal of the hit triangle).

Finally load your bullet mark texture, apply it to the plane and set its material
a to trasparent one (depending on the texture you loaded)

Posted: Mon Oct 25, 2010 2:33 pm
by slavik262
RuggJack93 wrote:draw a cube scene node an set its Z scale to 0, create a plane mesh and load it...
There's no point in creating a cube scene node with 0 depth. You'll still have lots of unneeded, redundant vertices. There's also no point in loading in something as simple as a quad.

Also, you should avoid creating a custom scene node for each quad. Creating a scene node that acts as a manager for a group of bullet holes (and maybe even batches them into one draw call) is a great idea, however.

Posted: Wed Oct 27, 2010 7:05 am
by klikli234
slavik262 wrote:
There's no point in creating a cube scene node with 0 depth. You'll still have lots of unneeded, redundant vertices. There's also no point in loading in something as simple as a quad.

Also, you should avoid creating a custom scene node for each quad. Creating a scene node that acts as a manager for a group of bullet holes (and maybe even batches them into one draw call) is a great idea, however.
you are right!
but all mesh put in scenemanager.
how can I draw all bullet holes by a scenenode?
I can used a plane mesh for many scenenode
but can I use a scenenode for many bullet holes?

Posted: Wed Oct 27, 2010 7:13 am
by klikli234
RuggJack93 wrote:Well, there are many ways to draw a quad in irrlicht, just choose one that suits you: use the function addPlaneMesh();, draw a cube scene node an set its Z scale to 0, create a plane mesh and load it or even create your own custom scene node (if you really have to...) and others...

Then, when you have your quad, use the collision intersection point as center for your node (you also have to rotate it accordingly to the normal of the hit triangle).

Finally load your bullet mark texture, apply it to the plane and set its material
a to trasparent one (depending on the texture you loaded)
I just find the function addHillPlaneMesh() without 3D coordinate parameter in irr::video::IVideoDriver Class Reference

if I create a plane mesh I have eight bullet holes, do I have eight scenenode store them?

Posted: Wed Oct 27, 2010 10:16 am
by joshcryer
I used this uber simple decal engine for that: http://irrlicht.sourceforge.net/phpBB2/ ... php?t=3464

It could at least give you an idea.