Is it possible to make a shader in HDRP that will be drawn on top of everything without second cameras and all that shit (for weapon)? Because in legacy render it was impossible.
I would like this but I do not know how to achieve it with current HDRP. I don’t want to use multiple cameras for performance reasons.
With the default pipeline you can do this with stencil buffer, we will have to wait for Shader Graph to support that or if you can add it to a version of the Lit shader yourself. I actually don’t know if HDRP will have Stencil Buffer or if it’s something else that’s basically the same, we will have to wait and see.
Not impossible in legacy, i did it but it had a few limitations. But it did work very well and with just one active camera :
https://assetstore.unity.com/packages/tools/camera/first-person-view-2-67929
I’ve not been able to replicate my solution in the new renderer, i can’t use the same logic for that.
I’d love to see Unity implement a first person render natively into the renderer. That would be fantastic
I think that weapon rendering is such an integral and common feature that it MUST have native support. It’s something Unity’s competition has perfectly solved.
We waited a decade for decals, lets not wait another decade for decent first person support in rendering
I would like to know about this too, maybe we should summon Sebastien here so we can get a focused discussion about FPS rendering with SRP?
ummm @SebLagarde mind to chime in?
Not sure what was meant by Unity’s competition. UE4 doesn’t support this but CryEngine does when using their legacy GameSDK (they haven’t ported this over to new systems afaik). I’m sure many proprietary engines can do this but they really aren’t Unity’s competition as we can’t access those. I’d like to add tho that this hack has really bothered me on many games, I’d always prefer if guns just moved away from walls instead of hacking the rendering to show impossible to have visuals, it just breaks the immersion and depth perception. To me, it’s just feels like cheap hack to fix something that would take more effort to fix properly. I’m pretty sure this is also why engines like UE4 don’t even try to solve this on rendering.
There is one case where this makes more sense and it’s when you are in a dense foliage, you can render the weapon on top of grass / bushes which isn’t as disturbing than rendering the whole gun even when it’s clipped into a brick wall… But the foliage case can be solved otherwise too (bend the foliage out of the way).
The question was simple - it is possible or not. God, I just hate when someone pushes their opinion into the technical discussion.
I gave people doing this alternative solutions (make guns dodge the wall, bend the foliage), I also mentioned that biggest Unity competitor doesn’t do this either as it was presented here as (somewhat false) argument. In addition, I explained why this hack is technically bad (not just an opinion): it really messed up with depth perception with objects drawn in places where they can’t be. But I can tell my input isn’t appreciated here so I’ll just unsubscribe from this thread. Don’t expect any further help on your issues with that attitude
PS. This is a discussion forum - opinions and discussion around the topic are both allowed as long as they don’t offend others or derail it.
Yeah I already do that. I need to nudge it a bit further because when you move or rotate away as I do you’re just displacing the problem, plus when enemies attack (game is mostly weapon based melee) they penetrate shields, so it’s not just a gun vs wall problem.
So I need a way to prioritise the drawing of objects in front of the camera a little, in addition to the measures I already take - doesn’t need much but would make a nice difference.
Seb Lagarde mentioned that I could reserve a range of depth but I’m not sure how to achieve that process.
There was nothing technical about it. Also, I think he was just trying to help. If you are asking questions on the forum, perhaps you should appreciate the help first. If you hate that too, then don’t ask for people’s opinions. Go find out on your own.
Yeah although I’m not hating anyone and would appreciate pointers eventually (whenever)
Could you just mess with the render order enough to force it into position? If you look at the gun/hands/etc material the order option should be in the material or mesh renderer section. Press yourself firmly up against the wall first to activate unwanted (wanted here?) clipping then go ham on the render order value/s.
Unfortunately in my case, these are melee weapons that I’ve de-penetrated and rotated as far as I can already. It’s just a polish pass though, to remove the final visual bugs really.
All games experience some clipping but they’re able to mask the final but with some nice tweaks to depth range or whatever, I do not currently know how that would be achieved in HDRP.
Any noise on this guys? Hate to bump but it’s still an issue, thanks!
i guess we wont’ get an FPS renderer for now
Theres multilples ways to achieve this. Change the render queue value in your weapon material. Or add an additional pass to the render loop that will render weapons after everything else. Or as Sebastien suggested, reserve some depth range value for your weapon (make sure it has the higest values close to 1.0).
How do I achieve the mentioned things? I do not know where to begin. My expertise with shaders very much ends around mobile vert/frag shaders. SRP is a lot of stuff I don’t know how to alter yet
You are on HDRP right? I’ll try to put out something today, just need to finish a hurry up commit and then I’ll give it a go.
PS: HDRP is really not meant to be altered, at least till it’s finalized, lot of things changing within almost every day. Unless you wanna grow white hair quickly. ^^
The white hair is coming, believe me. but yes - I can wait and you are right - I just wanted to make sure this sort of common thing is designed-for built in feature to avoid the decade or so of problems people had with it in older versions of Unity.