fp: Tone down scanline effect

This commit is contained in:
doyle 2023-10-06 19:57:59 +11:00
parent 85603bda2a
commit bfe2fef528
2 changed files with 10 additions and 12 deletions

View File

@ -2117,10 +2117,6 @@ void FP_Render(FP_Game *game, TELY_Platform *platform, TELY_Renderer *renderer)
FP_EntityRenderData club_terry_render_data = FP_Entity_GetRenderData(game, placeable_building.type, placeable_building.state, entity->direction); FP_EntityRenderData club_terry_render_data = FP_Entity_GetRenderData(game, placeable_building.type, placeable_building.state, entity->direction);
Dqn_Rect dest_rect = FP_Game_GetBuildingPlacementRectForEntity(game, placeable_building, entity->handle); Dqn_Rect dest_rect = FP_Game_GetBuildingPlacementRectForEntity(game, placeable_building, entity->handle);
Dqn_V4 colour = game->build_mode_can_place_building ?
TELY_Colour_V4Alpha(TELY_COLOUR_WHITE_V4, 0.5f) :
TELY_Colour_V4Alpha(TELY_COLOUR_RED_V4, 0.5f);
Dqn_V4 colour = game->build_mode_can_place_building ? Dqn_V4 colour = game->build_mode_can_place_building ?
TELY_Colour_V4Alpha(TELY_COLOUR_WHITE_V4, 0.5f) : TELY_Colour_V4Alpha(TELY_COLOUR_WHITE_V4, 0.5f) :
TELY_Colour_V4Alpha(TELY_COLOUR_RED_V4, 0.5f); TELY_Colour_V4Alpha(TELY_COLOUR_RED_V4, 0.5f);

View File

@ -778,22 +778,24 @@ static void FP_GameRenderScanlines(TELY_Renderer *renderer, Dqn_f32 scanline_gap
{ {
Dqn_V2 start = Dqn_V2_InitNx2(0, y); Dqn_V2 start = Dqn_V2_InitNx2(0, y);
Dqn_V2 end = Dqn_V2_InitNx2(screen_size.w, y); Dqn_V2 end = Dqn_V2_InitNx2(screen_size.w, y);
TELY_Render_LineColourV4(renderer, start, end, TELY_Colour_V4Alpha(TELY_COLOUR_WHITE_V4, 0.5f), scanline_thickness); TELY_Render_LineColourV4(renderer, start, end, TELY_Colour_V4Alpha(TELY_COLOUR_WHITE_V4, 0.1f), scanline_thickness);
} }
} }
static void FP_GameRenderCameraFollowScanlines(TELY_Renderer *renderer, Dqn_V2 screen_size, Dqn_V2 camera_offset, Dqn_f32 scanline_gap, Dqn_f32 scanline_thickness) static void FP_GameRenderCameraFollowScanlines(TELY_Renderer *renderer,
Dqn_V2 screen_size,
Dqn_V2 camera_offset,
Dqn_f32 scanline_gap,
Dqn_f32 scanline_thickness)
{ {
Dqn_f32 y_offset = camera_offset.y; Dqn_f32 y_offset = camera_offset.y;
// Adjust starting y to be more negative // Adjust starting y to be more negative
Dqn_f32 starting_y = -screen_size.h - 150 - y_offset; Dqn_f32 starting_y = -screen_size.h - 150 - y_offset;
for (Dqn_f32 y = starting_y; y < screen_size.h; y += scanline_gap + scanline_thickness) for (Dqn_f32 y = starting_y; y < screen_size.h; y += scanline_gap + scanline_thickness) {
{ Dqn_V2 start = Dqn_V2_InitNx2(camera_offset.x, y + camera_offset.y);
Dqn_V2 start = Dqn_V2_InitNx2(camera_offset.x, y + camera_offset.y); Dqn_V2 end = Dqn_V2_InitNx2(screen_size.w + camera_offset.x, y + camera_offset.y);
Dqn_V2 end = Dqn_V2_InitNx2(screen_size.w + camera_offset.x, y + camera_offset.y); TELY_Render_LineColourV4(renderer, start, end, TELY_Colour_V4Alpha(TELY_COLOUR_BLACK_V4, 0.1f), scanline_thickness);
TELY_Render_LineColourV4(renderer, start, end, TELY_Colour_V4Alpha(TELY_COLOUR_BLACK_V4, 0.5f), scanline_thickness);
} }
} }