tipforeveryone
Bronze Supporter
|
How to render an object on top of others
In some FPS game, hand and gun model are rendered and placed on top of render stack, to avoid gun clipping into wall and obstacles. How can I do the same in Titan Engine ?
|
|
06-20-2022 05:13 PM |
|
RedcrowProd
Member
|
RE: How to render an object on top of others
you can try using this :
RM_BEHIND , // here you can optionally draw meshes which are behind the visible meshes using 'Mesh.drawBehind'
and just have your gun model call mesh.drawbehind.
i never used this, it might have a different shader applied to it, but worth a try.
else you would have to mess with the Z depth effect i believe so the mesh is always considered closer than anything else
|
|
06-20-2022 05:30 PM |
|
Esenthel
Administrator
|
RE: How to render an object on top of others
I recommend doing collision detection, and when gun intersects with a wall, just move it back.
I do the same in my Into The Dark dungeon game.
|
|
06-20-2022 05:45 PM |
|
tipforeveryone
Bronze Supporter
|
RE: How to render an object on top of others
(06-20-2022 05:45 PM)Esenthel Wrote: I recommend doing collision detection, and when gun intersects with a wall, just move it back.
I do the same in my Into The Dark dungeon game.
This is how my gun setup currently too but sometime I really need it to be brought to front.
(06-20-2022 05:30 PM)RedcrowProd Wrote: you can try using this :
RM_BEHIND , // here you can optionally draw meshes which are behind the visible meshes using 'Mesh.drawBehind'
and just have your gun model call mesh.drawbehind.
i never used this, it might have a different shader applied to it, but worth a try.
else you would have to mess with the Z depth effect i believe so the mesh is always considered closer than anything else
Thanks, Im gonna try it
|
|
06-21-2022 03:13 AM |
|