Disable Depth Test - Opaques
Hello... I've been waiting for many months now for a solution to this problem; FPS games NEED a way to control sorting of some opaque objects like guns, arms e etc. Will Epic help us to fix this issue or should I assume I have to ship a game ignoring the meshes clipping over character's arms in my game because there's really no solution to this?! In Unity all I had to do was adding a second camera and tell it to render ONLY the FPS render layer where I assign the objects I wanted (arms, guns, 3d Hud)... I also know Unreal 3 has something that works the same way. But UE4 doesn't!
Someone said there would be a solution for this problem when we was at 4.2... 4.7 is around the corner and nothing to resolve this problem was spoken again. Please, I tried a lot of things already and nothing removes this problem. Doesn't matter how good UE4 renderer is, if something like this happens to a character's arms in player's mind everything instantly turns into crap graphics. Need a solution for this ASAP, any ideas?! Please??
I know this thread is quite old by now, but I stumbled upon it while searching for a workaround or solution for this and I suspect I am not the only and/or last one who will end up in this thread.
Anyhow, I went with a workaround that works OK for what I am trying to achieve (trying to avoid my first person character's mesh and weapon to clip through meshes in the game environment). It is very basic and probably something many have thought of, it's not perfect but just fine for my project and hopefully helpful for others as well. Nonetheless, I am sure we all would prefer an official fix/solution from the UE4 dev team for this.
What I did was to simply move everything (camera, first person mesh, gun, arrow component etc) into the capsule collider so that the tip of the gun is at the very edge of the collider, thus it'll never clip through any meshes in the environment. Also, In my particular case it was beneficial to get some distance from the camera and the "collider edge" as it prevented the player from getting too close to textures, making them look bad.
answered Jul 23 '17 at 07:10 PM
Hi! This question's old as hell, the real solution is to make the arms/gun really small and keep it close. just keep the position attached to the camera and you should be fine..
answered Nov 18 '15 at 04:59 AM
Hey BrUnO XaVIeR -
From our Developers:
"The best solution is to not require hacks. If your player collision is such that you will not intersect with world geometry you should be fine.
An alternative solution is to selectively clear depth. For example you can render the meshes at the end of the depth-only prepass with depth testing disabled and tagging those pixels in the stencil buffer. Then enable stencil test in the base pass to not touch those pixels. At the end of the base pass you turn off stencil test and render your foreground meshes with depth testing enabled to get their properties in the gbuffer."
answered Jan 27 '15 at 11:18 PM
Lovecraft_K ♦♦ STAFF
Follow this question
Once you sign in you will be able to subscribe for any updates here