mirror of
https://github.com/aharabada/glitchy-engine-beef.git
synced 2026-09-05 21:01:52 +00:00
Reimplemented Renderer2D
- Renderer2D now static - Renderer now calls Init and Deinit of Renderer2D - Renderer2D now calls Init and Deinit of FontRenderer - Fixed Deinit order of Layers and renderer (e.g. Layers now deinit first) - Sandbox2D now uses SandboxApp (only loads different layer)
This commit is contained in:
@@ -3,6 +3,8 @@ SamplerState Sampler : register(s0);
|
||||
|
||||
cbuffer Constants
|
||||
{
|
||||
float4x4 ViewProjection;
|
||||
|
||||
float ColorOffset = 0.5f;
|
||||
float AlphaOffset = 0.0f;
|
||||
float ColorScale = 0.5f;
|
||||
@@ -13,16 +15,17 @@ cbuffer Constants
|
||||
|
||||
struct VS_Input
|
||||
{
|
||||
float2 Position : POSITION;
|
||||
float4x4 Tranform : TRANSFORM;
|
||||
float4 Color : COLOR;
|
||||
float4 UVTransform : TEXCOORD;
|
||||
float2 Position : POSITION;
|
||||
float2 Texcoord : TEXCOORD0;
|
||||
float4x4 Transform : TRANSFORM;
|
||||
float4 Color : COLOR;
|
||||
float4 UVTransform : TEXCOORD1;
|
||||
};
|
||||
|
||||
struct PS_Input
|
||||
{
|
||||
float4 Position : SV_Position;
|
||||
float2 TexCoord : TEXCOORD0;
|
||||
float2 Texcoord : TEXCOORD0;
|
||||
float4 Color : COLOR;
|
||||
};
|
||||
|
||||
@@ -30,8 +33,8 @@ PS_Input VS(VS_Input input)
|
||||
{
|
||||
PS_Input output;
|
||||
|
||||
output.Position = mul(float4(input.Position, 0.0f, 1.0f), input.Tranform);
|
||||
output.TexCoord = input.UVTransform.xy + input.UVTransform.zw * input.Position;
|
||||
output.Position = mul(ViewProjection, mul(input.Transform, float4(input.Position, 0.0f, 1.0f)));
|
||||
output.Texcoord = input.UVTransform.xy + input.UVTransform.zw * input.Texcoord;
|
||||
output.Color = input.Color;
|
||||
|
||||
return output;
|
||||
@@ -39,7 +42,7 @@ PS_Input VS(VS_Input input)
|
||||
|
||||
float4 PS(PS_Input input) : SV_Target0
|
||||
{
|
||||
float4 color = Texture.Sample(Sampler, input.TexCoord);
|
||||
float4 color = Texture.Sample(Sampler, input.Texcoord);
|
||||
|
||||
float4 final = float4(ColorOffset.xxx, AlphaOffset) + color * float4(ColorScale.xxx, AlphaScale);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user