stride3d / stride

Stride (formerly Xenko), a free and open-source cross-platform C# game engine.
https://stride3d.net
MIT License
6.64k stars 957 forks source link

SpotLight Shadow & Instacing crash #1851

Open Nicogo1705 opened 1 year ago

Nicogo1705 commented 1 year ago

Release Type & version: Official Release (4.1.0.1898)

Platform(s): Win

Describe the bug Crash when using SpotLight (with Shadow (standard ShadowMap)) and Instacing.

To Reproduce https://github.com/Nicogo1705/IssueSpotLight

  1. Download, start => It work.
  2. Check the component "Instance" on the entity "TestInstance" => it crash in editor/runtime

Expected behavior Having light and shadow on instanced object

Log and callstacks

[Game]: Error: Unexpected exception. System.ArgumentNullException: Value cannot be null. (Parameter 'resource') at Stride.Graphics.CommandList.MapSubresource(GraphicsResource resource, Int32 subResourceIndex, MapMode mapMode, Boolean doNotWait, Int32 offsetInBytes, Int32 lengthInBytes) at Stride.Graphics.ResourceGroupBufferUploader.Apply(CommandList commandList, ResourceGroup[] resourceGroups, Int32 resourceGroupsOffset) at Stride.Rendering.MeshRenderFeature.Draw(RenderDrawContext context, RenderView renderView, RenderViewStage renderViewStage, Int32 startIndex, Int32 endIndex) in C:\BuildAgent\work\b5f46e3c4829a09e\sources\engine\Stride.Rendering\Rendering\MeshRenderFeature.cs:line 203 at Stride.Rendering.RenderSystem.Draw(RenderDrawContext renderDrawContext, RenderView renderView, RenderStage renderStage) in C:\BuildAgent\work\b5f46e3c4829a09e\sources\engine\Stride.Rendering\Rendering\RenderSystem.cs:line 341 at Stride.Rendering.Compositing.ForwardRenderer.DrawView(RenderContext context, RenderDrawContext drawContext, Int32 eyeIndex, Int32 eyeCount) in C:\BuildAgent\work\b5f46e3c4829a09e\sources\engine\Stride.Engine\Rendering\Compositing\ForwardRenderer.cs:line 613 at Stride.Rendering.Compositing.ForwardRenderer.DrawCore(RenderContext context, RenderDrawContext drawContext) in C:\BuildAgent\work\b5f46e3c4829a09e\sources\engine\Stride.Engine\Rendering\Compositing\ForwardRenderer.cs:line 750 at Stride.Rendering.Compositing.SceneRendererBase.Draw(RenderDrawContext context) in C:\BuildAgent\work\b5f46e3c4829a09e\sources\engine\Stride.Rendering\Rendering\Compositing\SceneRendererBase.cs:line 42 at Stride.Rendering.Compositing.SceneRendererCollection.DrawCore(RenderContext context, RenderDrawContext drawContext) in C:\BuildAgent\work\b5f46e3c4829a09e\sources\engine\Stride.Rendering\Rendering\Compositing\SceneRendererCollection.cs:line 27 at Stride.Rendering.Compositing.SceneRendererBase.Draw(RenderDrawContext context) in C:\BuildAgent\work\b5f46e3c4829a09e\sources\engine\Stride.Rendering\Rendering\Compositing\SceneRendererBase.cs:line 42 at Stride.Rendering.Compositing.SceneCameraRenderer.DrawCore(RenderContext context, RenderDrawContext drawContext) in C:\BuildAgent\work\b5f46e3c4829a09e\sources\engine\Stride.Engine\Rendering\Compositing\SceneCameraRenderer.cs:line 72 at Stride.Rendering.Compositing.SceneRendererBase.Draw(RenderDrawContext context) in C:\BuildAgent\work\b5f46e3c4829a09e\sources\engine\Stride.Rendering\Rendering\Compositing\SceneRendererBase.cs:line 42 at Stride.Rendering.Compositing.GraphicsCompositor.DrawCore(RenderDrawContext context) in C:\BuildAgent\work\b5f46e3c4829a09e\sources\engine\Stride.Engine\Rendering\Compositing\GraphicsCompositor.cs:line 116 at Stride.Rendering.RendererBase.Draw(RenderDrawContext context) in C:\BuildAgent\work\b5f46e3c4829a09e\sources\engine\Stride.Rendering\Rendering\RendererBase.cs:line 52 at Stride.Engine.SceneSystem.Draw(GameTime gameTime) in C:\BuildAgent\work\b5f46e3c4829a09e\sources\engine\Stride.Engine\Engine\SceneSystem.cs:line 302 at Stride.Games.GameSystemCollection.Draw(GameTime gameTime) at Stride.Games.GameBase.Draw(GameTime gameTime) at Stride.Games.GameBase.RawTick(TimeSpan elapsedTimePerUpdate, Int32 updateCount, Single drawInterpolationFactor, Boolean drawFrame) at Stride.Games.GameBase.RawTickProducer() System.ArgumentNullException: Value cannot be null. (Parameter 'resource') at Stride.Graphics.CommandList.MapSubresource(GraphicsResource resource, Int32 subResourceIndex, MapMode mapMode, Boolean doNotWait, Int32 offsetInBytes, Int32 lengthInBytes) at Stride.Graphics.ResourceGroupBufferUploader.Apply(CommandList commandList, ResourceGroup[] resourceGroups, Int32 resourceGroupsOffset) at Stride.Rendering.MeshRenderFeature.Draw(RenderDrawContext context, RenderView renderView, RenderViewStage renderViewStage, Int32 startIndex, Int32 endIndex) in C:\BuildAgent\work\b5f46e3c4829a09e\sources\engine\Stride.Rendering\Rendering\MeshRenderFeature.cs:line 203 at Stride.Rendering.RenderSystem.Draw(RenderDrawContext renderDrawContext, RenderView renderView, RenderStage renderStage) in C:\BuildAgent\work\b5f46e3c4829a09e\sources\engine\Stride.Rendering\Rendering\RenderSystem.cs:line 341 at Stride.Rendering.Compositing.ForwardRenderer.DrawView(RenderContext context, RenderDrawContext drawContext, Int32 eyeIndex, Int32 eyeCount) in C:\BuildAgent\work\b5f46e3c4829a09e\sources\engine\Stride.Engine\Rendering\Compositing\ForwardRenderer.cs:line 613 at Stride.Rendering.Compositing.ForwardRenderer.DrawCore(RenderContext context, RenderDrawContext drawContext) in C:\BuildAgent\work\b5f46e3c4829a09e\sources\engine\Stride.Engine\Rendering\Compositing\ForwardRenderer.cs:line 750 at Stride.Rendering.Compositing.SceneRendererBase.Draw(RenderDrawContext context) in C:\BuildAgent\work\b5f46e3c4829a09e\sources\engine\Stride.Rendering\Rendering\Compositing\SceneRendererBase.cs:line 42 at Stride.Rendering.Compositing.SceneRendererCollection.DrawCore(RenderContext context, RenderDrawContext drawContext) in C:\BuildAgent\work\b5f46e3c4829a09e\sources\engine\Stride.Rendering\Rendering\Compositing\SceneRendererCollection.cs:line 27 at Stride.Rendering.Compositing.SceneRendererBase.Draw(RenderDrawContext context) in C:\BuildAgent\work\b5f46e3c4829a09e\sources\engine\Stride.Rendering\Rendering\Compositing\SceneRendererBase.cs:line 42 at Stride.Rendering.Compositing.SceneCameraRenderer.DrawCore(RenderContext context, RenderDrawContext drawContext) in C:\BuildAgent\work\b5f46e3c4829a09e\sources\engine\Stride.Engine\Rendering\Compositing\SceneCameraRenderer.cs:line 72 at Stride.Rendering.Compositing.SceneRendererBase.Draw(RenderDrawContext context) in C:\BuildAgent\work\b5f46e3c4829a09e\sources\engine\Stride.Rendering\Rendering\Compositing\SceneRendererBase.cs:line 42 at Stride.Rendering.Compositing.GraphicsCompositor.DrawCore(RenderDrawContext context) in C:\BuildAgent\work\b5f46e3c4829a09e\sources\engine\Stride.Engine\Rendering\Compositing\GraphicsCompositor.cs:line 116 at Stride.Rendering.RendererBase.Draw(RenderDrawContext context) in C:\BuildAgent\work\b5f46e3c4829a09e\sources\engine\Stride.Rendering\Rendering\RendererBase.cs:line 52 at Stride.Engine.SceneSystem.Draw(GameTime gameTime) in C:\BuildAgent\work\b5f46e3c4829a09e\sources\engine\Stride.Engine\Engine\SceneSystem.cs:line 302 at Stride.Games.GameSystemCollection.Draw(GameTime gameTime) at Stride.Games.GameBase.Draw(GameTime gameTime) at Stride.Games.GameBase.RawTick(TimeSpan elapsedTimePerUpdate, Int32 updateCount, Single drawInterpolationFactor, Boolean drawFrame) at Stride.Games.GameBase.RawTickProducer() Unhandled exception. System.ArgumentNullException: Value cannot be null. (Parameter 'resource') at Stride.Graphics.CommandList.MapSubresource(GraphicsResource resource, Int32 subResourceIndex, MapMode mapMode, Boolean doNotWait, Int32 offsetInBytes, Int32 lengthInBytes) at Stride.Graphics.ResourceGroupBufferUploader.Apply(CommandList commandList, ResourceGroup[] resourceGroups, Int32 resourceGroupsOffset) at Stride.Rendering.MeshRenderFeature.Draw(RenderDrawContext context, RenderView renderView, RenderViewStage renderViewStage, Int32 startIndex, Int32 endIndex) in C:\BuildAgent\work\b5f46e3c4829a09e\sources\engine\Stride.Rendering\Rendering\MeshRenderFeature.cs:line 203 at Stride.Rendering.RenderSystem.Draw(RenderDrawContext renderDrawContext, RenderView renderView, RenderStage renderStage) in C:\BuildAgent\work\b5f46e3c4829a09e\sources\engine\Stride.Rendering\Rendering\RenderSystem.cs:line 341 at Stride.Rendering.Compositing.ForwardRenderer.DrawView(RenderContext context, RenderDrawContext drawContext, Int32 eyeIndex, Int32 eyeCount) in C:\BuildAgent\work\b5f46e3c4829a09e\sources\engine\Stride.Engine\Rendering\Compositing\ForwardRenderer.cs:line 613 at Stride.Rendering.Compositing.ForwardRenderer.DrawCore(RenderContext context, RenderDrawContext drawContext) in C:\BuildAgent\work\b5f46e3c4829a09e\sources\engine\Stride.Engine\Rendering\Compositing\ForwardRenderer.cs:line 750 at Stride.Rendering.Compositing.SceneRendererBase.Draw(RenderDrawContext context) in C:\BuildAgent\work\b5f46e3c4829a09e\sources\engine\Stride.Rendering\Rendering\Compositing\SceneRendererBase.cs:line 42 at Stride.Rendering.Compositing.SceneRendererCollection.DrawCore(RenderContext context, RenderDrawContext drawContext) in C:\BuildAgent\work\b5f46e3c4829a09e\sources\engine\Stride.Rendering\Rendering\Compositing\SceneRendererCollection.cs:line 27 at Stride.Rendering.Compositing.SceneRendererBase.Draw(RenderDrawContext context) in C:\BuildAgent\work\b5f46e3c4829a09e\sources\engine\Stride.Rendering\Rendering\Compositing\SceneRendererBase.cs:line 42 at Stride.Rendering.Compositing.SceneCameraRenderer.DrawCore(RenderContext context, RenderDrawContext drawContext) in C:\BuildAgent\work\b5f46e3c4829a09e\sources\engine\Stride.Engine\Rendering\Compositing\SceneCameraRenderer.cs:line 72 at Stride.Rendering.Compositing.SceneRendererBase.Draw(RenderDrawContext context) in C:\BuildAgent\work\b5f46e3c4829a09e\sources\engine\Stride.Rendering\Rendering\Compositing\SceneRendererBase.cs:line 42 at Stride.Rendering.Compositing.GraphicsCompositor.DrawCore(RenderDrawContext context) in C:\BuildAgent\work\b5f46e3c4829a09e\sources\engine\Stride.Engine\Rendering\Compositing\GraphicsCompositor.cs:line 116 at Stride.Rendering.RendererBase.Draw(RenderDrawContext context) in C:\BuildAgent\work\b5f46e3c4829a09e\sources\engine\Stride.Rendering\Rendering\RendererBase.cs:line 52 at Stride.Engine.SceneSystem.Draw(GameTime gameTime) in C:\BuildAgent\work\b5f46e3c4829a09e\sources\engine\Stride.Engine\Engine\SceneSystem.cs:line 302 at Stride.Games.GameSystemCollection.Draw(GameTime gameTime) at Stride.Games.GameBase.Draw(GameTime gameTime) at Stride.Games.GameBase.RawTick(TimeSpan elapsedTimePerUpdate, Int32 updateCount, Single drawInterpolationFactor, Boolean drawFrame) at Stride.Games.GameBase.RawTickProducer() at Stride.Games.GameBase.Tick() at Stride.Games.GamePlatform.Tick() at Stride.Games.WindowsMessageLoop.Run(Control form, RenderCallback renderCallback, Boolean useApplicationDoEvents) at Stride.Games.GameWindowWinforms.Run() at Stride.Games.GamePlatform.Run(GameContext gameContext) at Stride.Games.GameBase.Run(GameContext gameContext) at BepuPhysicIntegrationTest.BepuPhysicIntegrationTestApp.Main(String[] args) in C:\Users\Nicogo\Documents\Stride Projects\BepuPhysicIntegrationTest\BepuPhysicIntegrationTest.Windows\BepuPhysicIntegrationTestApp.cs:line 11

tebjan commented 1 year ago

Thanks for the report, will have a look at it.