Author Topic: Snow showing as black on build  (Read 1468 times)

Cronos

  • Newbie
  • *
  • Posts: 12
    • View Profile
Snow showing as black on build
« on: December 10, 2018, 05:45:49 AM »
Hi there,

We've put Global Snow in our project on Unity 2018.2.11f1 with deferred rendering and it shows fine on editor. However, once we make a PC build (with IL2CPP on, if that matters), the snow shows as black on it.

Any clue what might be this issue? Maybe a shader incompatibility?

Thank you

Kronnect

  • Administrator
  • Hero Member
  • *****
  • Posts: 4843
    • View Profile
Re: Snow showing as black on build
« Reply #1 on: December 10, 2018, 07:36:30 AM »
Hi,

Just tested and built demo scene for deferred on both Mac and Windows (IL2CPP) and worked as expected.
Perhaps some other effect is causing the issue?

Regards

Cronos

  • Newbie
  • *
  • Posts: 12
    • View Profile
Re: Snow showing as black on build
« Reply #2 on: December 16, 2018, 06:45:01 AM »
We are using "GlobalSnowEraser" material that is on Workflow_Forward folder, and our rendering is Deferred. Would that be a possible cause? We couldn't find another GlobalSnowEraser material besides that one.

Thank you

Cronos

  • Newbie
  • *
  • Posts: 12
    • View Profile
Re: Snow showing as black on build
« Reply #3 on: December 16, 2018, 08:52:59 AM »
I have also two other issues if you don't mind posting it here:

- When I apply a layer that doesn't have Global Snow coverage on a game character, the game character shows some kind of shadow following it during gameplay. Do you recall seeing this issue? Do you know how to fix it? PS: We use LOD system on it. And this only happens on our level with Global Snow.

- The snowfall seems to be not fast enough to follow the player around, so most of the time no snowfall is shown on screen, unless the player stops moving or moves towards the snowfall spot. Do you know how to make this following "faster"?

Kronnect

  • Administrator
  • Hero Member
  • *****
  • Posts: 4843
    • View Profile
Re: Snow showing as black on build
« Reply #4 on: December 16, 2018, 02:53:18 PM »
Hi,
1) Don't use the GlobalSnowEraser from Forward Rendering path as it won't work properly in deferred. In deferred rendering path, a depth mask is created by rendering excluded objects in frustum view. This mask is then used by the snow shader to discard snow coverage.
To exclude objects from snow, either add them to one layer and exclude it from the coverage layer (eg. particle systems should be excluded) or add the "GlobalSnowIgnoreCoverage" script to the objects.

2) Character shadow - could you post a screenshot of the results and your GS settings?

3) Snowfall speed. It uses a particle system with an Emission box of 100 x 100 in the XZ plane (note that it's rotated):

You can try to increase the Speed option in Global Snow's SnowFall section or increate the Emission box size.

Regards,


Cronos

  • Newbie
  • *
  • Posts: 12
    • View Profile
Re: Snow showing as black on build
« Reply #5 on: February 03, 2019, 04:30:05 PM »
Thanks for the other replies, Kronnect.

About the "shadows" on the Characters, please take a look on the image attached. Also attached the GS Settings.

It looks like when Global Snow is off on skineed mesh renderer, somehow the "snow layer" keeps on on a different way (darker and not following the animations).

Any idea what can it be?

Thank you

 





Kronnect

  • Administrator
  • Hero Member
  • *****
  • Posts: 4843
    • View Profile
Re: Snow showing as black on build
« Reply #6 on: February 04, 2019, 12:13:24 AM »
Does your character model use more than one material or submesh? That can be the cause since DrawRenderer() (used to remove snow) is currently only taking the first submesh. It will be improved to use all submeshes in next beta.

Cronos

  • Newbie
  • *
  • Posts: 12
    • View Profile
Re: Snow showing as black on build
« Reply #7 on: February 04, 2019, 02:53:31 PM »
Yes, they do have submeshes and sometimes more than one material in some submeshes.

Do you have an estimate of when the next beta will be released? Or if you can inform or send me its piece of code that clear them on DrawRenderer. :)

Also, as a side-suggestion, it would be nice if we could bake the snow like light mapping for perf reasons. But I guess that would be a completely new feature. :D

Thank you

Kronnect

  • Administrator
  • Hero Member
  • *****
  • Posts: 4843
    • View Profile
Re: Snow showing as black on build
« Reply #8 on: February 04, 2019, 03:10:41 PM »
Multiple submesh support is now available! Just upgrade to latest version from the Asset Store.
« Last Edit: February 04, 2019, 03:25:28 PM by Kronnect »

Cronos

  • Newbie
  • *
  • Posts: 12
    • View Profile
Re: Snow showing as black on build
« Reply #9 on: February 06, 2019, 12:26:59 PM »
Thanks Kronnect. I updated to 5.1.1 but unfortunately I'm still seeing the "shadow" issue on characters, though it seems less "strong"/evident. I found out that if I remove the Unity LOD the shadow is gone, so they seem to be related. So the script probably needs to check besides the main skinned mesh, the LOD skinned meshes too. Have you had chance to test it on characters with skinned meshes and animation using Unity LOD?

Kronnect

  • Administrator
  • Hero Member
  • *****
  • Posts: 4843
    • View Profile
Re: Snow showing as black on build
« Reply #10 on: February 06, 2019, 03:00:14 PM »
Yes, the LODGroup here is the culprit. Global Snow builds a command buffer with those renderers that will be exluded from snow. The command buffer is not updated then the LOD changes hence the artifacts. One solution would consists of forcing the command buffer to be rebuilt each time a new LOD enters in effect - that can be expensive with many objects changing LOD at the same time but should work.

Which mechanism of exclusion are you using for those characters, layer or the GlobalSnowIgnoreCoverage script?

Kronnect

  • Administrator
  • Hero Member
  • *****
  • Posts: 4843
    • View Profile
Re: Snow showing as black on build
« Reply #11 on: February 08, 2019, 10:26:23 AM »
Try latest version from the beta board. This update handles LODGroup renderers.

Cronos

  • Newbie
  • *
  • Posts: 12
    • View Profile
Re: Snow showing as black on build
« Reply #12 on: February 10, 2019, 04:23:43 PM »
Hi there,

Thanks for making a new beta. I had just tried it, but the shadows by LODGroup still show up.

I saw that the "UpdateLODMaterials" is called on all LODGroups found on UpdateScene(), but UpdateScene is not called for "Deferred" on UpdatePropertiesNow().

So I tried forcing call UpdateScene anyway, but while debugging UpdateLODMaterials it seems it does not fall on any relevant 'if'.

The shadow issue on LODGroup is only visible on animated characters, as they move around its parts. Static objects I think their "shadow"  won't be visible. So I'm thinking in turning off the LODGroups just for the characters for now in case it's expensive to rebuild the command buffer every time the LOD level is changed like you mentioned.

Kronnect

  • Administrator
  • Hero Member
  • *****
  • Posts: 4843
    • View Profile
Re: Snow showing as black on build
« Reply #13 on: February 11, 2019, 01:31:46 AM »
UpdateLODMaterials is used in forward rendering path.

What is changed is the GlobalSnowIgnoreCoverage script. If you add this script to the root object of your character (the gameobject with the LODGroup component) it will detect then the LOD changes on your character and it will call RefreshExcludedObjects on GlobalSnow which triggers a command buffer rebuild.

Cronos

  • Newbie
  • *
  • Posts: 12
    • View Profile
Re: Snow showing as black on build
« Reply #14 on: February 18, 2019, 04:21:05 PM »
Hi Kronnect,

Thanks for the LOD solution.

I made a new build here and got the original issue of this topic. :o

You can see a comparison picture attached (Unity Editor vs Build). Any clue what that might be? I can make new tests if you have ideas.