tweaks
This commit is contained in:
parent
bfbc7cf865
commit
3945008984
BIN
src/pp/pp_res/sprite/tiles.ase
(Stored with Git LFS)
BIN
src/pp/pp_res/sprite/tiles.ase
(Stored with Git LFS)
Binary file not shown.
BIN
src/pp/pp_res/sprite/tiles_real.ase
(Stored with Git LFS)
BIN
src/pp/pp_res/sprite/tiles_real.ase
(Stored with Git LFS)
Binary file not shown.
BIN
src/pp/pp_res/tile/Carpet.ase
(Stored with Git LFS)
Normal file
BIN
src/pp/pp_res/tile/Carpet.ase
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
src/pp/pp_res/tile/Tile.ase
(Stored with Git LFS)
Normal file
BIN
src/pp/pp_res/tile/Tile.ase
(Stored with Git LFS)
Normal file
Binary file not shown.
@ -3,7 +3,9 @@
|
|||||||
|
|
||||||
i32 S_TileIdxFromTilePos(Vec2 p)
|
i32 S_TileIdxFromTilePos(Vec2 p)
|
||||||
{
|
{
|
||||||
i32 result = ClampI32(FloorF32(p.x) + (FloorF32(p.y) * S_TilesPitch), 0, S_TilesCount);
|
i32 x = ClampI32(FloorF32(p.x), 0, S_TilesPitch - 1);
|
||||||
|
i32 y = ClampI32(FloorF32(p.y), 0, S_TilesPitch - 1);
|
||||||
|
i32 result = x + (y * S_TilesPitch);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -11,7 +11,8 @@
|
|||||||
|
|
||||||
#define S_TilesXMacro(X) \
|
#define S_TilesXMacro(X) \
|
||||||
X(Empty) \
|
X(Empty) \
|
||||||
X(Floor) \
|
X(Tile) \
|
||||||
|
X(Carpet) \
|
||||||
X(Wall) \
|
X(Wall) \
|
||||||
/* -------------------- */
|
/* -------------------- */
|
||||||
|
|
||||||
|
|||||||
@ -3171,6 +3171,8 @@ void V_TickForever(WaveLaneCtx *lane)
|
|||||||
params.target_ro = draw_target_ro;
|
params.target_ro = draw_target_ro;
|
||||||
params.target_rw = draw_target_rw;
|
params.target_rw = draw_target_rw;
|
||||||
params.xf = frame->xf;
|
params.xf = frame->xf;
|
||||||
|
|
||||||
|
params.tick = frame->tick;
|
||||||
params.seed = RandU64FromState(&frame->rand);
|
params.seed = RandU64FromState(&frame->rand);
|
||||||
|
|
||||||
params.pt_wrap_sampler = G_BasicPointWrapSampler();
|
params.pt_wrap_sampler = G_BasicPointWrapSampler();
|
||||||
@ -3205,12 +3207,13 @@ void V_TickForever(WaveLaneCtx *lane)
|
|||||||
|
|
||||||
// Fill tile textures
|
// Fill tile textures
|
||||||
{
|
{
|
||||||
ResourceKey sheet_resource = ResourceKeyFromStore(&P_Resources, Lit("sprite/tiles.ase"));
|
|
||||||
for (S_TileKind tile_kind = 0; tile_kind < S_TileKind_COUNT; ++tile_kind)
|
for (S_TileKind tile_kind = 0; tile_kind < S_TileKind_COUNT; ++tile_kind)
|
||||||
{
|
{
|
||||||
String tile_name = S_TileNameFromKind(tile_kind);
|
String tile_name = S_TileNameFromKind(tile_kind);
|
||||||
|
String sheet_name = StringF(frame->arena, "sprite/%F.ase", FmtString(tile_name));
|
||||||
|
ResourceKey sheet_resource = ResourceKeyFromStore(&P_Resources, sheet_name);
|
||||||
SPR_SheetKey sheet = SPR_SheetKeyFromResource(sheet_resource);
|
SPR_SheetKey sheet = SPR_SheetKeyFromResource(sheet_resource);
|
||||||
SPR_Slice tile_slice = SPR_SliceFromSheet(sheet, tile_name);
|
SPR_Slice tile_slice = SPR_SliceFromSheet(sheet, Lit(""));
|
||||||
params.tile_slices[tile_kind] = tile_slice;
|
params.tile_slices[tile_kind] = tile_slice;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -79,7 +79,7 @@ ComputeShader2D(V_BackdropCS, 8, 8)
|
|||||||
{
|
{
|
||||||
Vec4 result = Vec4(0.025, 0.025, 0.025, 1);
|
Vec4 result = Vec4(0.025, 0.025, 0.025, 1);
|
||||||
Vec2 world_pos = mul(params.xf.ui_to_world, Vec3(ui_pos, 1));
|
Vec2 world_pos = mul(params.xf.ui_to_world, Vec3(ui_pos, 1));
|
||||||
|
Vec2 cell_pos = floor(mul(params.xf.world_to_cell, Vec3(world_pos, 1)));
|
||||||
Vec2 tile_pos = mul(params.xf.world_to_tile, Vec3(world_pos, 1));
|
Vec2 tile_pos = mul(params.xf.world_to_tile, Vec3(world_pos, 1));
|
||||||
|
|
||||||
S_TileKind tile = tiles.Load(Vec3(tile_pos, 0));
|
S_TileKind tile = tiles.Load(Vec3(tile_pos, 0));
|
||||||
@ -149,22 +149,17 @@ ComputeShader2D(V_BackdropCS, 8, 8)
|
|||||||
{
|
{
|
||||||
Vec4 outer = LinearFromSrgb(Vec4(0.05, 0.05, 0.05, 1));
|
Vec4 outer = LinearFromSrgb(Vec4(0.05, 0.05, 0.05, 1));
|
||||||
Vec4 inner = LinearFromSrgb(Vec4(0.10, 0.10, 0.10, 1));
|
Vec4 inner = LinearFromSrgb(Vec4(0.10, 0.10, 0.10, 1));
|
||||||
// result = lerp(outer, inner, smoothstep(0, 1, tile_edge_dist / 0.375));
|
result = lerp(outer, inner, smoothstep(0, 1, tile_edge_dist / 0.375));
|
||||||
result = lerp(outer, inner, smoothstep(0, 1, tile_edge_dist / 0.5));
|
// result = lerp(outer, inner, smoothstep(0, 1, tile_edge_dist / 0.5));
|
||||||
}
|
}
|
||||||
else if (tile != S_TileKind_Empty)
|
else if (tile != S_TileKind_Empty)
|
||||||
{
|
{
|
||||||
SamplerState wrap_sampler = G_Dereference(params.pt_wrap_sampler);
|
SamplerState wrap_sampler = G_Dereference(params.pt_wrap_sampler);
|
||||||
SPR_Slice slice = params.tile_slices[tile];
|
SPR_Slice slice = params.tile_slices[tile];
|
||||||
Texture2D<Vec4> tile_tex = G_Dereference<Vec4>(slice.tex);
|
Texture2D<Vec4> tile_tex = G_Dereference<Vec4>(slice.tex);
|
||||||
Vec4 floor_col = tile_tex.Sample(wrap_sampler, world_pos);
|
Vec4 tile_col = tile_tex.Sample(wrap_sampler, world_pos);
|
||||||
|
|
||||||
// if (edge_tile == S_TileKind_Wall && tile_edge_dist < 0.05)
|
result = tile_col;
|
||||||
// {
|
|
||||||
// // floor_col.rgb *= 0.25;
|
|
||||||
// }
|
|
||||||
|
|
||||||
result = floor_col;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// switch (tile)
|
// switch (tile)
|
||||||
@ -195,8 +190,6 @@ ComputeShader2D(V_BackdropCS, 8, 8)
|
|||||||
RWTexture2D<Vec4> cells = G_Dereference<Vec4>(params.cells);
|
RWTexture2D<Vec4> cells = G_Dereference<Vec4>(params.cells);
|
||||||
RWTexture2D<f32> drynesses = G_Dereference<f32>(params.drynesses);
|
RWTexture2D<f32> drynesses = G_Dereference<f32>(params.drynesses);
|
||||||
|
|
||||||
Vec2 cell_pos = floor(mul(params.xf.world_to_cell, Vec3(world_pos, 1)));
|
|
||||||
|
|
||||||
Vec4 stain = stains.Load(cell_pos);
|
Vec4 stain = stains.Load(cell_pos);
|
||||||
Vec4 cell = cells.Load(cell_pos);
|
Vec4 cell = cells.Load(cell_pos);
|
||||||
f32 dryness = drynesses[cell_pos];
|
f32 dryness = drynesses[cell_pos];
|
||||||
|
|||||||
@ -64,6 +64,8 @@ Struct(V_GpuParams)
|
|||||||
G_Texture2DRef target_ro;
|
G_Texture2DRef target_ro;
|
||||||
G_RWTexture2DRef target_rw;
|
G_RWTexture2DRef target_rw;
|
||||||
V_Xforms xf;
|
V_Xforms xf;
|
||||||
|
|
||||||
|
u64 tick;
|
||||||
u64 seed;
|
u64 seed;
|
||||||
|
|
||||||
G_SamplerStateRef pt_wrap_sampler;
|
G_SamplerStateRef pt_wrap_sampler;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user