diff --git a/Source/Editor/Surface/Archetypes/Material.cs b/Source/Editor/Surface/Archetypes/Material.cs index 97c6fe9d0..0110c2c0e 100644 --- a/Source/Editor/Surface/Archetypes/Material.cs +++ b/Source/Editor/Surface/Archetypes/Material.cs @@ -867,7 +867,7 @@ namespace FlaxEditor.Surface.Archetypes { TypeID = 39, Title = "View Size", - Description = "The size of the view.", + Description = "The size of the view. The draw rectangle size in GUI materials.", Flags = NodeFlags.MaterialGraph, Size = new Float2(150, 40), Elements = new[] diff --git a/Source/Engine/Graphics/Materials/GUIMaterialShader.cpp b/Source/Engine/Graphics/Materials/GUIMaterialShader.cpp index 634614458..cc2d61775 100644 --- a/Source/Engine/Graphics/Materials/GUIMaterialShader.cpp +++ b/Source/Engine/Graphics/Materials/GUIMaterialShader.cpp @@ -47,8 +47,7 @@ void GUIMaterialShader::Bind(BindParameters& params) // Setup material constants { - const auto viewProjectionMatrix = customData->ViewProjection; - Matrix::Transpose(viewProjectionMatrix, materialData->ViewProjectionMatrix); + Matrix::Transpose(customData->ViewProjection, materialData->ViewProjectionMatrix); Matrix::Transpose(Matrix::Identity, materialData->WorldMatrix); Matrix::Transpose(Matrix::Identity, materialData->ViewMatrix); materialData->ViewPos = Float3::Zero; diff --git a/Source/Engine/Render2D/Render2D.cpp b/Source/Engine/Render2D/Render2D.cpp index 489f1df24..8c4dee971 100644 --- a/Source/Engine/Render2D/Render2D.cpp +++ b/Source/Engine/Render2D/Render2D.cpp @@ -562,7 +562,6 @@ void CachedPSO::Dispose() class Render2DService : public EngineService { public: - Render2DService() : EngineService(TEXT("Render2D"), 10) { @@ -1130,7 +1129,7 @@ void DrawBatch(int32 startIndex, int32 count) break; #if !BUILD_RELEASE default: - CRASH; + CRASH; #endif } diff --git a/Source/Engine/Render2D/Render2D.h b/Source/Engine/Render2D/Render2D.h index 811d67381..55f450e87 100644 --- a/Source/Engine/Render2D/Render2D.h +++ b/Source/Engine/Render2D/Render2D.h @@ -28,7 +28,7 @@ class TextureBase; /// API_CLASS(Static) class FLAXENGINE_API Render2D { -DECLARE_SCRIPTING_TYPE_NO_SPAWN(Render2D); + DECLARE_SCRIPTING_TYPE_NO_SPAWN(Render2D); /// /// The rendering features and options flags. @@ -46,7 +46,6 @@ DECLARE_SCRIPTING_TYPE_NO_SPAWN(Render2D); VertexSnapping = 1, }; -public: struct CustomData { Matrix ViewProjection; @@ -54,7 +53,6 @@ public: }; public: - /// /// Checks if interface is during rendering phrase (Draw calls may be performed without failing). /// @@ -122,7 +120,6 @@ public: static void EndFrame(); public: - /// /// Pushes transformation layer. /// @@ -176,7 +173,6 @@ public: API_FUNCTION() static void PopTint(); public: - /// /// Draws a text. /// diff --git a/Source/Engine/Tools/MaterialGenerator/MaterialGenerator.Material.cpp b/Source/Engine/Tools/MaterialGenerator/MaterialGenerator.Material.cpp index 275734a90..7923a24d7 100644 --- a/Source/Engine/Tools/MaterialGenerator/MaterialGenerator.Material.cpp +++ b/Source/Engine/Tools/MaterialGenerator/MaterialGenerator.Material.cpp @@ -488,6 +488,11 @@ void MaterialGenerator::ProcessGroupMaterial(Box* box, Node* node, Value& value) { value = Value(VariantType::Float2, box->ID == 0 ? TEXT("ViewSize.xy") : TEXT("ViewSize.zw")); } + else + { + // Fallback to Screen Size + value = Value(VariantType::Float2, box->ID == 0 ? TEXT("ScreenSize.xy") : TEXT("ScreenSize.zw")); + } break; } default: