diff --git a/swGUI/Core/Media/Geometry/Layouts/VertexShape2D.cpp b/swGUI/Core/Media/Geometry/Layouts/VertexShape2D.cpp index 9b5ba250..6bf21d29 100644 --- a/swGUI/Core/Media/Geometry/Layouts/VertexShape2D.cpp +++ b/swGUI/Core/Media/Geometry/Layouts/VertexShape2D.cpp @@ -49,10 +49,10 @@ template <> InputLayoutDescriptor CreateLayoutDescriptor< VertexText2D >() InputLayoutDescriptor desc; desc.AddEntry( AttributeSemantic::Position, ResourceFormat::RESOURCE_FORMAT_R32G32_FLOAT, offsetof( VertexText2D, Position ) ); - desc.AddEntry( AttributeSemantic::Texcoord, ResourceFormat::RESOURCE_FORMAT_R32G32_FLOAT, - offsetof( VertexText2D, AtlasCoords ) ); desc.AddEntry( AttributeSemantic::Texcoord, ResourceFormat::RESOURCE_FORMAT_R32G32_FLOAT, offsetof( VertexText2D, UV ) ); + desc.AddEntry( AttributeSemantic::Texcoord, ResourceFormat::RESOURCE_FORMAT_R32G32_FLOAT, + offsetof( VertexText2D, AtlasCoords ) ); return std::move( desc ); } diff --git a/swGUI/Core/Shaders/hlsl/Templates/Opacity.psh b/swGUI/Core/Shaders/hlsl/Templates/Opacity.psh index 7e79f0b4..8d23695c 100644 --- a/swGUI/Core/Shaders/hlsl/Templates/Opacity.psh +++ b/swGUI/Core/Shaders/hlsl/Templates/Opacity.psh @@ -5,8 +5,8 @@ struct OutputVS { linear float4 Pos : SV_Position; - noperspective float2 Tex : TEXCOORD; - noperspective float2 Mask : TEXCOORD; + noperspective float2 Tex : TEXCOORD0; + noperspective float2 Mask : TEXCOORD1; }; // ================================ // @@ -53,6 +53,6 @@ float4 main ( OutputVS input ) : SV_Target { float4 color = BrushFunction( input.Pos, input.Tex ); float4 opacity = opacityMask.Sample(OpacitySampler, input.Mask); - color.z = color.z * opacity.z; + color.a = color.a * opacity.a; return color; } diff --git a/swGUI/Core/Shaders/hlsl/Templates/Opacity.vsh b/swGUI/Core/Shaders/hlsl/Templates/Opacity.vsh index eb7108b3..85939b5c 100644 --- a/swGUI/Core/Shaders/hlsl/Templates/Opacity.vsh +++ b/swGUI/Core/Shaders/hlsl/Templates/Opacity.vsh @@ -5,8 +5,8 @@ struct InputVS { float4 Pos : POSITION; - float2 Tex : TEXCOORD; - float2 Mask : TEXCOORD; + float2 Tex : TEXCOORD0; + float2 Mask : TEXCOORD1; }; // ================================ // @@ -14,8 +14,8 @@ struct InputVS struct OutputVS { linear float4 Pos : SV_Position; - noperspective float2 Tex : TEXCOORD; - noperspective float2 Mask: TEXCOORD; + noperspective float2 Tex : TEXCOORD0; + noperspective float2 Mask: TEXCOORD1; }; // ================================ // diff --git a/swGUI/Prototypes/PrototyperGUI/Application.cpp b/swGUI/Prototypes/PrototyperGUI/Application.cpp index 72688320..87e6cff2 100644 --- a/swGUI/Prototypes/PrototyperGUI/Application.cpp +++ b/swGUI/Prototypes/PrototyperGUI/Application.cpp @@ -141,7 +141,7 @@ void AddControls ( HostWindow* host ) AddRectangle( host, gradientBrush, stroke, 120, 768, 2, Position( 750, 0 ) ); auto background = std::make_shared< SolidColorBrush >( Color( 0.5, 0.5, 0.5, 1.0 ) ); - auto pen = std::make_shared< SolidColorBrush >( Color( 0.0, 1.0, 0.0, 1.0 ) ); + auto pen = std::make_shared< SolidColorBrush >( Color( 1.0, 1.0, 1.0, 1.0 ) ); AddText( host, background, pen, 200, 200, Position( 50, 600 ), L"Hello World" ); } diff --git a/swGraphicAPI/Assets/TextAsset/Text.inl b/swGraphicAPI/Assets/TextAsset/Text.inl index 82f85673..4eead160 100644 --- a/swGraphicAPI/Assets/TextAsset/Text.inl +++ b/swGraphicAPI/Assets/TextAsset/Text.inl @@ -115,9 +115,10 @@ inline void TextGeometryGenerator< VertexType, IndexType, TextAcc >::Gen } auto& glyph = m_layout.Glyphs.at( wch ); - - PutLetterVertex( vertex, glyph, translate, idx ); - PutLetterUV( vertex, glyph, translate, idx ); + vertexIdx = GenerateBackground ? vertexIdx - 4 : vertexIdx; + + PutLetterVertex( vertex, glyph, translate, vertexIdx ); + PutLetterUV( vertex, glyph, translate, vertexIdx ); } // ================================ //