I am having an issue on LOD entities when removing them which creates the following error:
Error Exception
IndexOutOfRangeException: Index 7 is out of range of ā6ā Length.
Unity.Collections.NativeArray1[T].FailOutOfRangeError (System.Int32 index) (at <e414e10bfe5f45729ff122f3359de21b>:0) Unity.Collections.NativeArray1[T].CheckElementReadAccess (System.Int32 index) (at :0)
Unity.Collections.NativeArray`1[T].get_Item (System.Int32 index) (at :0)
Unity.Rendering.SimpleCullingJob.Execute (Unity.Entities.ArchetypeChunk archetypeChunk, System.Int32 chunkIndex, System.Int32 firstEntityIndex) (at Library/PackageCache/com.unity.rendering.hybrid@0.10.0-preview.21/Unity.Rendering.Hybrid/HybridV2Culling.cs:344)
When this happens everything that is being rendered through Hybrid V2 stops rendering until switching between the game window and the Scene window or executing DOTS>Hybrid Renderer> Recreate all batches.
(you can see all the drones disappear at once)
It occurs at like 344 in the HybridV2Culling.cs class :
obviously trying to use an index that no longer exists. When putting an if finalIndex < length it works, but since it is managed it gets reset each time it rebuilds after.
Hello! If you can still repro the issue, please submit a bug report with a repro case so that we can investigate it.
Also make sure that the bug is actually reproducible using the latest Hybrid Renderer package version, which is currently 0.11.0-preview.44.
Thanks!
it went away while changing code that removed and added many entities with renderers, it was on the latest build but i cant repo it and still dont really know what was wrong.
Hi there. I got the same issue. Iām using the current 0.11.0-preview.44 Version.
It looks like it is happening, when one mesh of the group leaving the visible area.
In the time where the bug appears, there were no entities created or destroyed, but they might get some components.
I donāt get this code there⦠Couldnāt an easy check help there?
Update: I could reproduce it with a simple scene: Create 2 Entities with LOD Groups and renderer below and a camera moving away from them, so just 1 of the entity is visible. Also add a system that randomly add or removes a component, so the entities changing the chunk. When 1 box become visible, the exception occurs.
=> Happens when the entities changing the chunk.
I couldnāt create a new project for that. Didnāt do that for years and seems the entities package and stuff is not there. Here all the needed files.
TestScene:
Needed Script:
using UnityEngine;
using Unity.Entities;
using Unity.Jobs;
public class AnimateGameObject : MonoBehaviour {
public Vector3 speed = Vector3.left;
void Update() {
transform.localPosition += Time.deltaTime * speed;
}
}
public class TestSystem : JobComponentSystem {
protected override JobHandle OnUpdate(JobHandle inputDeps) {
var entities = EntityManager.GetAllEntities(Unity.Collections.Allocator.Temp);
foreach (var e in entities) {
if (Random.value > 0.5f) {
if (EntityManager.HasComponent<Dirty>(e))
EntityManager.RemoveComponent<Dirty>(e);
else
EntityManager.AddComponentData(e, new Dirty());
}
}
entities.Dispose();
return inputDeps;
}
}
Another update:
Partial good News: I tested it in the compiled version and it looks fine so far. So i guess its just happening in the editor. I have BURST OFF in the Editor. Maybe it has something to do with that?
We have a report for something similar to this already and will try to look at it shortly.
But please report errors using the bug reporter, itās much easier to ensure everything is getting tracked that way.
Ok, thanks. @optimise : I tried that already, but i would take a long time to setup a project for that simple file, to configure everything it has to be. I tried it, but after 1h to figure out the packages (that are not shown sometimes, due to preview) try to setup i stopped with itā¦
I did that for another report and spend also half a day on it, but this failed processing, due to its not a ārun and brokenā.
It sometimes looks like we have to do 99% of the developer work, before they even consider to start to looking at it.
Sry, i canāt spend half my working day to report a bug in that way. I already spend a day to analyse the unity code that caused the problem and added the scripts needed to reproduceā¦
Any updates on this Topic? I experience now more and more issues with that topic. Also rendering bugs of Meshes that should not be shown anymore, related to that bug and LOD Levels and ALSO in the compiled versionā¦
It might not be the same bug even if the callstacks looks similar. And I see if I can get it to repo.
I would suggest you report it as a bug through the regular bug tracking system to be honest, it makes is much easier for both you and us to track things.
As i said, last time i spend a lot of time to do that and the result was, that it was not even going to the developers⦠This time i also tried to setup a new game to make it work, but it wasnāt possible, due to the packages were not shown and i needed to setup all of the experimental packages again to get it work in a clean environment⦠If you have an EASY and fast way, that not cost hours to report a bug, i can try that again.
Again: For me it takes half a day to set it up, to save you 1 min of copy paste the 3 files and press a button⦠This will not going to happen⦠Iām happy to help you, but not spending hours to save you a minute of work⦠So my only way for me is to hope, that a bigger customer gets to use this technology and pushes your management to fix thatā¦
For the bug: I ment the bug you work in this sprint, just link it >>HERE<<, so we know, what bug you mean and see when its fixed to retest
The bug is internal and not visible in the public issue tracker.
Itās not about wasting time. Itās about tracking what needs to be done, prioritization and backports of fixes.
But I will try to test your example during this work
@StefanWo Ping again. Do you happen to have the test scene locally so you can upload it again?
I have been looking at another LOD group problem but itās specific to Live Link only and so far I have no reproduction cases where an exception like this happens when modifying things from code.
No, donāt have it anymore. But it is actually just:
the TestSystem above run
add 2 rendered similar entities with LOD Groups
than move the camera from āboth visibleā to āonly oneā visible, to trigger the āPartial visibleā culling mode.