font_creator project for font loading;
init font_main + "stbtt_InitFont"; Lexend-Regular.ttf as normal font; git-svn-id: svn://ammerhai.com/home/mike/pokemon_repo@17 24008968-59e6-ed4c-a10b-0b2c954b24ab
This commit is contained in:
Binary file not shown.
@@ -0,0 +1,24 @@
|
||||
struct PixelShaderInput {
|
||||
float4 pos : SV_POSITION;
|
||||
float4 uvst : COORDINATES;
|
||||
uint tile_type : TILE_TYPE;
|
||||
};
|
||||
|
||||
struct PixelShaderOutput {
|
||||
float4 color : SV_TARGET;
|
||||
};
|
||||
|
||||
Texture2DArray<float4> tex1 : register(t0);
|
||||
|
||||
SamplerState texture_sampler : register(s0);
|
||||
|
||||
PixelShaderOutput main(PixelShaderInput input) {
|
||||
PixelShaderOutput output;
|
||||
|
||||
#if 1
|
||||
output.color = tex1.Sample(texture_sampler, float3(input.uvst.xy, input.tile_type));
|
||||
#else
|
||||
output.color = float4(1, 0, 1, 1);
|
||||
#endif
|
||||
return output;
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
struct VertexShaderInput {
|
||||
// Per Vertex
|
||||
float4 pos : VERTEX_POSITION;
|
||||
float2 uv : UV_VERTEX;
|
||||
uint vid : SV_VertexID;
|
||||
|
||||
// Per Instance
|
||||
float4 pos_size : INSTANCE_POSITION_SIZE;
|
||||
uint tile_type : TILE_TYPE;
|
||||
float4 uv0uv1 : UV_INSTANCE;
|
||||
};
|
||||
|
||||
struct VertexShaderOutput {
|
||||
float4 pos : SV_POSITION;
|
||||
float4 uv0uv1 : COORDINATES;
|
||||
uint tile_type : TILE_TYPE;
|
||||
};
|
||||
|
||||
|
||||
VertexShaderOutput main(VertexShaderInput input) {
|
||||
VertexShaderOutput output;
|
||||
|
||||
float2 rect_pos = input.pos_size.xy;
|
||||
float2 rect_size = input.pos_size.zw;
|
||||
|
||||
float3x3 coord_sys = {
|
||||
2, 0, -1,
|
||||
0, -2, 1,
|
||||
0, 0, 1
|
||||
};
|
||||
|
||||
input.pos_size.xy = mul(coord_sys, float3(input.pos_size.xy, 1)).xy;
|
||||
|
||||
float3x3 pos = {
|
||||
1, 0, input.pos_size.x,
|
||||
0, 1, input.pos_size.y,
|
||||
0, 0, 1
|
||||
};
|
||||
|
||||
float3x3 size = {
|
||||
rect_size.x, 0, 0,
|
||||
0, rect_size.y, 0,
|
||||
0, 0, 1
|
||||
};
|
||||
|
||||
output.pos.xy = mul(pos, mul(size, input.pos.xyz)).xy;
|
||||
//output.pos.xy = mul(pos, input.pos.xyz).xy;
|
||||
output.pos.zw = float2(0, 1);
|
||||
|
||||
output.uv0uv1.zw = float2(0, 0);
|
||||
|
||||
output.uv0uv1.xy = lerp(input.uv0uv1.xy, input.uv0uv1.zw, input.uv.xy);
|
||||
output.tile_type = input.tile_type;
|
||||
|
||||
return output;
|
||||
}
|
||||
Reference in New Issue
Block a user