Jump to content

Decals on surface from bullets


VeTaL
 Share

Recommended Posts

As i understand, if i use instancing for buildings, i cant draw on its texture holes from bullets?

So, i need to place decals there... can i do this with shader or by decals?

 

 

PS:

http://www.leadwerks.com/wiki/index.php?title=CreateDecal

Generates a mesh exactly aligned to the specified surface. This can be used for decals.

The decal should afterwards be parented to the entity which was hit/whose surface was hit.

See the example.

 

But there is no example :)

Working on LeaFAQ :)

Link to comment
Share on other sites

Hello Vetal here is a C++ example code:

 

 

TPick _Picked;
CameraPick( &_Picked, Camera ( framework camera here ), Vec3(GraphicsWidth() / 2, GraphicsHeight() / 2, 100), 0);

TMesh _Decal = CreateDecal(_Picked.surface, TFormPoint(Vec3(_Picked.X, _Picked.Y, _Picked.Z), NULL, _Picked.entity), 20.0/16.0, 32);


EntityParent(_Decal , _Picked.entity, 0);
PaintEntity(_Decal , LoadMaterial("abstract::bullethole.mat"));

AddMesh(_Decal , _Picked.entity);

You guys are going to be the death of me. Josh
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...