Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice

Official Hybrid Renderer V2 (0.4.0)

Discussion in 'Graphics for ECS' started by SebastianAaltonen, Mar 16, 2020.

Thread Status:
Not open for further replies.
  1. JussiKnuuttila

    JussiKnuuttila

    Unity Technologies

    Joined:
    Jun 7, 2019
    Posts:
    351
    If it also happens in pure GameObject scenes, then it's probably an HDRP or post processing related bug or configuration issue. I don't think we have encountered this issue in the Hybrid Renderer team.
     
    BigRookGames likes this.
  2. BigRookGames

    BigRookGames

    Joined:
    Nov 24, 2014
    Posts:
    330
    I upgraded to HDRP 10 and it seems to be the same: upload_2020-10-23_13-50-56.png

    I will create a new thread since this isn't proven to be a v2 specific issue. Thanks for your help.

    ----EDIT

    I was finally able to identify the problem, it was being caused by a post-processing plugin for bloom. Now everything is back to normal! Thanks for the help along the way.
     
    Last edited: Oct 24, 2020
    Skjalg likes this.
  3. Karearea

    Karearea

    Joined:
    Sep 3, 2012
    Posts:
    386
    Massive thanks for the team's work on this. Latest V2 update is silky smooth (including in the editor) with lovely environmental lighting back again. Cheers!
     
    JussiKnuuttila likes this.
  4. jdtec

    jdtec

    Joined:
    Oct 25, 2017
    Posts:
    302
    Hi, none of my render meshes work if I enable Hybrid v2. If I create 2 identical cubes and add a convert to entity to one of them then the hybrid rendered one isn't visible.

    I thought it might be getting culled but it appears both cubes get a drawcall in the frame debugger. All the 'ShaderProperties' in the frame debugger are identical between the game object rendered cube and the hybrid one.

    Sprites still render as expected with Hybrid v2, this seems to only happen to my render meshes. Reverting to hybrid v1 gets meshes rendering again.

    Anyone have any ideas how to debug this further? Is there any additional shader debugging that I could try in Unity to diagnose why one cube doesn't appear?

    Is there any DOTs related cache stuff that could effect any of this? Hybrid v2 was working for me previously and then stopped one day seemingly at complete random to me.

    Any help appreciated. Using latest DOTs packages 2020.2 and URP.
     
    Last edited: Oct 30, 2020
  5. JussiKnuuttila

    JussiKnuuttila

    Unity Technologies

    Joined:
    Jun 7, 2019
    Posts:
    351
    Are you using a custom shader, or one of URP's built-in shader, or perhaps a Shader Graph?

    If you are using Windows, a good starting point for debugging is to take a RenderDoc capture and try to find the draw call that is supposed to draw your entities. In the case of URP, this would likely be in the Forward Opaque pass. If the draw call is missing entirely, then the problem is likely either configuration related (= some components missing or have incorrect values) or culling related (= entities are visibility culled incorrectly for some reason, like bad RenderBounds). If the draw call is there, but nothing is still showing up, then a frequent explanation is that the vertices are transformed incorrectly (usually because of some problem with loading the LocalToWorld matrix), which can be confirmed using RenderDoc's mesh view.

    If you are using Mac OS, you should be able to do a similar investigation using Xcode GPU Capture.

    Another way to try to debug would be to try to get an working entity rendered in some way. A freshly created cube (GameObject > 3D Object > Cube) using the URP Lit shader should render correctly when converted to an entity using either a subscene or ConvertToEntity and play mode. If that works, you could then try to compare the working entity with your entity using Unity's Entity Debugger, to try and find out what is the difference.
     
  6. jdtec

    jdtec

    Joined:
    Oct 25, 2017
    Posts:
    302
    Hi @JussiKnuuttila, thanks for the response.

    I upgraded OSX to Catlina and said bye to 32 bit apps. I installed Xcode and had a look at the frame capture but unfortunately didn't really find it helpful in my case. Still, useful to go through this flow and learn.

    I went back to Unity and started trying random things. Eventually I figured I could try recreating the render pipeline asset. This fixed it! I compared the two and realised I had disabled SRP batcher in my other render pipeline. Enabling this made it work for the old pipeline asset too.

    I just checked the hybrid renderer docs again and I see it says that hybrid renderer uses the SRP batcher so that's on me, I must have disabled it at somepoint, however, I would still suggest an error message at runtime or in the editor to save people time in the future if they haven't enabled the SRP batcher - what do you think?

    I then started getting errors like this:

    A Hybrid Renderer V2 batch is using a pass from the shader "Universal Render Pipeline/Simple Lit", which is not SRP batcher compatible. Only SRP batcher compatible passes are supported with the Hybrid Renderer.


    Would be nice if this provided a way to narrow it down further, or is there a way to see all materials/objects in the project using the incompatible shader? This time I solved by going through all the materials in the project manually and changing 'Simple Lit' to 'Lit'.

    Last bit of feedback is that it would be better if hybrid draw calls had more descriptive names in the 'Frame Debugger' like they do for GameObject draw calls eg. DrawRockMesh2 or DrawCube rather than DrawMesh for everything.
     
    Opeth001 likes this.
  7. Cell-i-Zenit

    Cell-i-Zenit

    Joined:
    Mar 11, 2016
    Posts:
    290
    Hybridrenderer v0.10 is out guys
     
    MNNoxMortem and BigRookGames like this.
  8. Opeth001

    Opeth001

    Joined:
    Jan 28, 2017
    Posts:
    1,112
    each time i try to close the subscene while using the Hybrid Renderer v2 by enabling the famous tag.
    i get this Error:

    Code (CSharp):
    1. Loading Entity Scene failed because the entity header file couldn't be resolved. This might be caused by a failed import of the entity scene. Please take a look at the SubScene MonoBehaviour that references this scene or at the asset import worker log in C:\UnityProjects\CWBR_Dev_URP\Logs. scenePath=Assets/Scenes/Client Scene/Client/New Sub Scene.unity guid=919f90b49ef88234b89aa49b0e408445
    2. UnityEngine.Debug:LogError (object)
    3. Unity.Debug:LogError (object) (at Library/PackageCache/com.unity.entities@0.16.0-preview.21/Unity.Entities/Stubs/Unity/Debug.cs:13)
    4. Unity.Scenes.ResolveSceneSectionUtility:ResolveSceneSections (Unity.Entities.EntityManager,Unity.Entities.Entity,Unity.Entities.Hash128,Unity.Entities.RequestSceneLoaded,Unity.Entities.Hash128) (at Library/PackageCache/com.unity.entities@0.16.0-preview.21/Unity.Scenes/ResolveSceneSectionUtility.cs:76)
    5. Unity.Scenes.ResolveSceneReferenceSystem:OnUpdate () (at Library/PackageCache/com.unity.entities@0.16.0-preview.21/Unity.Scenes/ResolveSceneReferenceSystem.cs:174)
    6. Unity.Entities.SystemBase:Update () (at Library/PackageCache/com.unity.entities@0.16.0-preview.21/Unity.Entities/SystemBase.cs:399)
    7. Unity.Entities.ComponentSystemGroup:UpdateAllSystems () (at Library/PackageCache/com.unity.entities@0.16.0-preview.21/Unity.Entities/ComponentSystemGroup.cs:435)
    8. Unity.Entities.ComponentSystemGroup:OnUpdate () (at Library/PackageCache/com.unity.entities@0.16.0-preview.21/Unity.Entities/ComponentSystemGroup.cs:387)
    9. Unity.Entities.ComponentSystem:Update () (at Library/PackageCache/com.unity.entities@0.16.0-preview.21/Unity.Entities/ComponentSystem.cs:113)
    10. Unity.Entities.ComponentSystemGroup:UpdateAllSystems () (at Library/PackageCache/com.unity.entities@0.16.0-preview.21/Unity.Entities/ComponentSystemGroup.cs:435)
    11. Unity.Entities.ComponentSystemGroup:OnUpdate () (at Library/PackageCache/com.unity.entities@0.16.0-preview.21/Unity.Entities/ComponentSystemGroup.cs:387)
    12. Unity.Entities.ComponentSystem:Update () (at Library/PackageCache/com.unity.entities@0.16.0-preview.21/Unity.Entities/ComponentSystem.cs:113)
    13. Unity.Entities.ScriptBehaviourUpdateOrder/DummyDelegateWrapper:TriggerUpdate () (at Library/PackageCache/com.unity.entities@0.16.0-preview.21/Unity.Entities/ScriptBehaviourUpdateOrder.cs:333)
    14.  
     
  9. Nordwolf

    Nordwolf

    Joined:
    Jan 15, 2014
    Posts:
    2
    Heya! All of the entities rendered with Hybrid renderer V2 + SRP Batcher appear black when using any URP lit shader or any shader graph based on the Lit material. I am using 2020.2b09 and tested this on any combination of latest URP/Hybrid renderer packages. I can't seem to find a solution and don't really want to resort to writing my own lighting in shader graph (unlit shader-material is rendered properly).

    All works fine with V1 and without SRP batcher, but I really need those as I am using hybrid gpu instanced parameters.

    (also unrelated bug with URP - SSAO comes through the transparent lit shader)
     
    Opeth001 likes this.
  10. deus0

    deus0

    Joined:
    May 12, 2015
    Posts:
    256
    Wasn't sure where to put this! but Hybrid Renderer 0.10.0 doesn't work as it requires particle system! Is it possible that unity can make it so we don't require all the default parts of unity? I like to make my own particle systems with ECS rather then use the default one! So I try to remove any default packages that I am not using but the new dependencies for 0.9.0 added created this new dependency! Thank you. (This is to get the build size down)
     
  11. Nordwolf

    Nordwolf

    Joined:
    Jan 15, 2014
    Posts:
    2
    Update to my question:
    I managed to fix it by finding two bugs in the URP/HybridRenderer

    While using HybridRenderer V2 + SRP Batcher (URP 10.1 and Hybrid 10)
    1. ShaderGraph Lit (and normal URP Lit) shader fails to supply normalWS (world space normal I suppose) to the Varyings input, and thus Lighting.hlsl just gets black (0) normalWS value
    upload_2020-11-1_15-38-27.png
    I fixed it by supplying my own WS normals in the shader

    2. Lighting.hlsl "GetMainLight()" doesn't supply distance attenuation when using hybridrenderer (returns 0)
    upload_2020-11-1_15-38-54.png
    I basically had to copy over Lighting.hlsl and modify it to always supply distance attenuation of 1.

    This is quite frustrating to say the least, since to do the above I have to modify the resulting shader-graph shaders.
    Should I submit a bug report detailing this?

    If you have any better solutions to this I would be glad to hear.
     
  12. Nyanpas

    Nyanpas

    Joined:
    Dec 29, 2016
    Posts:
    406
    Last edited: Nov 2, 2020
    deus0 likes this.
  13. JussiKnuuttila

    JussiKnuuttila

    Unity Technologies

    Joined:
    Jun 7, 2019
    Posts:
    351
    These definitely sound like bugs in Hybrid Renderer. It would be great if you could submit a bug report with a repro project!
     
  14. Opeth001

    Opeth001

    Joined:
    Jan 28, 2017
    Posts:
    1,112
    is it possible to create a component Data that overrides the Texture Offset as materail property block in hybrid V1?
    i made a System which combines all used textures with the same shader. im trying to add a Material Property Block to set the correct offset and minimize meshes diversity in subscene.
     
  15. jdtec

    jdtec

    Joined:
    Oct 25, 2017
    Posts:
    302
    I have a situation where I'm adding and removing a 'DisableRendering' component. I can see DisableRendering being added and removed for the appropriate entities in the entity debugger but the meshes/sprites will render regardless.

    Are there some situations where DisableRendering doesn't work as one might expect? Anyone else had issues or bugs with DisableRendering? Note it does appear to work for some other entities in the same transform hierarchy...

    I'm on the latest DOTs packages and 2020.2.

    EDIT: Actually this might just be it not working with converted sprite renderers, are those not supported?
     
    Last edited: Nov 3, 2020
  16. Antypodish

    Antypodish

    Joined:
    Apr 29, 2014
    Posts:
    10,768
    I can say it works for me with HRV2 0.8. But I don't use sprites.
     
  17. jdtec

    jdtec

    Joined:
    Oct 25, 2017
    Posts:
    302
    Yea it looks like it's just sprites. I might be able to use the Disabled component for this in the mean time instead.

    Previously I had issues here where the position of the entity would be in the wrong position for one frame when toggling Disabled, maybe because the LTW wasn't updated before it was enabled for rendering, however, this is not happening now.
     
    Last edited: Nov 4, 2020
  18. JussiKnuuttila

    JussiKnuuttila

    Unity Technologies

    Joined:
    Jun 7, 2019
    Posts:
    351
    I am pretty sure Hybrid V1 does not support material property blocks. The only form of supported per-object overriding in HRV1 is overriding Shader Graph properties via IComponentData marked with the MaterialProperty attribute.
     
  19. Opeth001

    Opeth001

    Joined:
    Jan 28, 2017
    Posts:
    1,112
    My question was based on the Hybrid Renderer docs page.

     
  20. tomzigza

    tomzigza

    Joined:
    Aug 4, 2017
    Posts:
    31
  21. DreamingImLatios

    DreamingImLatios

    Joined:
    Jun 3, 2017
    Posts:
    4,252
    Material Property Overrides != MaterialPropertyBlock. Support is based on whether the shader property is DOTS-Instancing compatible. You can enforce that using Shader Graph. I don't know which versions of prepackaged SRP shaders expose DOTS-Instancing compatible properties. That's your real question, in which case you need to specify the SRP package and shader you are using. Or just make a shader graph.

    That's the link to the docs, not the package itself. You need to type in:
    Code (CSharp):
    1. com.unity.rendering.hybrid
     
    Opeth001 likes this.
  22. paradoxical-jay

    paradoxical-jay

    Joined:
    Jan 28, 2020
    Posts:
    8
    I'm trying to use hybrid instancing in a custom SRP. Is this possible?

    The Hybrid Rendering package asserts that URP or HDRP 9+ is required, but I can work around that constraint easily enough with a misleading #define. However, it's unclear where the rubber meets the road here - is there anything outside of userland that will thwart hybrid instancing with a custom SRP?

    I've duplicated the essential shader machinery from HDRP for fetching the instance data, but it seems that these buffers are not being fed.

    What is the process, in core rendering API terms, to make use of hybrid instancing? Perhaps RenderGraph is a required piece of the puzzle? (I'm not using it yet)
     
  23. elJoel

    elJoel

    Joined:
    Sep 7, 2016
    Posts:
    125
    With the latest alpha 2021.1.0a4 and Hybrid Renderer 0.10.0-preview.21 I am getting the following error:
    Code (CSharp):
    1. SparseUploader.compute: Kernel at index (0) is invalid
    2. UnityEngine.StackTraceUtility:ExtractStackTrace ()
    3. Unity.Rendering.SparseUploader:DispatchUploads (int,UnityEngine.ComputeBuffer) (at Library/PackageCache/com.unity.rendering.hybrid@0.10.0-preview.21/Unity.Rendering.Hybrid/SparseUploader.cs:444)
    4. Unity.Rendering.SparseUploader:EndAndCommit (Unity.Rendering.ThreadedSparseUploader) (at Library/PackageCache/com.unity.rendering.hybrid@0.10.0-preview.21/Unity.Rendering.Hybrid/SparseUploader.cs:463)
    5. Unity.Rendering.HybridRendererSystem:EndUpdate () (at Library/PackageCache/com.unity.rendering.hybrid@0.10.0-preview.21/Unity.Rendering.Hybrid/HybridV2RenderSystem.cs:3143)
    6. Unity.Rendering.HybridRendererSystem:OnUpdate (Unity.Jobs.JobHandle) (at Library/PackageCache/com.unity.rendering.hybrid@0.10.0-preview.21/Unity.Rendering.Hybrid/HybridV2RenderSystem.cs:1690)
    7. Unity.Entities.JobComponentSystem:Update () (at Library/PackageCache/com.unity.entities@0.16.0-preview.21/Unity.Entities/JobComponentSystem.cs:130)
    8. Unity.Entities.ComponentSystemGroup:UpdateAllSystems () (at Library/PackageCache/com.unity.entities@0.16.0-preview.21/Unity.Entities/ComponentSystemGroup.cs:435)
    9. Unity.Entities.ComponentSystemGroup:OnUpdate () (at Library/PackageCache/com.unity.entities@0.16.0-preview.21/Unity.Entities/ComponentSystemGroup.cs:387)
    10. Unity.Entities.ComponentSystem:Update () (at Library/PackageCache/com.unity.entities@0.16.0-preview.21/Unity.Entities/ComponentSystem.cs:113)
    11. Unity.Entities.ScriptBehaviourUpdateOrder/DummyDelegateWrapper:TriggerUpdate () (at Library/PackageCache/com.unity.entities@0.16.0-preview.21/Unity.Entities/ScriptBehaviourUpdateOrder.cs:333)
    12.  
     
  24. paradoxical-jay

    paradoxical-jay

    Joined:
    Jan 28, 2020
    Posts:
    8
    I was able to resolve the main problem by enabling SRP Batcher in my render pipeline.

    I'm sure it has been said many times, but these sorts of interdependencies could be better documented! (I don't see any mention of hybrid rendering in documentation for SRP Batcher or vice-versa.) This dependency seems obvious in retrospect, but it's easy to overlook a crucial bool when starting from scratch, and using HDRP/URP implementations as reference is not as helpful as it might seem due to their complexity.
     
    florianhanke and jdtec like this.
  25. Stroustrup

    Stroustrup

    Joined:
    May 18, 2020
    Posts:
    142
    is there any eta for when skinned characters will work with light probes?

    or am i missing an extra step?

    also there seems to be a bug where the character is only rendered when his rotation is between 0 and 180, otherwise he's not renderered
     

    Attached Files:

    • sdg.png
      sdg.png
      File size:
      80.3 KB
      Views:
      358
    • sdg.png
      sdg.png
      File size:
      138.9 KB
      Views:
      2,925
    Last edited: Nov 9, 2020
  26. joelv

    joelv

    Unity Technologies

    Joined:
    Mar 20, 2015
    Posts:
    203
    Do you have a compilation error for the compute shader (SparseUploader.compute) ?
     
  27. nobeerleft

    nobeerleft

    Joined:
    Mar 29, 2012
    Posts:
    27
    I am getting exceptions thrown from SimpleCullingJob as well, any time I delete an entity with LODs. Looks like the SRP Batcher is not being updated correctly when entities get deleted and it tries to cull them.
     
  28. nobeerleft

    nobeerleft

    Joined:
    Mar 29, 2012
    Posts:
    27
    Defenitely a Batcher problem, if you Use the DOTS > Hybrid Renderer > Recreate All Batches menu item while it is spitting out exceptions, the exception stops for a while, until the next time an entity is removed from a chunk. Only happens if there is more than one chunk of LOD child entities.
     
  29. elJoel

    elJoel

    Joined:
    Sep 7, 2016
    Posts:
    125
    I deleted the whole Library folder, reimported everything now the problem is gone ¯\_(ツ)_/¯.

    The next problem I have is that LODs are gone after conversion. I'll try to reproduce that in a simple project.
     
  30. elJoel

    elJoel

    Joined:
    Sep 7, 2016
    Posts:
    125
    Very wierd I had an Editor Script called TagEd that caused the LODs to disappear after conversion. Removing it fixed the problem.
     
  31. temps12

    temps12

    Joined:
    Nov 28, 2014
    Posts:
    41
    We got some errors when updating to the new version. A few shaders got an error and the affected entities didn't render.

    A Hybrid Renderer V2 batch is using a pass from the shader "Shader Graphs/Shader", which is not SRP batcher compatible. Only SRP batcher compatible passes are supported with the Hybrid Renderer.

    I made a reproducible case: 1291576 @JussiKnuuttila
     
  32. nobeerleft

    nobeerleft

    Joined:
    Mar 29, 2012
    Posts:
    27
    Changing line 155 of HybridV2Culling.cs to
    Code (CSharp):
    1. float graceDistance = 0.0f;
    Fixes all the issues with LODs (including the crash on line 344)

    Essentially this disables the gracedistance feature of the LOD/Culling. It also fixes the problem where you have to wiggle the camera to get LODs to appear. Doesnt seem to have much of a performance impact.
     
  33. Onigiri

    Onigiri

    Joined:
    Aug 10, 2014
    Posts:
    477
    I am on HR 0.10.0 v.2, HDRP 10.1, Unity 2020.2 and ambient still doesnt work. It's working in scene view but in play mode or build ambient is black. What do i need to do?
     
    Last edited: Nov 10, 2020
  34. JussiKnuuttila

    JussiKnuuttila

    Unity Technologies

    Joined:
    Jun 7, 2019
    Posts:
    351
    As far as I know, it should be possible to use Hybrid Renderer V2 with a custom SRP, but getting all the shader machinery right can be tricky. There's also the define you already discovered, but that is workaroundable as you said.

    The Hybrid Renderer runtime shouldn't make any SRP-related assumptions. The GameObject conversion has some hardcoded things to add some components that override URP and HDRP properties, but that isn't anything you couldn't replicate yourself in a custom SRP.

    To get shaders to work, you will need to include the UnityDOTSInstancing.hlsl header which is in the SRP package. HRV2 looks for DOTS instanced property definitions, which are defined using UNITY_DOTS_INSTANCED_PROP macros. Any properties that need to have per-entity unique values (such as transform matrices) need to be defined like this. As an example, I would suggest looking at URP Input.hlsl and LitInput.hlsl.

    In addition, all HRV2 compatible shaders must use shader model 4.5 (i.e. #pragma target 4.5) and must have #pragma multi_compile _ DOTS_INSTANCING_ON so the HRV2 compatible variants will be compiled.
     
  35. JussiKnuuttila

    JussiKnuuttila

    Unity Technologies

    Joined:
    Jun 7, 2019
    Posts:
    351
    Thank you for the bug report!

    I would advise you to check if there is something in your shader graph that leads to constant buffer definitions being different in different passes, as this is not supported by SRP batcher. This could be something like a node producing #ifdefs inside constant buffer definitions.
     
  36. JussiKnuuttila

    JussiKnuuttila

    Unity Technologies

    Joined:
    Jun 7, 2019
    Posts:
    351
    The "Material property overrides" row in the docs refers specifically to MaterialProperty IComponentDatas being able to override shader properties. In Hybrid Renderer V1 this is supported, but only for shader graph properties that are explicitly set as "Hybrid instanced (experimental)". In Hybrid Renderer V2 this feature is more general, and can also be used in custom text shaders.
     
    Opeth001 likes this.
  37. temps12

    temps12

    Joined:
    Nov 28, 2014
    Posts:
    41
    That's great to know, thanks! In this case I found what it was, I wrote it in the bug report. It was a combination of using the HDRP Lit shader with Translucent or Subsurface scattering material type and that changed the vertex position with a property. That made at least the DepthOnly pass get inconsistent buffer size. So the root problem might be on the HDRP or shader graph team, just that the hybrid renderer treats it as an actual error.
     
  38. nobeerleft

    nobeerleft

    Joined:
    Mar 29, 2012
    Posts:
    27
    I am in the same boat. Everything is black once you are out of direct light. Same versions of everything. I had understood GI Ambient was working, but it seems not.
     
    snacktime and SebLazyWizard like this.
  39. No3371

    No3371

    Joined:
    Dec 1, 2016
    Posts:
    42
    With HR 0.8.0 on 2020.1.10, I got some severe errors, things are busy on the screen so I'm not sure if it's caused by entities getting destroyed.

    IndexOutOfRangeException: Index 0 is out of restricted IJobParallelFor range [135...135] in ReadWriteBuffer.
    ReadWriteBuffers are restricted to only read & write the element at the job index. You can use double buffering strategies to avoid race conditions due to reading & writing in parallel to the same elements from a job.

    Unity.Collections.NativeArray`1[T].FailOutOfRangeError (System.Int32 index) (at <052502435982472d92da7f939c7f8164>:0)
    Unity.Collections.NativeArray`1[T].CheckElementWriteAccess (System.Int32 index) (at <052502435982472d92da7f939c7f8164>:0)
    Unity.Collections.NativeArray`1[T].set_Item (System.Int32 index, T value) (at <052502435982472d92da7f939c7f8164>:0)
    Unity.Rendering.HybridChunkUpdater.DeferNewChunk (Unity.Rendering.HybridChunkInfo& chunkInfo, Unity.Entities.ArchetypeChunk chunk) (at Packages/com.unity.rendering.hybrid@0.8.0-preview.19/Unity.Rendering.Hybrid/HybridV2RenderSystem.cs:327)
    Unity.Rendering.HybridChunkUpdater.ProcessChunk (Unity.Rendering.HybridChunkInfo& chunkInfo, Unity.Entities.ArchetypeChunk chunk, Unity.Rendering.ChunkWorldRenderBounds chunkBounds) (at Packages/com.unity.rendering.hybrid@0.8.0-preview.19/Unity.Rendering.Hybrid/HybridV2RenderSystem.cs:315)
    Unity.Rendering.UpdateAllHybridChunksJob.Execute (Unity.Entities.ArchetypeChunk metaChunk, System.Int32 chunkIndex, System.Int32 firstEntityIndex) (at Packages/com.unity.rendering.hybrid@0.8.0-preview.19/Unity.Rendering.Hybrid/HybridV2RenderSystem.cs:512)
    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.16.0-preview.21/Unity.Entities/IJobChunk.cs:370)
    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.16.0-preview.21/Unity.Entities/IJobChunk.cs:337)
    Unity.Jobs.JobHandle:ScheduleBatchedJobsAndComplete(JobHandle&)
    Unity.Jobs.JobHandle:Complete()
    Unity.Rendering.HybridRendererSystem:UpdateAllBatches(JobHandle) (at Packages/com.unity.rendering.hybrid@0.8.0-preview.19/Unity.Rendering.Hybrid/HybridV2RenderSystem.cs:1851)
    Unity.Rendering.HybridRendererSystem:UpdateHybridV2Batches(JobHandle) (at Packages/com.unity.rendering.hybrid@0.8.0-preview.19/Unity.Rendering.Hybrid/HybridV2RenderSystem.cs:1453)
    Unity.Rendering.HybridRendererSystem:OnUpdate(JobHandle) (at Packages/com.unity.rendering.hybrid@0.8.0-preview.19/Unity.Rendering.Hybrid/HybridV2RenderSystem.cs:1484)
    Unity.Entities.JobComponentSystem:Update() (at Library/PackageCache/com.unity.entities@0.16.0-preview.21/Unity.Entities/JobComponentSystem.cs:130)
    Unity.Entities.ComponentSystemGroup:UpdateAllSystems() (at Library/PackageCache/com.unity.entities@0.16.0-preview.21/Unity.Entities/ComponentSystemGroup.cs:435)
    Unity.Entities.ComponentSystemGroup:OnUpdate() (at Library/PackageCache/com.unity.entities@0.16.0-preview.21/Unity.Entities/ComponentSystemGroup.cs:387)
    Unity.Entities.ComponentSystem:Update() (at Library/PackageCache/com.unity.entities@0.16.0-preview.21/Unity.Entities/ComponentSystem.cs:113)
    Unity.Entities.DummyDelegateWrapper:TriggerUpdate() (at Library/PackageCache/com.unity.entities@0.16.0-preview.21/Unity.Entities/ScriptBehaviourUpdateOrder.cs:333)

    NullReferenceException: Object reference not set to an instance of an object
    Unity.Rendering.HybridRendererSystem.AddNewChunks (Unity.Collections.NativeArray`1[T] newChunks) (at Packages/com.unity.rendering.hybrid@0.8.0-preview.19/Unity.Rendering.Hybrid/HybridV2RenderSystem.cs:2139)
    Unity.Rendering.HybridRendererSystem.UpdateAllBatches (Unity.Jobs.JobHandle inputDependencies) (at Packages/com.unity.rendering.hybrid@0.8.0-preview.19/Unity.Rendering.Hybrid/HybridV2RenderSystem.cs:1857)
    Unity.Rendering.HybridRendererSystem.UpdateHybridV2Batches (Unity.Jobs.JobHandle inputDependencies) (at Packages/com.unity.rendering.hybrid@0.8.0-preview.19/Unity.Rendering.Hybrid/HybridV2RenderSystem.cs:1453)
    Unity.Rendering.HybridRendererSystem.OnUpdate (Unity.Jobs.JobHandle inputDeps) (at Packages/com.unity.rendering.hybrid@0.8.0-preview.19/Unity.Rendering.Hybrid/HybridV2RenderSystem.cs:1484)
    Unity.Entities.JobComponentSystem.Update () (at Library/PackageCache/com.unity.entities@0.16.0-preview.21/Unity.Entities/JobComponentSystem.cs:137)
    Unity.Entities.ComponentSystemGroup.UpdateAllSystems () (at Library/PackageCache/com.unity.entities@0.16.0-preview.21/Unity.Entities/ComponentSystemGroup.cs:435)
    UnityEngine.Debug:LogException(Exception)
    Unity.Debug:LogException(Exception) (at Library/PackageCache/com.unity.entities@0.16.0-preview.21/Unity.Entities/Stubs/Unity/Debug.cs:19)
    Unity.Entities.ComponentSystemGroup:UpdateAllSystems() (at Library/PackageCache/com.unity.entities@0.16.0-preview.21/Unity.Entities/ComponentSystemGroup.cs:440)
    Unity.Entities.ComponentSystemGroup:OnUpdate() (at Library/PackageCache/com.unity.entities@0.16.0-preview.21/Unity.Entities/ComponentSystemGroup.cs:387)
    Unity.Entities.ComponentSystem:Update() (at Library/PackageCache/com.unity.entities@0.16.0-preview.21/Unity.Entities/ComponentSystem.cs:113)
    Unity.Entities.DummyDelegateWrapper:TriggerUpdate() (at Library/PackageCache/com.unity.entities@0.16.0-preview.21/Unity.Entities/ScriptBehaviourUpdateOrder.cs:333)

    Assertion failed on expression: '!info.buffer'
    UnityEngine.ComputeBuffer:BeginWrite(Int32, Int32)
    Unity.Rendering.SparseUploader:Begin(Int32, Int32) (at Packages/com.unity.rendering.hybrid@0.8.0-preview.19/Unity.Rendering.Hybrid/SparseUploader.cs:256)
    Unity.Rendering.HybridRendererSystem:StartUpdate() (at Packages/com.unity.rendering.hybrid@0.8.0-preview.19/Unity.Rendering.Hybrid/HybridV2RenderSystem.cs:2862)
    Unity.Rendering.HybridRendererSystem:OnUpdate(JobHandle) (at Packages/com.unity.rendering.hybrid@0.8.0-preview.19/Unity.Rendering.Hybrid/HybridV2RenderSystem.cs:1480)
    Unity.Entities.JobComponentSystem:Update() (at Library/PackageCache/com.unity.entities@0.16.0-preview.21/Unity.Entities/JobComponentSystem.cs:130)
    Unity.Entities.ComponentSystemGroup:UpdateAllSystems() (at Library/PackageCache/com.unity.entities@0.16.0-preview.21/Unity.Entities/ComponentSystemGroup.cs:435)
    Unity.Entities.ComponentSystemGroup:OnUpdate() (at Library/PackageCache/com.unity.entities@0.16.0-preview.21/Unity.Entities/ComponentSystemGroup.cs:387)
    Unity.Entities.ComponentSystem:Update() (at Library/PackageCache/com.unity.entities@0.16.0-preview.21/Unity.Entities/ComponentSystem.cs:113)
    Unity.Entities.DummyDelegateWrapper:TriggerUpdate() (at Library/PackageCache/com.unity.entities@0.16.0-preview.21/Unity.Entities/ScriptBehaviourUpdateOrder.cs:333)

    Assertion failed on expression: '!info.buffer'
    UnityEngine.ComputeBuffer:BeginWrite(Int32, Int32)
    Unity.Rendering.SparseUploader:Begin(Int32, Int32) (at Packages/com.unity.rendering.hybrid@0.8.0-preview.19/Unity.Rendering.Hybrid/SparseUploader.cs:257)
    Unity.Rendering.HybridRendererSystem:StartUpdate() (at Packages/com.unity.rendering.hybrid@0.8.0-preview.19/Unity.Rendering.Hybrid/HybridV2RenderSystem.cs:2862)
    Unity.Rendering.HybridRendererSystem:OnUpdate(JobHandle) (at Packages/com.unity.rendering.hybrid@0.8.0-preview.19/Unity.Rendering.Hybrid/HybridV2RenderSystem.cs:1480)
    Unity.Entities.JobComponentSystem:Update() (at Library/PackageCache/com.unity.entities@0.16.0-preview.21/Unity.Entities/JobComponentSystem.cs:130)
    Unity.Entities.ComponentSystemGroup:UpdateAllSystems() (at Library/PackageCache/com.unity.entities@0.16.0-preview.21/Unity.Entities/ComponentSystemGroup.cs:435)
    Unity.Entities.ComponentSystemGroup:OnUpdate() (at Library/PackageCache/com.unity.entities@0.16.0-preview.21/Unity.Entities/ComponentSystemGroup.cs:387)
    Unity.Entities.ComponentSystem:Update() (at Library/PackageCache/com.unity.entities@0.16.0-preview.21/Unity.Entities/ComponentSystem.cs:113)
    Unity.Entities.DummyDelegateWrapper:TriggerUpdate() (at Library/PackageCache/com.unity.entities@0.16.0-preview.21/Unity.Entities/ScriptBehaviourUpdateOrder.cs:333)

    Its basically the above 4 looping and causing collection not disposed and kinda like leading to cascading failure (Unity and other application crashed the first time this happens which I was not ready to pause the editor):
    A Native Collection has not been disposed, resulting in a memory leak. Allocated from:
    Unity.Collections.NativeArray`1:.ctor(Int32, Allocator, NativeArrayOptions)
    Unity.Rendering.HybridRendererSystem:UpdateAllBatches(JobHandle) (at Packages\com.unity.rendering.hybrid@0.8.0-preview.19\Unity.Rendering.Hybrid\HybridV2RenderSystem.cs:1766)
    Unity.Rendering.HybridRendererSystem:UpdateHybridV2Batches(JobHandle) (at Packages\com.unity.rendering.hybrid@0.8.0-preview.19\Unity.Rendering.Hybrid\HybridV2RenderSystem.cs:1453)
    Unity.Rendering.HybridRendererSystem:OnUpdate(JobHandle) (at Packages\com.unity.rendering.hybrid@0.8.0-preview.19\Unity.Rendering.Hybrid\HybridV2RenderSystem.cs:1484)
    Unity.Entities.JobComponentSystem:Update() (at Library\PackageCache\com.unity.entities@0.16.0-preview.21\Unity.Entities\JobComponentSystem.cs:130)
    Unity.Entities.ComponentSystemGroup:UpdateAllSystems() (at Library\PackageCache\com.unity.entities@0.16.0-preview.21\Unity.Entities\ComponentSystemGroup.cs:435)
    Unity.Entities.ComponentSystemGroup:OnUpdate() (at Library\PackageCache\com.unity.entities@0.16.0-preview.21\Unity.Entities\ComponentSystemGroup.cs:387)
    Unity.Entities.ComponentSystem:Update() (at Library\PackageCache\com.unity.entities@0.16.0-preview.21\Unity.Entities\ComponentSystem.cs:113)
    Unity.Entities.DummyDelegateWrapper:TriggerUpdate() (at Library\PackageCache\com.unity.entities@0.16.0-preview.21\Unity.Entities\ScriptBehaviourUpdateOrder.cs:333)
     
  40. joelv

    joelv

    Unity Technologies

    Joined:
    Mar 20, 2015
    Posts:
    203
    This does look like out of memory in the GPU buffer. How many drawable entities do you have? What is your seize of the persistent GPU buffer?

    A lot of the code regarding this was rewritten for hybrid 0.10 and it will not manage the buffer size automatically, as well as being a bit more exception safe and always close mapped buffers (you should not be seeing the !info.buffer assert any longer). I would highly recommend you to upgrade to 0.10 if you can
     
  41. Stroustrup

    Stroustrup

    Joined:
    May 18, 2020
    Posts:
    142
    do lightprobes work with skinned mesh characters currently?
     
  42. No3371

    No3371

    Joined:
    Dec 1, 2016
    Posts:
    42
    With Physics, when pausing editor, where should I expect a entity being render relative to its translation?

    upload_2020-11-16_11-29-33.png
    Static

    upload_2020-11-16_11-48-58.png
    Moving (Linear Z Velocity = 10), paused

    Or should I go to DOTS Physics for this questiono_O?
     
  43. Greenwar

    Greenwar

    Joined:
    Oct 11, 2014
    Posts:
    54
    I'm getting some weird artifacting with Hybrid 0.10 v2 and URP 9.0p.72 on Unity 2020.1.6f1
    I'd use URP 10 but it gave me a bunch of errors.
    The scene is fairly simple: Spawn n amount of entities with a BaseColor component (
    [MaterialProperty("_BaseColor", MaterialPropertyFormat.Float4)]).
    The shader is URP/Unlit

    I then animate the basecolor values in an Entities.Foreach, nothing else is going on.
    Each "pixel" below is an entity with a square mesh.


    1000 entities:


    100 entities:


    At first I thought it was some sort of Z-fighting going on, and that my entity placement was off, but it turns out it's correct. What's weird is that anything under 107 entities looks correct.
     
    Last edited: Nov 19, 2020
  44. Timboc

    Timboc

    Joined:
    Jun 22, 2015
    Posts:
    238
    That sounds like you're using ScheduleParallel and have something e.g. non-thread-safe. E.g. probably 107 entities fit in a single chunk and once you cross that threshold, multiple chunks are split across different workers. If you're using Random at all, that's very likely to be the issue I would guess.
     
    Greenwar likes this.
  45. Greenwar

    Greenwar

    Joined:
    Oct 11, 2014
    Posts:
    54
    Yep, you were correct. Thanks!
     
    Timboc likes this.
  46. snacktime

    snacktime

    Joined:
    Apr 15, 2013
    Posts:
    3,356
    We have a strange HR rendering issue with moving renderers where it looks like it just stops sending data to the gpu. When it's mild it just stutters, but occasionally entire meshes just stop rendering for a few seconds.

    The trigger seems to be when WaitForGfxCommandsFromMainThread starts kicking in. We only use HR for DOTS animation rendering. I don't think it's some strange interaction with our instanced indirect rendering, but just in case that's what most of our rendering goes through. Maybe possibly it's something in the animation rendering flow also although that seems less likely.

    Proper test case isn't really worth it atm, but thought I'd post it just in case anyone has seen similar behavior.
     
  47. Opeth001

    Opeth001

    Joined:
    Jan 28, 2017
    Posts:
    1,112
    is it possible to explicitly set shader properties as "Hybrid instanced (experimental)" for custom text shaders like a custom URP Simple Lit ?

    in my case I'm trying to modify the URP Simple Lit shader by adding a BaseMap offset property. in our subscene conversion we combine all the basemap textures that are part of the same shader and give them a single material with a combined texture, but for that we have to specify to each rendered entity its new offset using CD in order to correctly point towards the old uvs.
     
    Last edited: Nov 21, 2020
  48. Cell-i-Zenit

    Cell-i-Zenit

    Joined:
    Mar 11, 2016
    Posts:
    290
    Is emission not support? Iam on hdrp 10.2 and hybridrenderer v2 0.10 with flag.




    These blocks are the same, the left one (with emission) is just a normal gameobject, the other ones are the same, but converted to entity
     
  49. nobeerleft

    nobeerleft

    Joined:
    Mar 29, 2012
    Posts:
    27
    It is working for me with those same settings, but Exposure seems to affect the HR entities differently than the GO ones, in my case the HR ones take longer to become visible
     
  50. anihilnine

    anihilnine

    Joined:
    Jan 29, 2016
    Posts:
    27
    I think emission is rendered but the emission colour value is cleared when it is converted to an entity. You can just set it yourself in code once you instantiate the entity
    entityManager.SetComponentData(entity, new HDRPMaterialPropertyEmissiveColor  { Value = yourColour });
     
Thread Status:
Not open for further replies.