Handle loading error and placeholder shaders

This commit is contained in:
Simon Lübeß
2025-07-10 14:59:37 +02:00
parent 1b63c922da
commit c2d330fc8f
8 changed files with 192 additions and 56 deletions
@@ -27,7 +27,10 @@ class MaterialLoader : IProcessedAssetLoader
String textureName = scope String(textureNameLength);
stream.ReadStrSized32(textureNameLength, textureName);
material.SetTexture(textureName, textureHandle);
if (material.SetTexture(textureName, textureHandle) case .Err(let error))
{
Log.EngineLogger.Error($"Failed to set texture slot {textureName}: {error}");
}
}
uint16 bufferCount = Try!(stream.Read<uint16>());
+2 -2
View File
@@ -532,7 +532,7 @@ namespace GlitchyEngine.Renderer
s_quadBatchMaterial.SetVariable("ViewProjection", sceneViewProjection);
//s_currentQuadEffect.Get()?.Variables["ViewProjection"].SetData(viewProjection);
s_currentCircleEffect.Get()?.Variables["ViewProjection"].SetData(sceneViewProjection);
//s_currentCircleEffect.Get()?.Variables["ViewProjection"].SetData(sceneViewProjection);
s_currentLineEffect.Get()?.Variables["ViewProjection"].SetData(sceneViewProjection);
s_drawOrder = drawOrder;
@@ -574,7 +574,7 @@ namespace GlitchyEngine.Renderer
//s_currentQuadEffect.Get()?.Variables["ViewProjection"].SetData(viewProjection);
s_quadBatchMaterial.SetVariable("ViewProjection", sceneViewProjection);
s_currentCircleEffect.Get()?.Variables["ViewProjection"].SetData(sceneViewProjection);
//s_currentCircleEffect.Get()?.Variables["ViewProjection"].SetData(sceneViewProjection);
s_currentLineEffect.Get()?.Variables["ViewProjection"].SetData(sceneViewProjection);
s_drawOrder = drawOrder;