- Home /
Weapon / Viewmodel clipping shader methods
Hello, I would like to know a way of preventing a weapon mesh clipping through objects. I have made a custom shader (copied from unity's standard shader source code) and I tried some methods people had suggested in other posts.
I don't have any knowledge about shaders, so it's pretty much impossible for me to figure this out by myself. I have tried such methods as the second camera and scaling the weapon down so it's inside the player collider but both ways have some cons, for example. second camera method is very performance consuming and the scaling way makes light & shadow receiving look horrible. So right now I'm looking for help with an accurate weapon shader modified from the unity's standard shader.
I got some progress when I added a Queue"="Geometry-1" to the tags and "ZWrite off"& "ZTest always" to the pass, this made the weapon draw over other objects but the model was screwed up; Most of the faces were only visible from other side and some were missing completely.
Comment if you want to know more details of what I'm trying to achieve, thanks in advance.
Also if I didn't make it clear, the shader should be a PBR shader.
Your answer
Follow this Question
Related Questions
Shadow flicker 0 Answers
How to Cast Shadows AFTER Vertex Shader/ Updated Geometry? 1 Answer
Minimap with no shadow? 1 Answer
Editor's Camera Clipping Plane 12 Answers
Unity shadows work in scene, but no through camera 0 Answers