Minor tweaks to #716
This commit is contained in:
@@ -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[]
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ class TextureBase;
|
||||
/// </summary>
|
||||
API_CLASS(Static) class FLAXENGINE_API Render2D
|
||||
{
|
||||
DECLARE_SCRIPTING_TYPE_NO_SPAWN(Render2D);
|
||||
DECLARE_SCRIPTING_TYPE_NO_SPAWN(Render2D);
|
||||
|
||||
/// <summary>
|
||||
/// 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:
|
||||
|
||||
/// <summary>
|
||||
/// Checks if interface is during rendering phrase (Draw calls may be performed without failing).
|
||||
/// </summary>
|
||||
@@ -122,7 +120,6 @@ public:
|
||||
static void EndFrame();
|
||||
|
||||
public:
|
||||
|
||||
/// <summary>
|
||||
/// Pushes transformation layer.
|
||||
/// </summary>
|
||||
@@ -176,7 +173,6 @@ public:
|
||||
API_FUNCTION() static void PopTint();
|
||||
|
||||
public:
|
||||
|
||||
/// <summary>
|
||||
/// Draws a text.
|
||||
/// </summary>
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user