Placeholder-Software / WetSurfaceDecals

14 stars 2 forks source link

[bug] WetStuff complains about camera render path being set to Forward #19

Closed TomGillen closed 4 years ago

TomGillen commented 4 years ago

Reported via Discord by Edward.

Error logged when exiting play mode:

[WetStuff:Graphics] (11:55:57.607) WetStuff: Camera rendering path is 'Forward', expected 'DeferredShading'
UnityEngine.Debug:LogError(Object)
PlaceholderSoftware.WetStuff.Debugging.LogMessage:Log() (at Assets/Plugins/PlaceholderSoftware/WetStuff/Core/Debugging/Log.cs:129)
PlaceholderSoftware.WetStuff.Debugging.Logs:SendLogMessage(String, LogLevel) (at Assets/Plugins/PlaceholderSoftware/WetStuff/Core/Debugging/Log.cs:161)
PlaceholderSoftware.WetStuff.Debugging.Log:WriteLog(LogLevel, String) (at Assets/Plugins/PlaceholderSoftware/WetStuff/Core/Debugging/Log.cs:252)
PlaceholderSoftware.WetStuff.Debugging.Log:WriteLogFormat(LogLevel, String, RenderingPath) (at Assets/Plugins/PlaceholderSoftware/WetStuff/Core/Debugging/Log.cs:270)
PlaceholderSoftware.WetStuff.Debugging.Log:Error(String, RenderingPath) (at Assets/Plugins/PlaceholderSoftware/WetStuff/Core/Debugging/Log.cs:430)
PlaceholderSoftware.WetStuff.WetStuff:Startup() (at Assets/Plugins/PlaceholderSoftware/WetStuff/WetStuff.cs:39)
PlaceholderSoftware.WetStuff.WetStuff:OnEnable() (at Assets/Plugins/PlaceholderSoftware/WetStuff/WetStuff.cs:82)
UnityEngine.GameObject:AddComponent(Type)
UnityEditorInternal.ComponentUtility:ReplaceComponentsIfDifferent(GameObject, GameObject, IsDesiredComponent) (at C:/buildslave/unity/build/Editor/Mono/ComponentUtility.cs:60)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr) (at C:/buildslave/unity/build/Modules/IMGUI/GUIUtility.cs:179)

And this exception found in the log of a build player, but seeminly not in editor:

ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
  at System.ThrowHelper.ThrowArgumentOutOfRangeException (System.ExceptionArgument argument, System.ExceptionResource resource) [0x00029] in <e1319b7195c343e79b385cd3aa43f5dc>:0 
  at System.ThrowHelper.ThrowArgumentOutOfRangeException () [0x00000] in <e1319b7195c343e79b385cd3aa43f5dc>:0 
  at System.Collections.Generic.List1[T].get_Item (System.Int32 index) [0x00009] in <e1319b7195c343e79b385cd3aa43f5dc>:0 
  at System.Collections.ObjectModel.ReadOnlyCollection1[T].get_Item (System.Int32 index) [0x00000] in <e1319b7195c343e79b385cd3aa43f5dc>:0 
  at PlaceholderSoftware.WetStuff.WetDecalRenderer+DecalBatch.DrawInstanced (UnityEngine.Rendering.CommandBuffer cmd, System.ArraySegment`1[T] visible, System.Int32 shaderPass) [0x0028e] in F:\Project\Assets\Plugins\PlaceholderSoftware\WetStuff\Core\WetDecalRenderer.cs:186 
  at PlaceholderSoftware.WetStuff.WetDecalRenderer+DecalBatch.Draw (UnityEngine.Rendering.CommandBuffer cmd, System.Int32 distanceBand, System.Int32 shaderPass) [0x0004e] in F:\Project\Assets\Plugins\PlaceholderSoftware\WetStuff\Core\WetDecalRenderer.cs:100 
  at PlaceholderSoftware.WetStuff.WetDecalRenderer+DecalBatch.PrepareDraw (UnityEngine.Rendering.CommandBuffer cmd) [0x0001a] in F:\Project\Assets\Plugins\PlaceholderSoftware\WetStuff\Core\WetDecalRenderer.cs:86 
  at PlaceholderSoftware.WetStuff.WetDecalRenderer.RecordCommandBuffer (UnityEngine.Rendering.CommandBuffer cmd) [0x00099] in F:\Project\Assets\Plugins\PlaceholderSoftware\WetStuff\Core\WetDecalRenderer.cs:320 
  at PlaceholderSoftware.WetStuff.WetStuff.OnPreRender () [0x00018] in F:\Project\Assets\Plugins\PlaceholderSoftware\WetStuff\WetStuff.cs:110

The camera is configured to use the deferred pipeline, and these settings have not been overriden in the player graphics settings. The camera reports as having Wet Stuff's command buffers attached.

There is a disabled camera in the scene with forward rendering and a wet stuff script, but removing it does not fix the issue.

Issue tested in Unity 2018.4.18. Wet Stuff version 2.0.3.

martindevans commented 4 years ago

Version 4.0.0 has just been submitted to the store which contains fixes for these two issues. It should be live in a couple of days.

martindevans commented 4 years ago

This is now live on the asset store.