Unable to add Unity lights at runtime without crash

Forums: Unable to add Unity lights at runtime without crash
A public forum for discussing and asking questions about the Octane for Unity Alpha

Moderator: ChrisHekman

Unable to add Unity lights at runtime without crash

Postby jpetty7317 » Tue Oct 01, 2019 9:02 pm

jpetty7317 Tue Oct 01, 2019 9:02 pm
Hi again,

It seems, unless I'm missing something (very well could be), that it is not possible to add new lights to the scene while in Play Mode. without causing an 'All GPUs failed' error, forcing a full reinstall of the plugin. This, for one is very frustrating and the reinstall process makes iteration incredibly slow, but the whole thing seems to stem only from lights added to the scene AFTER entering Play Mode. I have also found that it doesn't matter if a render has started yet or not.

Example: If I add a directional light(sun) to the scene in Edit Mode, enter Play Mode and Render, it works like a charm. I can even then update individual properties of the light at runtime and it just rolls along smoothly updating the preview. However, if i were to tell a script to make an identical light on start or something or after a button click in Play Mode, it will crash the render.

As I noted above, The render will crash even if it hasn't been kicked off when the new lights are added. So if I had all of the lights created on start, no Render(or Preview) happening at all, and then clicked the Render Button on the PBRRenderTarget, it would crash.

This is a pretty big issue for us as all of the renders we need to do need to be done at runtime, and each new render will be an arbitrary space that we must calculate unique light placement for on the fly. Of course for the sun we can just embed and manipulate it, but for things like spot and area lights, we're essentially dead in the water. Below is a url to a vimeo video of the above issue taking place so you can see it in action in a very basic scene. Thank you in advance for any insight into this issue and what we might be able to do to remedy it.

Unity v2019.2.5f1
Octane Plugin v1.2.0.1376
Renderer v2019.1(6000100)

https://vimeo.com/363663280
jpetty7317
 
Posts: 15
Joined: Fri Sep 20, 2019 1:32 pm

Re: Unable to add Unity lights at runtime without crash

Postby ChrisHekman » Tue Oct 08, 2019 2:56 pm

ChrisHekman Tue Oct 08, 2019 2:56 pm
Reinstall? I hope you mean a reload?

I tested creating (directional) lights from code and it seems to work with the latest version.

Code i used for testing:
Code: Select all
   void Start () {
        var light = gameObject.AddComponent<Light>();
        light.type = LightType.Directional;
    }

Is this basically what you are doing?

can you share your scene?
ChrisHekman
OctaneRender Team
OctaneRender Team
 
Posts: 969
Joined: Wed Jan 18, 2017 3:09 pm

Return to Octane for Unity


Who is online

Users browsing this forum: No registered users and 9 guests

Fri Apr 19, 2024 4:04 am [ UTC ]