mirror of
https://github.com/elasota/Aerofoil.git
synced 2025-09-23 06:53:43 +00:00
Add FreeType, progress to title screen
This commit is contained in:
5
ShaderSrc/DrawQuad.h
Normal file
5
ShaderSrc/DrawQuad.h
Normal file
@@ -0,0 +1,5 @@
|
||||
struct SDrawQuadPixelInput
|
||||
{
|
||||
float4 pos : SV_POSITION;
|
||||
float2 texCoord : TEXCOORD;
|
||||
};
|
37
ShaderSrc/DrawQuad.hlsl
Normal file
37
ShaderSrc/DrawQuad.hlsl
Normal file
@@ -0,0 +1,37 @@
|
||||
cbuffer SDrawQuadVertexConstants : register(b0)
|
||||
{
|
||||
float4 ndcOriginAndDimensions;
|
||||
};
|
||||
|
||||
struct SVertexInput
|
||||
{
|
||||
float3 posUV : POSITION;
|
||||
};
|
||||
|
||||
struct SPixelInput
|
||||
{
|
||||
float4 pos : SV_POSITION;
|
||||
float2 texCoord : TEXCOORD;
|
||||
};
|
||||
|
||||
struct SPixelOutput
|
||||
{
|
||||
float4 color : SV_TARGET;
|
||||
};
|
||||
|
||||
SPixelInput VSMain(SVertexInput input)
|
||||
{
|
||||
SPixelInput result;
|
||||
|
||||
result.pos = float4(input.posUV.x, input.posUV.y, input.posUV.z, 1.0);
|
||||
result.texCoord = input.posUV.xy;
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
SPixelOutput PSMain(SPixelInput input)
|
||||
{
|
||||
SPixelOutput result;
|
||||
result.color = float4(input.texCoord.x, input.texCoord.y, 0.0, 1.0);
|
||||
return result;
|
||||
}
|
18
ShaderSrc/DrawQuad15BitP.hlsl
Normal file
18
ShaderSrc/DrawQuad15BitP.hlsl
Normal file
@@ -0,0 +1,18 @@
|
||||
#include "DrawQuad.h"
|
||||
|
||||
SamplerState surfaceSampler : register(s0);
|
||||
Texture2D<float> surfaceTexture : register(t0);
|
||||
|
||||
struct SDrawQuadPixelOutput
|
||||
{
|
||||
float4 color : SV_TARGET;
|
||||
};
|
||||
|
||||
SDrawQuadPixelOutput PSMain(SDrawQuadPixelInput input)
|
||||
{
|
||||
float surfaceColor = surfaceTexture.Sample(surfaceSampler, input.texCoord.xy).r;
|
||||
|
||||
SDrawQuadPixelOutput result;
|
||||
result.color = float4(surfaceColor, input.texCoord.x, input.texCoord.y, 1.0);
|
||||
return result;
|
||||
}
|
22
ShaderSrc/DrawQuadPaletteP.hlsl
Normal file
22
ShaderSrc/DrawQuadPaletteP.hlsl
Normal file
@@ -0,0 +1,22 @@
|
||||
#include "DrawQuad.h"
|
||||
|
||||
SamplerState nearestNeighborSampler : register(s0);
|
||||
Texture2D<uint> surfaceTexture : register(t0);
|
||||
Texture1D<float4> paletteTexture : register(t1);
|
||||
|
||||
struct SDrawQuadPixelOutput
|
||||
{
|
||||
float4 color : SV_TARGET;
|
||||
};
|
||||
|
||||
SDrawQuadPixelOutput PSMain(SDrawQuadPixelInput input)
|
||||
{
|
||||
int2 texCoord = input.texCoord.xy;
|
||||
|
||||
uint surfaceColor = surfaceTexture.Load(int3(texCoord, 0)).r;
|
||||
float3 paletteColor = paletteTexture.Load(int2(surfaceColor, 0)).rgb;
|
||||
|
||||
SDrawQuadPixelOutput result;
|
||||
result.color = float4(paletteColor.rgb, 1.0);
|
||||
return result;
|
||||
}
|
18
ShaderSrc/DrawQuadRGBP.hlsl
Normal file
18
ShaderSrc/DrawQuadRGBP.hlsl
Normal file
@@ -0,0 +1,18 @@
|
||||
#include "DrawQuad.h"
|
||||
|
||||
SamplerState surfaceSampler : register(s0);
|
||||
Texture2D<float> surfaceTexture : register(t0);
|
||||
|
||||
struct SDrawQuadPixelOutput
|
||||
{
|
||||
float4 color : SV_TARGET;
|
||||
};
|
||||
|
||||
SDrawQuadPixelOutput PSMain(SDrawQuadPixelInput input)
|
||||
{
|
||||
float surfaceColor = surfaceTexture.Sample(surfaceSampler, input.texCoord.xy).r;
|
||||
|
||||
SDrawQuadPixelOutput result;
|
||||
result.color = float4(surfaceColor, input.texCoord.x, input.texCoord.y, 1.0);
|
||||
return result;
|
||||
}
|
24
ShaderSrc/DrawQuadV.hlsl
Normal file
24
ShaderSrc/DrawQuadV.hlsl
Normal file
@@ -0,0 +1,24 @@
|
||||
#include "DrawQuad.h"
|
||||
|
||||
cbuffer SDrawQuadVertexConstants : register(b0)
|
||||
{
|
||||
float4 ndcOriginAndDimensions;
|
||||
float4 surfaceDimensions_Unused;
|
||||
};
|
||||
|
||||
struct SDrawQuadVertexInput
|
||||
{
|
||||
float2 posUV : POSITION;
|
||||
};
|
||||
|
||||
SDrawQuadPixelInput VSMain(SDrawQuadVertexInput input)
|
||||
{
|
||||
SDrawQuadPixelInput result;
|
||||
|
||||
float2 ndcPos = ndcOriginAndDimensions.xy + input.posUV.xy * ndcOriginAndDimensions.zw;
|
||||
|
||||
result.pos = float4(ndcPos.x, ndcPos.y, 0.0, 1.0);
|
||||
result.texCoord = input.posUV.xy * surfaceDimensions_Unused.xy;
|
||||
|
||||
return result;
|
||||
}
|
Reference in New Issue
Block a user