Open fcortese2 opened 5 months ago
I have the exact same problem here. This is not acceptable for me.
Please devs, answer us. I really cannot use the asset like this, and I will have to ask for refund if this is not solved. I have up to July 2 to do this.
Isn't there at least an option to disable frustum culling?
@Stephanommg @fcortese2 I have been looking into it but I can't reproduce this issue in any way. Every combination of meshes, bounds, and transforms seem to cull just fine. I think the easiest workaround for now is to disable the shadow culling. You can do this in the Nature Renderer Instancing.compute shader file, by disabling the code around line 219:
Change from:
#if SHADOWS
if (meta.Shadow > 0)
{
if (CullShadowFrustum(
boundsCenter,
-boundsExtends,
_ShadowDirection,
_FrustumPlanes))
{
meta.Shadow = 0;
}
}
#endif
To:
#if SHADOWS
/*
if (meta.Shadow > 0)
{
if (CullShadowFrustum(
boundsCenter,
-boundsExtends,
_ShadowDirection,
_FrustumPlanes))
{
meta.Shadow = 0;
}
}
*/
#endif
Note that you need to restart Nature Renderer in order to reload the shader. (Enable/disable the component, compile scripts, or enter playmode)
Hey @maxplooi thanks for getting back to us.
Since the original post was made, we have moved over to working in a new Unity scene file and the issue now seems to be gone... We're still not sure if previously it was a scene corruption issue or what else, but the good news is all seems to be working fine in this new Unity scene.
Thanks for the info though, we'll try this approach if the issue shows up again at some point .
Here's some chocolate as a thanks : P
__________________,.............,
/_/_/_/_/_/_/_/_/,-', ,. -,-,--/|
/_/_/_/_/_/_/_/,-' // /-| / /--/ /
/_/_/_/_/_/_/,-' `-''--' `' '--/ /
/_/_/_/_/_/_,:................../ /
|________,' |/
"""""""""""""""""""""""'
@Stephanommg @fcortese2 I have been looking into it but I can't reproduce this issue in any way. Every combination of meshes, bounds, and transforms seem to cull just fine. I think the easiest workaround for now is to disable the shadow culling. You can do this in the Nature Renderer Instancing.compute shader file, by disabling the code around line 219:
Change from:
#if SHADOWS if (meta.Shadow > 0) { if (CullShadowFrustum( boundsCenter, -boundsExtends, _ShadowDirection, _FrustumPlanes)) { meta.Shadow = 0; } } #endif
To:
#if SHADOWS /* if (meta.Shadow > 0) { if (CullShadowFrustum( boundsCenter, -boundsExtends, _ShadowDirection, _FrustumPlanes)) { meta.Shadow = 0; } } */ #endif
Note that you need to restart Nature Renderer in order to reload the shader. (Enable/disable the component, compile scripts, or enter playmode)
Thank you. It is a pitty that we have to lose about half performance to being able to properly use the tool, and even that it still provide high performance (I tested this), it may not be enough to satisfy my needs. Thus, I am insecure about using the tool like this. I also just tested this fix in one scene, and currently I don't have time to make more tests. So it would be great if you found a fix before 2 July, which is my deadline to ask for refund. Here are my current specs (for the sake of reproducing):
Unity 2021.3.16f1 SO: Windows 10 Pro 64 bits Mother Board: Gigabyte B550M DS3H (bios F18) Processor AMD Ryzen 7 3700X RAM: 32 Gb Video Card: Nvidia GeForce 3060 Ti DirectX: 12
Regarding the reply of @fcortese2, I have tested in one of my own scenes and NatureRenderer scene, and the problem appears on both.
@fcortese2 do you use the same tree models and tree shaders in both scenes (the old and the new)?
@maxplooi perhaps if you provided an option in NatureRenderer to have an offset on the camera frustum (for the sake of shadow culling) this would be an workaround to solve this problem and still get the culling.
@Stephanommg yes, same trees, same shaders, etc... Issue just seems to have magically fixed itself.
@maxplooi any update?
@maxplooi I am still expecting an answer.
Describe the bug Shadows clip in and out of existence when the object is behind the camera.
To Reproduce Steps to reproduce the behavior:
Expected behavior Shadows should not be culled when in view
Video of issue https://drive.google.com/file/d/1YMz2pFii9ze14_0yXJvpxiXR28waz1DG/view
Project(please complete the following information):
System (please complete the following information):
Additional context Add any other context about the problem here.