Light created at runtime is not lighting objects.

Hi, I’m using Hybrid Renderer 0.11.0 and URP 10.3.2 in 2020.2.7.

There is a problem when I instantiate prefab entity with light components: the instantiated light is not lighting the instantiated mesh.

If I create a new gameobject in editor in playmode, it could be lit though.

If not using URP, light is working correctly.

I don’t know it’s a URP problem or Hybrid Renderer problem. Hope someone could help me?

This is prefab conversion code:

    /// <summary>  </summary>
    public class LightEffectAuthoring : AtomEffectAuthoring, IConvertGameObjectToEntity
    {
        public void Convert(Entity entity, EntityManager dstManager, GameObjectConversionSystem conversionSystem)
        {
            var light = GetComponent<Light>();
            conversionSystem.AddHybridComponent(light);
            dstManager.AddComponentData(entity, new EffectControlledBy { });
            dstManager.AddComponentData(entity, new LightController { });
            dstManager.AddComponentData(entity, new LightEffect { });
        }
    }

The problem only exists in Hybrid_Renderer_V2, so it should be a specific problem related with hybrid renderer, not URP.

The answer is here.
Hybrid Renderer V2 (0.4.0) page-13#post-6921170

Additional Information:

Hybridv2 has not supported point lights since forever(been waiting for probably a year now? But after reading Jussi’s answer, I tried out the current master branch of the universal package(and also subsidiary packages, core, vfxgraph and shadergraph).

I can happily report that point lights and shadows are working flawlessly in deferred now and it was basically a drop in replacement and just switching a dropdown menu from forward to deferred in the what was previously called the ForwardRenderData asset of your universal pipeline settings file.

If you are impatient like me, its worth a try as it feels very solid. Otherwise I am unsure when it will be released officially as a package, but it appears as if its just around the corner(at least in terms of dots timeframes).

(Note this is also using the current latest alpha editor release, which I assume the universal requires)

1 Like

It appears that this is still the case?
Can you confirm which versions of things you are using?

I assume its at least Unity version 2021 to get the latest URP so sounds like a 0.51 thing (hopefully)

@krooq Sadly this was using a beta(could’ve been an alpha) version of 2021, and something in a later editor release broke compatibility with the prior entities package. I downgraded to 2020 like most others after a bunch of hemming and hawing.
Unfortunately its been just a directional light for me ever since, practically the stone ages of graphics :wink:

2 Likes