nixon-voxell / URPVolumetricLighting

Volumetric Lighting in URP
Apache License 2.0
144 stars 15 forks source link

Directional light causes all objects in the scene to be black #5

Open MooKorea opened 1 year ago

MooKorea commented 1 year ago

I upgraded my Unity project to version to 2022.3.8 LTS to support this feature, however it does not appear to work as intended. With one directional light as well as the render feature enabled, all of the objects in the scene render as solid black.

To Reproduce

  1. Create a new 2022.3.8 Unity project with URP installed
  2. Add the URPVolumetricLighting package and enable the render feature
  3. Add any 3D object to the scene, they should render as black with all of the default URP settings

image

Note: All of the other light sources appear to work fine, but when the directional light is enabled the problem occurs.

prismspecs commented 1 year ago

How are you "enabling the render feature" btw?

lmsonic commented 12 months ago

Can confirm this as well, I get this error when I enable the renderer feature in Universal Render Data settings.

NullReferenceException: Object reference not set to an instance of an object
Voxell.VolumetricLighting.VolumetricLightScatteringPass..ctor (UnityEngine.Material occludersMaterial, UnityEngine.Material radialBlurMaterial, Voxell.VolumetricLighting.VolumetricLightScattering+Settings settings) (at ./Library/PackageCache/voxell.urp.volumetriclighting@f85d80ad44/Runtime/VolumetricLightScattering/VolumetricLightScatteringPass.cs:38)
Voxell.VolumetricLighting.VolumetricLightScattering.Create () (at ./Library/PackageCache/voxell.urp.volumetriclighting@f85d80ad44/Runtime/VolumetricLightScattering/VolumetricLightScattering.cs:41)
UnityEngine.Rendering.Universal.ScriptableRendererFeature.OnEnable () (at ./Library/PackageCache/com.unity.render-pipelines.universal@14.0.8/Runtime/ScriptableRendererFeature.cs:48)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)

The error is in this line 38 of VolumetricLightScatteringPass.cs, idk seems like RTHandles default instance is null?

      this._occluderTarget = RTHandles.Alloc(
        Mathf.Max(1, (int)(Screen.width*_settings.resolutionScale)),
        Mathf.Max(1, (int)(Screen.height*_settings.resolutionScale)),
        depthBufferBits: DepthBits.None
      );
robertvalentic commented 11 months ago

Any fix for this yet?

CiaranSimpson commented 11 months ago

im also having this issue, same error as what Imsonic had. Im running 2023.1.12f1, URP version 15.0.6.