Тёмный

Fix FPS Weapon Clipping and FOV Distortion WITHOUT CAMERA STACKING. using Unity URP. 

Wolfey Gamedev
Подписаться 43
Просмотров 4,2 тыс.
50% 1

Опубликовано:

 

22 окт 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 33   
@apostolis_karantouvas1436
@apostolis_karantouvas1436 Год назад
This is for real the best tutorial on clipping planes i've ever seen on this platform! Keep up the great work!
@zurkio6179
@zurkio6179 Год назад
Holy shit, this is the BEST clipping tutorial I have ever seen. All other ones use the camera stacking which just messes up the FOV so THANK YOU so much for doing this Tutorial - It needs more views omg
@forasago
@forasago 13 дней назад
FOV shouldn't be a problem with camera stacking. You need a script to keep the FOV the same on all cameras you're stacking, no problems. The actual problem with camera stacking is that it has a significant performance cost for no good reason. This is a new problem with the SRPs. Built-in render pipeline does not have this extra cost for stacking cameras.
@kuritsu5206
@kuritsu5206 Год назад
Got mine to work! thank you so much lmao I have spent way too long at looking how to resolve this efficiently
@forasago
@forasago 12 дней назад
To anyone watching this, know that you WILL encounter unfixable visual artifacts / conflicts with RenderObjects. They are marked as Experimental for a reason. Unity features are often experimental even when not marked as such, so when even Unity admit that something Experimental you should really think twice about wasting your time on it. I did and here's what I found: - SSAO will always render through objects *at least while they are clipping*. - The only way to prevent this is to activate the checkbox "After Opaque" on the SSAO effect. - This makes SSAO render OVER FOG, which looks extremely stupid in any scene that has noticeably fog. So quick tldr: Only use RenderObjects if you can do without either FOG or SSAO. Otherwise don't use RenderObjects.
@jellyspoon3081
@jellyspoon3081 3 месяца назад
I'm having trouble getting this working. It does fix the clipping issue, but opaque objects become semi-transparent. The issue isn't related to SSAO (still occurs even with that turned off). Any idea what could be causing it? Edit: Also the objects are just using the standard URP lit shader.
@CK28622
@CK28622 3 месяца назад
Thank you!
@denny7477
@denny7477 Год назад
FOV part of the video is fine and works as intented but the wall clipping part is not that great. First of all, you are rendering the weapon twice.. you even said that its like on top of each other and you are fine with it. I wouldn't .. its really weird and its not necessary for sure. I remember I used this same approach some time ago and I didnt need that many render objects. And second, much bigger problem imo (which I had as well and couldn't fix) is that Ambient Occlusion (the shadow on the edge between wall and floor) is visible through the weapon. In your case its slightly visible around 11:14 when the weapon model is covering the edge. It would be more clear if you would bump the AO up. And this makes this approach completely useless because you can see every edge of the level through your weapon like its transparent. After many fails of trying to fix the issue I ended up with just scaling my weapons down so they cant possibly clip because they are fit inside my collider. When you scale your weapon down and move it closer to the camera it will look exactly the same, its impossible to tell the difference because there is none. You'll just maybe need to lower the near clipping plane on camera.
@WA2AB1
@WA2AB1 7 месяцев назад
Oof... same issue here, but I simply couldn't afford having a second camera going and I wanted separate fov for the gun, so I just disabled ambient occlusion.
@TakaShitake-rt8bz
@TakaShitake-rt8bz Год назад
thank you for your tutorials!
@alexgurwell8288
@alexgurwell8288 Год назад
Hey, awesome work, I couldn't get mine to work sadly.. Also how did you get the high fidelity version of URP? mine just says "Universal Render Pipeline Asset_Renderer" and not high fidelity
@alexgurwell8288
@alexgurwell8288 Год назад
Got it all to work, I had to set the graphics settings to the URP Renderer!
@wolfeygamedev1688
@wolfeygamedev1688 Год назад
@@alexgurwell8288 👍Good
@alexgurwell8288
@alexgurwell8288 Год назад
@@wolfeygamedev1688 Quick question though, so when my gun goes through the walls, I can see the shadows from the objects I am passing my gun through onto the gun, is there anyway to fix that?
@wolfeygamedev1688
@wolfeygamedev1688 Год назад
@@alexgurwell8288 wait is the gun clipping or not?
@alexgurwell8288
@alexgurwell8288 Год назад
@@wolfeygamedev1688 No it isn't clipping, but the shadows of the object you're passing the weapon through show onto the weapon
@hotdroppinglegends
@hotdroppinglegends 9 месяцев назад
0:30 when main camera renders only scene and weapon camera renders only weapon => does it mean that you render scene twice? what limitations this method has comparing to 2 camera setup? no problems with lighting and shadows?
@forasago
@forasago 13 дней назад
There is no second camera in this approach. RenderObjects are rendered by the main camera.
@H-jn5gt
@H-jn5gt 5 месяцев назад
Hey man! Can this work for HDRP?
@IndieGameJunkie
@IndieGameJunkie 5 месяцев назад
Soo helpful
@Quadman4853
@Quadman4853 Год назад
For me, this method almost worked but my weapon is now slightly transparent and I can see maybe 20% of a background
@Quadman4853
@Quadman4853 Год назад
Actually I found out it's because of Screen Space Ambient Occlusion. It works perfectly when I decrease intensity to 0, but the downside is it disables the occlusion
@Quadman4853
@Quadman4853 Год назад
Problem solved, I had to disable Environment Reflection in weapon's material, then ambient occlusion is working properly as well :D
@nico-ov4bg
@nico-ov4bg 8 месяцев назад
@@Quadman4853 Is this possible with an unlit shader?
@forasago
@forasago 13 дней назад
@@Quadman4853 Pretty sure this is a placebo fix and kind of pointless any way. What are you going to do with first person models that lack any kind of reflections? Most first person models are going be metallic - whether that's guns or a sword or metal robot hands - so reflections are extremely important. Real workaround: Activate "After Opaque" checkbox in SSAO effect and make sure the SSAO effect is above the RenderObjects, as it is in this video. If SSAO effect has no "After Opaque" checkbox you need to upgrade to a newer version of URP / Unity.
@marksteinburg4726
@marksteinburg4726 Год назад
Would this work in HDRP?
@wolfeygamedev1688
@wolfeygamedev1688 Год назад
I dont see why not.
@marksteinburg4726
@marksteinburg4726 Год назад
Does this only work if the fps hands/gun is a child of the camera?
@wolfeygamedev1688
@wolfeygamedev1688 Год назад
It works regardless of heirarchy, it is based on the Layer of the Gameobject.
@nico-ov4bg
@nico-ov4bg 8 месяцев назад
My weapon is slightly transparent, is there a fix for this?
@ZumoDePapaya
@ZumoDePapaya 8 месяцев назад
Change Screen Space Ambient Occlusion in your URP to after opaque
@AloricGG
@AloricGG 3 месяца назад
My weapons on the ground can be seen through walls/objects. Anyway to fix this?
@WolffRahm_
@WolffRahm_ 3 месяца назад
Change the mesh renderer's object layer after the weapon gets picked up. When dropped return it back to whatever layer it was before. rendererObject.layer = LayerMask.NameToLayer("Layer_Name");
Далее
UE5 Action-RPG Prototype DevVolg (1)
1:00
Handsoms😍💕
00:15
Просмотров 5 млн
3 Hours vs. 3 Years of Blender
17:44
Просмотров 5 млн
ADD ARMS TO YOUR GAME - EASIEST WAY (Unity3D)
15:22
Просмотров 61 тыс.
I Made a Game Using ChatGPT
9:51
Просмотров 2,7 млн
FIRST PERSON MOVEMENT in Unity - FPS Controller
23:53
10 Minutes vs. 10 Years of Animation
19:29
Просмотров 1,1 млн
I Build Your DUMB Redstone Ideas
14:52
Просмотров 195 тыс.