Skip to content
This repository has been archived by the owner on Dec 6, 2018. It is now read-only.

Use Case with more than 8 lights total, but less than 8 per mesh #3

Open
ghost opened this issue Aug 14, 2017 · 2 comments
Open

Use Case with more than 8 lights total, but less than 8 per mesh #3

ghost opened this issue Aug 14, 2017 · 2 comments

Comments

@ghost
Copy link

ghost commented Aug 14, 2017

I have a use case in which there are 12 lights total in the scene, but any one DaydreamMeshRenderer will have exactly 6 lights. This causes an array index error since DR keeps a sparse array. Maybe change that so the max lights per DMR is 8, but the total lights in the scene can be more than 8. I can submit a pull request for that is that works.

@dushan-google
Copy link
Contributor

Would you mind re-testing with the 1.1 release? It would also be really helpful if you can share your scene.

Thank you!

@ghost
Copy link
Author

ghost commented Sep 28, 2017

I see the same array bounds error with 1.1:

IndexOutOfRangeException: Array index is out of range.
daydreamrenderer.DaydreamLight.GetSortedLights (Int32 updateKey, Int32 layer, Boolean isStatic, Vector3 objPosition, Bounds bounds, System.Int32[]& outLightList, System.Int32& usedSlots) (at Assets/DaydreamRenderer/Scripts/DaydreamLight.cs:402)
daydreamrenderer.DaydreamMeshRenderer.ApplyLighting (Boolean lightChange) (at Assets/DaydreamRenderer/Scripts/DaydreamMeshRenderer.cs:361)
daydreamrenderer.DaydreamLightingManager.ProcessLighting (UnityEngine.Camera camera) (at Assets/DaydreamRenderer/Scripts/DaydreamLightingManager.cs:178)
UnityEngine.Camera.FireOnPreRender (UnityEngine.Camera cam) (at C:/buildslave/unity/build/artifacts/generated/common/runtime/CameraBindings.gen.cs:739)

Right now I am fixing it by upping the limits to 12 via:

       const int kMaxActiveLights = 12;
       public int m_activeLightCount = 12;

I can share my Unity project for Spin Paint, but it is about 1.7 gb. I can upload the project to the spinpaint.com web site, would that help?

I'm using:

Unity Unity 2017.1.0p5 / IL2CPP.
GVR Unity SDK 1.60
Daydream Renderer 1.0
Controller Emulator 1.5.01
Android NDK r10e
Java jdk1.8.0_111
Firebase 4.1.0

Thanks,

Reed.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant