added defer.h for better free() use;

to create multiple textures in one array is now possible;
swapping textures with mouseclick;
added some textures;

git-svn-id: svn://ammerhai.com/home/mike/pokemon_repo@7 24008968-59e6-ed4c-a10b-0b2c954b24ab
This commit is contained in:
mikeb
2021-02-27 17:13:03 +00:00
parent 29c4a4f290
commit 5ccc22deae
12 changed files with 125 additions and 5 deletions
+3 -2
View File
@@ -1,13 +1,14 @@
struct PixelShaderInput {
float4 pos : SV_POSITION;
float4 uvst : COORDINATES;
uint tile_type : TILE_TYPE;
};
struct PixelShaderOutput {
float4 color : SV_TARGET;
};
Texture2D<float4> tex1 : register(t0);
Texture2DArray<float4> tex1 : register(t0);
SamplerState texture_sampler : register(s0);
@@ -15,7 +16,7 @@ PixelShaderOutput main(PixelShaderInput input) {
PixelShaderOutput output;
#if 1
output.color = tex1.Sample(texture_sampler, input.uvst.xy);
output.color = tex1.Sample(texture_sampler, float3(input.uvst.xy, input.tile_type));
#else
output.color = float4(1, 0, 1, 1);
#endif
+3 -2
View File
@@ -6,16 +6,16 @@ struct VertexShaderInput {
// Per Instance
float4 pos_size : INSTANCE_POSITION_SIZE;
uint tile_type : TILE_TYPE;
};
struct VertexShaderOutput {
float4 pos : SV_POSITION;
float4 uvst : COORDINATES;
uint tile_type : TILE_TYPE;
};
VertexShaderOutput main(VertexShaderInput input) {
VertexShaderOutput output;
@@ -47,6 +47,7 @@ VertexShaderOutput main(VertexShaderInput input) {
output.pos.zw = float2(0, 1);
output.uvst = input.uvst;
output.tile_type = input.tile_type;
return output;
}
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.