VeTaL Posted September 13, 2010 Share Posted September 13, 2010 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 Quote Working on LeaFAQ Link to comment Share on other sites More sharing options...
franck22000 Posted September 13, 2010 Share Posted September 13, 2010 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); Quote You guys are going to be the death of me. Josh Link to comment Share on other sites More sharing options...
VeTaL Posted September 14, 2010 Author Share Posted September 14, 2010 Thanks, added your example to Wiki. Quote Working on LeaFAQ Link to comment Share on other sites More sharing options...
Recommended Posts
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.