Hybrid Renderer (0.11.0-preview.43) change list

Last week we pushed a big bugfix update to the hybrid renderer. The new hybrid renderer package is live now. The URP package is in final test and shipping soon. HDRP package didn’t need bug fixing.

Hybrid Renderer is tested with 2020.3 LTS version. Please don’t update yet to 2021 based Unity tech stream.

Hybrid Renderer (0.11.0-preview.43):

  • Fixed a bug (stability): Memory leak with async fences in data upload
  • Fixed a bug (stability): Out of bounds access in renderer chunk metaentity query
  • Fixed a bug (stability): Renderer had structural changes outside StructuralChangePresentationSystemGroup
  • Fixed a bug: NaN inverse matrix when x/y/z scale is 0 → NaN pixels rendered
  • Fixed a bug: MaterialColor wrong color (was in gamma color space)
  • Fixed a bug: RenderMeshUtility.AddComponents spawned entities have no ambient light (didn’t add SH probe components)
  • Fixed a bug: Entities culled incorrectly at frustum edges
  • Fixed a bug: Entities not rendering past -32785 units on the X Axis
  • Missing bugfix note (stability): Out of bound access because of stale LOD bitfield
  • Missing bugfix note: LodRequirement component refactoring. Up to 2x perf improvement in LODRequirementSystem job

URP (10.5.1):

  • Fixed a showstopper bug: URP/Lit shader incompatible with SRP Batcher (no rendering)
  • Fixed a bug: Environment reflection multiplier was not used (always full bright)
9 Likes
  • Fixed a bug: Entities not rendering past -32785 units on the X Axis

I’ve downloaded .43 version, but FrustrumPlanes.cs still contains that constant:

 // Populate the remaining planes with values that are always "in"
            for (int i = cullingPlaneCount; i < 4 * packetCount; ++i)
            {
                var p = planes[i >> 2];
                p.Xs[i & 3] = 1.0f;
                p.Ys[i & 3] = 0.0f;
                p.Zs[i & 3] = 0.0f;
                p.Distances[i & 3] = 32786.0f; //float.MaxValue;
                planes[i >> 2] = p;
            }

Or this is expected and changelog mention another bug?

Hi @SebastianAaltonen . Seems like the fix is not inside 0.11.0-preview.43. Is that planned at next release for the following issue? Unity Issue Tracker - [Hybrid Renderer] Error is spamming to the console when RenderMesh component is removed at Authoring

Upon investigating this a bit, it turns out that the fix to this X axis culling problem came in just a bit too late to make the release, but we are working on getting that fix public shortly.

I think this issue should be fixed with the description.

  • Fixed a bug (stability): Out of bounds access in renderer chunk metaentity query

I just double checked, and a fresh download of hybrid.renderer 0.11.0-preview.43 should contain the fix for this issue. If the problem is still happening for you in the fixed version, then please let us know.

0.11.0-preview.44 is released! Includes the missing X axis culling fix.

That was quick! Thank you very much.

Hmm, 0.11.0-preview.44 is spamming such error for me when I destroy entity with LODs:

IndexOutOfRangeException: Index 29 is out of range of '29' Length.
Unity.Collections.NativeArray`1[T].FailOutOfRangeError (System.Int32 index) (at /Users/bokken/buildslave/unity/build/Runtime/Export/NativeArray/NativeArray.cs:286)
Unity.Collections.NativeArray`1[T].CheckElementReadAccess (System.Int32 index) (at /Users/bokken/buildslave/unity/build/Runtime/Export/NativeArray/NativeArray.cs:129)
Unity.Collections.NativeArray`1[T].get_Item (System.Int32 index) (at /Users/bokken/buildslave/unity/build/Runtime/Export/NativeArray/NativeArray.cs:154)
Unity.Rendering.SimpleCullingJob.Execute (Unity.Entities.ArchetypeChunk archetypeChunk, System.Int32 chunkIndex, System.Int32 firstEntityIndex) (at Library/PackageCache/com.unity.rendering.hybrid@0.11.0-preview.44/Unity.Rendering.Hybrid/HybridV2Culling.cs:351)
Unity.Entities.JobChunkExtensions+JobChunkProducer`1[T].ExecuteInternal (Unity.Entities.JobChunkExtensions+JobChunkWrapper`1[T]& jobWrapper, System.IntPtr bufferRangePatchData, Unity.Jobs.LowLevel.Unsafe.JobRanges& ranges, System.Int32 jobIndex) (at Library/PackageCache/com.unity.entities@0.17.0-preview.42/Unity.Entities/IJobChunk.cs:386)
Unity.Entities.JobChunkExtensions+JobChunkProducer`1[T].Execute (Unity.Entities.JobChunkExtensions+JobChunkWrapper`1[T]& jobWrapper, System.IntPtr additionalPtr, System.IntPtr bufferRangePatchData, Unity.Jobs.LowLevel.Unsafe.JobRanges& ranges, System.Int32 jobIndex) (at Library/PackageCache/com.unity.entities@0.17.0-preview.42/Unity.Entities/IJobChunk.cs:353)

I think it was fixed in one of previous releases and now reappeared

I confirmed that the fix is still there in the preview.44 package.

HybridV2RenderSystem.cs line 697 should be “bool lodRangeChange =”. That’s the first line of the fix.

Thanks for the report. I just found another bug related to that. If the camera hasn’t moved at all, the LOD bitfield can remain stale, because it will skip the whole LOD bitfield update job.

I did further investigation for the bug. The LOD bitfield getting stale when camera is not moving requires a bit more work. We will fix it to the next major package drop. Meanwhile, you should just ignore the logged error in the editor. When you move the camera for the next time, the error should disappear.

@SebastianAaltonen This is not editor-only and is not triggered by camera moving/not-moving but rather by entity with LOD being destroyed. Additionally to spamming error in the console all other entities with LODs start to disappear and re-appear randomly so it is rather hard to ignore :slight_smile: Mind that this does not happen in preview.42 and only started to happen in preview.43

Is there any ETA for URP 10.5.1?

I get this error when delete lod.

IndexOutOfRangeException: Index 9 is out of range of '9' Length.
Unity.Collections.NativeArray`1[T].FailOutOfRangeError (System.Int32 index) (at <fb9e9edf4fb847e79e36cf0fdffedf7f>:0)
Unity.Collections.NativeArray`1[T].CheckElementReadAccess (System.Int32 index) (at <fb9e9edf4fb847e79e36cf0fdffedf7f>:0)
Unity.Collections.NativeArray`1[T].get_Item (System.Int32 index) (at <fb9e9edf4fb847e79e36cf0fdffedf7f>:0)
Unity.Rendering.SimpleCullingJob.Execute (Unity.Entities.ArchetypeChunk archetypeChunk, System.Int32 chunkIndex, System.Int32 firstEntityIndex) (at Library/PackageCache/com.unity.rendering.hybrid@0.11.0-preview.44/Unity.Rendering.Hybrid/HybridV2Culling.cs:351)
Unity.Entities.JobChunkExtensions+JobChunkProducer`1[T].ExecuteInternal (Unity.Entities.JobChunkExtensions+JobChunkWrapper`1[T]& jobWrapper, System.IntPtr bufferRangePatchData, Unity.Jobs.LowLevel.Unsafe.JobRanges& ranges, System.Int32 jobIndex) (at Library/PackageCache/com.unity.entities@0.17.0-preview.41/Unity.Entities/IJobChunk.cs:386)
Unity.Entities.JobChunkExtensions+JobChunkProducer`1[T].Execute (Unity.Entities.JobChunkExtensions+JobChunkWrapper`1[T]& jobWrapper, System.IntPtr additionalPtr, System.IntPtr bufferRangePatchData, Unity.Jobs.LowLevel.Unsafe.JobRanges& ranges, System.Int32 jobIndex) (at Library/PackageCache/com.unity.entities@0.17.0-preview.41/Unity.Entities/IJobChunk.cs:353)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)

@linfuqing It seems that it is the same one I pasted few comments above

This bug has not been fixed in preview.44:-(

Hello,when will this problem be fixed?

Any news on LOD fix?

Or any temporary solutions? @SebastianAaltonen

Yeah, HLOD issues is really annoying and I didn’t manage to find any workarounds. It should also be fairly easy to reproduce. They should add some HLOD example with a spawner spawning some HLODed prefabs and not only static scenes. Below is a GIF showing the issue. The cause is obviously not camera being stationary and it also happens in standalone builds:
spiritedperfectcowbird

Hey, I’m at all not certain whether we’re dealing with the same issue here, but I’ve had LOD issues that I ended up hacking away by changing the camera FOV slightly (±0.0001f) each frame. It’s the ugliest code I wrote all year, but works like magic.