#Hand disappears completely when almost out of view

21 messages · Page 1 of 1 (latest)

lyric stag
#

I have turned off Occlusion Culling on the cameras, this did not solve it either..

grizzled ice
#

it cant have to do with clipping planes?

lyric stag
# grizzled ice it cant have to do with clipping planes?

I use the default clipping planes and changing these doesn't solve it either, because it's already wide enough. if the hand was partially outside the clipping planes you would see it being sliced in half, together with the weapon, and if it was completely outside the clipping planes, you shouldn't even see the weapon handle that it holds because it would also be outside the clipping planes

#

the only thing that seems to fix the issue is using a larger Field of View

#

but then it won't look as good anymore

grizzled ice
#

i thought so too, but thought to mention it anyway. Not sure if everything is rendered with the same camera

lyric stag
#

this is only the cutscene camera

#

I switch to the main camera and its overlay camera afterwards

#

but I didn't notice any issues with the other cameras

#

I guess my only option is to use a Field of View increase of 0.75

#

this fixes it and is slightly uglier

grizzled ice
#

id be curious what causes a full model to dissapear if it doesnt have to do with render distance and is beeing displayed once you increase FOV

lyric stag
#

but it's just so weird, all I did was use a newer Unity version and URP.. nothing else changed

grizzled ice
#

maybe its a bug after all. sorry i wasent much of a help!

lyric stag
#

XD well thanks anyway, it led me to the field of view

lyric stag
#

the issue also happens in built-in render pipeline but apparently I had found this code below that fixed it. But the problem is that it doesn't work with the URP camera

#

idk why, I didn't wrote it.. <.< it just worked and I totally forgot about it

#
/// This will disable the frustrum culling so that the hand model doesn't suddenly disappear when rotating the camera
/// </summary>
private void OnPreCull() =>
    cutsceneCamera.cullingMatrix =
        Matrix4x4.Ortho(-99999, 99999, -99999, 99999, 0.001f, 99999) *
        Matrix4x4.Translate(Vector3.forward * -99999 / 2.0f) *
        cutsceneCamera.worldToCameraMatrix;
}```
#

what it does is create a cullingMatrix equivalent to the culling matrix that would be built by Unity with a camera moved back from your actual point of view and a gigantic orthogonal frustrum (you could use a perspective projection, it’s equivalent as soon as all objects are in the frustrum).

#

I figured out what the issue is! it's the OnPreCull() which doesn't get executed in URP, only in built-in render pipeline (or older Unity version)

#
{
    Debug.Log("hello"); //NOTHING
}```