some temporary color pallete defines

This commit is contained in:
jacob 2025-05-16 13:25:08 -05:00
parent c895c9e617
commit 98c238ff79
11 changed files with 100 additions and 81 deletions

View File

@ -1,6 +1,9 @@
struct vs_input {
float4 pos : POSITION;
float4 col : COLOR;
float4 color_bg : COLOR_BG;
float4 color_line : COLOR_LINE;
float4 color_x : COLOR_X;
float4 color_y : COLOR_Y;
float line_thickness : THICKNESS;
float line_spacing : SPACING;
float2 offset : OFFSET;
@ -8,7 +11,10 @@ struct vs_input {
struct ps_input {
float4 screen_pos : SV_POSITION;
float4 col : COLOR;
float4 color_bg : COLOR_BG;
float4 color_line : COLOR_LINE;
float4 color_x : COLOR_X;
float4 color_y : COLOR_Y;
float line_thickness : THICKNESS;
float line_spacing : SPACING;
float2 offset : OFFSET;
@ -24,7 +30,10 @@ ps_input vs_main(vs_input input)
ps_input output;
output.screen_pos = mul(projection, float4(input.pos.xy, 0.f, 1.f));
output.col = input.col;
output.color_bg = input.color_bg;
output.color_line = input.color_line;
output.color_x = input.color_x;
output.color_y = input.color_y;
output.line_thickness = input.line_thickness;
output.line_spacing = input.line_spacing;
output.offset = input.offset;
@ -34,20 +43,20 @@ ps_input vs_main(vs_input input)
float4 ps_main(ps_input input) : SV_TARGET
{
float2 screen_pos = input.screen_pos.xy + input.offset;
float2 grid_pos = input.screen_pos.xy + input.offset;
float half_thickness = input.line_thickness / 2;
float spacing = input.line_spacing;
float4 color = 0;
float4 color = input.color_bg;
float2 v = abs(round(screen_pos / spacing) * spacing - screen_pos);
float2 v = abs(round(grid_pos / spacing) * spacing - grid_pos);
float dist = min(v.x, v.y);
color = input.col * step(dist, half_thickness);
if (screen_pos.y <= half_thickness && screen_pos.y >= -half_thickness) {
color.r = 1;
}
if (screen_pos.x <= half_thickness && screen_pos.x >= -half_thickness) {
color.g = 1;
if (grid_pos.y <= half_thickness && grid_pos.y >= -half_thickness) {
color = input.color_x;
} else if (grid_pos.x <= half_thickness && grid_pos.x >= -half_thickness) {
color = input.color_y;
} else if (dist < half_thickness) {
color = input.color_line;
}
return color;

View File

@ -43,7 +43,7 @@ struct collider_collision_points_result {
struct collider_menkowski_simplex simplex;
struct collider_prototype prototype;
/* Clipping faces */
/* For debugging */
struct v2 a0, b0, a1, b1;
struct v2 a0_clipped, b0_clipped, a1_clipped, b1_clipped;
};

View File

@ -281,32 +281,34 @@ void __asan_unpoison_memory_region(void const volatile *add, size_t);
#endif
/* Color */
#define RGBA_32(r, g, b, a) (u32)((u32)(r) | ((u32)(g) << 8) | ((u32)(b) << 16) | ((u32)(a) << 24))
#define RGB_32(r, g, b) RGBA_32((r), (g), (b), 0xFF)
#define RGBA(r, g, b, a) (u32)((u32)(r) | ((u32)(g) << 8) | ((u32)(b) << 16) | ((u32)(a) << 24))
#define RGB(r, g, b) RGBA((r), (g), (b), 0xFF)
#define _RGB_U8_FROM_F32(fl) ((u8)((fl * 255.0) + 0.5))
#define RGBA_32F(r, g, b, a) RGBA_32(_RGB_U8_FROM_F32((r)), _RGB_U8_FROM_F32((g)), _RGB_U8_FROM_F32((b)), _RGB_U8_FROM_F32((a)))
#define RGB_32F(r, g, b) RGBA_32F((r), (g), (b), 1.f)
#define _RGB_U8_FROM_F(fl) ((u8)((fl * 255.0) + 0.5))
#define RGBA_F(r, g, b, a) RGBA(_RGB_U8_FROM_F((r)), _RGB_U8_FROM_F((g)), _RGB_U8_FROM_F((b)), _RGB_U8_FROM_F((a)))
#define RGB_F(r, g, b) RGBA_F((r), (g), (b), 1.f)
#define ALPHA_32_F(color, a) ((color) & 0xFFFFFF00) | _RGB_U8_FROM_F32((a))
#define ALPHA_F(color, a) ((color) & 0xFFFFFF00) | _RGB_U8_FROM_F((a))
/* Palette color defines */
#define COLOR_WHITE COLOR_TRUE_WHITE
#define COLOR_BLACK COLOR_TRUE_BLACK
#define COLOR_RED RGB_32(0xFF, 0x7F, 0x51)
#define COLOR_GREEN RGB_32(0x9E, 0xB2, 0x5D)
#define COLOR_BLUE RGB_32(0x25, 0x8E, 0xA6)
#define COLOR_YELLOW COLOR_TRUE_YELLOW
#define COLOR_PURPLE RGB_32(0xFF, 0x57, 0xBB)
#define COLOR_WHITE RGB(0xE6, 0xE8, 0xE6)
#define COLOR_BLACK RGB(0x4C, 0x2E, 0x05)
#define COLOR_RED RGB(0x6F, 0x1D, 0x1B)
#define COLOR_GREEN RGB(0x26, 0xA9, 0x6C)
#define COLOR_BLUE RGB(0x25, 0x8E, 0xA6)
#define COLOR_YELLOW RGB(0xFC, 0xF6, 0xB1)
#define COLOR_ORANGE RGB(0xFF, 0x7F, 0x51)
#define COLOR_PURPLE RGB(0xFF, 0x57, 0xBB)
/* True color defines */
#define COLOR_TRUE_WHITE RGB_32(0xFF, 0xFF, 0xFF)
#define COLOR_TRUE_BLACK RGB_32(0xFF, 0xFF, 0xFF)
#define COLOR_TRUE_RED RGB_32(0xFF, 0xFF, 0xFF)
#define COLOR_TRUE_GREEN RGB_32(0xFF, 0xFF, 0xFF)
#define COLOR_TRUE_BLUE RGB_32(0xFF, 0xFF, 0xFF)
#define COLOR_TRUE_YELLOW RGB_32(0xFF, 0xFF, 0xFF)
#define COLOR_TRUE_PURPLE RGB_32(0xFF, 0xFF, 0XFF)
#define COLOR_TRUE_WHITE RGB(0xFF, 0xFF, 0xFF)
#define COLOR_TRUE_BLACK RGB(0x00, 0x00, 0x00)
#define COLOR_TRUE_RED RGB(0xFF, 0x00, 0x00)
#define COLOR_TRUE_GREEN RGB(0x00, 0xFF, 0x00)
#define COLOR_TRUE_BLUE RGB(0x00, 0x00, 0xFF)
#define COLOR_TRUE_YELLOW RGB(0xFF, 0xFF, 0x00)
#define COLOR_TRUE_ORANGE RGB(0xFF, 0xA5, 0x00)
#define COLOR_TRUE_PURPLE RGB(0xFF, 0x00, 0XFF)
/* Barrier */
#if COMPILER_MSVC

View File

@ -37,7 +37,7 @@
/* 64^2 = 4096 bins */
#define SPACE_CELL_BINS_SQRT (64)
#define SPACE_CELL_SIZE (4)
#define SPACE_CELL_SIZE (1)
#define SIM_TILES_PER_UNIT_SQRT (2)
#define SIM_TILES_PER_CHUNK_SQRT (1)
@ -60,7 +60,7 @@
#define SIM_MAX_LINEAR_VELOCITY 500
#define SIM_MAX_ANGULAR_VELOCITY (TAU * 20)
#define COLLIDER_DEBUG 1
#define COLLIDER_DEBUG 0
#define COLLIDER_DEBUG_DETAILED 1
#define COLLIDER_DEBUG_DETAILED_DRAW_MENKOWSKI 1

View File

@ -285,7 +285,7 @@ void draw_collider_line(struct renderer_cmd_buffer *cmdbuff, struct xform draw_x
* Grid
* ========================== */
void draw_grid(struct renderer_cmd_buffer *cmdbuff, struct rect rect, u32 color, f32 thickness, f32 spacing, struct v2 offset)
void draw_grid(struct renderer_cmd_buffer *cmdbuff, struct rect rect, u32 color_bg, u32 color_line, u32 color_x, u32 color_y, f32 thickness, f32 spacing, struct v2 offset)
{
struct renderer_cmd_parameters cmd_params = ZI;
cmd_params.kind = SHADER_GRID;
@ -298,7 +298,10 @@ void draw_grid(struct renderer_cmd_buffer *cmdbuff, struct rect rect, u32 color,
struct quad quad = quad_from_rect(rect);
struct grid_shader_vertex attributes = ZI;
attributes.color = color;
attributes.color_bg = color_bg;
attributes.color_line = color_line;
attributes.color_x= color_x;
attributes.color_y = color_y;
attributes.line_thickness = thickness;
attributes.line_spacing = spacing;
attributes.offset = offset;

View File

@ -42,7 +42,7 @@ void draw_arrow_line(struct renderer_cmd_buffer *cmdbuff, struct v2 start, struc
void draw_arrow_ray(struct renderer_cmd_buffer *cmdbuff, struct v2 pos, struct v2 rel, f32 thickness, f32 arrowhead_height, u32 color);
void draw_collider_line(struct renderer_cmd_buffer *cmdbuff, struct xform draw_xf, struct collider_shape shape, struct xform shape_xf, f32 thickness, u32 color, u32 detail);
void draw_grid(struct renderer_cmd_buffer *cmdbuff, struct rect rect, u32 color, f32 thickness, f32 spacing, struct v2 offset);
void draw_grid(struct renderer_cmd_buffer *cmdbuff, struct rect rect, u32 color_bg, u32 color_line, u32 color_x, u32 color_y, f32 thickness, f32 spacing, struct v2 offset);
void draw_text(struct renderer_cmd_buffer *cmdbuff, struct font *font, struct v2 pos, struct string str);
void draw_text_ex(struct renderer_cmd_buffer *cmdbuff, struct font *font, struct v2 pos, f32 scale, struct string str);

View File

@ -45,7 +45,10 @@ PACK(struct triangle_shader_vertex {
PACK(struct grid_shader_vertex {
struct v2 pos;
u32 color;
u32 color_bg;
u32 color_line;
u32 color_x;
u32 color_y;
f32 line_thickness;
f32 line_spacing;
struct v2 offset;

View File

@ -223,7 +223,10 @@ INTERNAL void init_shader_table(void)
.vertex_size = sizeof(struct grid_shader_vertex),
.input_layout_desc = {
{ "POSITION", 0, DXGI_FORMAT_R32G32_FLOAT, 0, D3D11_APPEND_ALIGNED_ELEMENT, D3D11_INPUT_PER_VERTEX_DATA, 0 },
{ "COLOR", 0, DXGI_FORMAT_R8G8B8A8_UNORM, 0, D3D11_APPEND_ALIGNED_ELEMENT, D3D11_INPUT_PER_VERTEX_DATA, 0 },
{ "COLOR_BG", 0, DXGI_FORMAT_R8G8B8A8_UNORM, 0, D3D11_APPEND_ALIGNED_ELEMENT, D3D11_INPUT_PER_VERTEX_DATA, 0 },
{ "COLOR_LINE", 0, DXGI_FORMAT_R8G8B8A8_UNORM, 0, D3D11_APPEND_ALIGNED_ELEMENT, D3D11_INPUT_PER_VERTEX_DATA, 0 },
{ "COLOR_X", 0, DXGI_FORMAT_R8G8B8A8_UNORM, 0, D3D11_APPEND_ALIGNED_ELEMENT, D3D11_INPUT_PER_VERTEX_DATA, 0 },
{ "COLOR_Y", 0, DXGI_FORMAT_R8G8B8A8_UNORM, 0, D3D11_APPEND_ALIGNED_ELEMENT, D3D11_INPUT_PER_VERTEX_DATA, 0 },
{ "THICKNESS", 0, DXGI_FORMAT_R32_FLOAT, 0, D3D11_APPEND_ALIGNED_ELEMENT, D3D11_INPUT_PER_VERTEX_DATA, 0 },
{ "SPACING", 0, DXGI_FORMAT_R32_FLOAT, 0, D3D11_APPEND_ALIGNED_ELEMENT, D3D11_INPUT_PER_VERTEX_DATA, 0 },
{ "OFFSET", 0, DXGI_FORMAT_R32G32_FLOAT, 0, D3D11_APPEND_ALIGNED_ELEMENT, D3D11_INPUT_PER_VERTEX_DATA, 0 }

View File

@ -302,7 +302,7 @@ INTERNAL PHYS_COLLISION_CALLBACK_FUNC_DEF(on_collision, data, step_ctx)
struct xform xf = XFORM_TRS(.t = point, .r = rand_f64_from_state(&step_ctx->rand, 0, TAU));
struct sim_ent *decal = sim_ent_alloc_sync_src(root);
decal->sprite = sprite_tag_from_path(LIT("res/graphics/blood.ase"));
decal->sprite_tint = RGBA_32F(1, 1, 1, 0.25f);
decal->sprite_tint = RGBA_F(1, 1, 1, 0.25f);
decal->layer = SIM_LAYER_FLOOR_DECALS;
sim_ent_set_xform(decal, xf);

View File

@ -76,8 +76,8 @@ struct ttf_startup_receipt ttf_startup(void)
struct ttf_decode_result ttf_decode(struct arena *arena, struct string encoded, f32 point_size, u32 *cache_codes, u32 cache_codes_count)
{
COLORREF bg_color = RGB_32(0,0,0);
COLORREF fg_color = RGB_32(255,255,255);
COLORREF bg_color = RGB(0,0,0);
COLORREF fg_color = RGB(255,255,255);
IDWriteFactory5 *factory = G.factory;
@ -259,7 +259,7 @@ struct ttf_decode_result ttf_decode(struct arena *arena, struct string encoded,
u64 in_x = (u64)bounding_box.left + x;
u32 *out_pixel = out_data + (out_x + (out_y * atlas_w));
u32 *in_pixel = in_data + (in_x + (in_y * in_pitch));
*out_pixel = RGBA_32(0xFF, 0xFF, 0xFF, *in_pixel & 0xFF);
*out_pixel = RGBA(0xFF, 0xFF, 0xFF, *in_pixel & 0xFF);
}
}
out_offset_x += tex_w;

View File

@ -320,7 +320,7 @@ INTERNAL void debug_draw_xform(struct xform xf, u32 color_x, u32 color_y)
draw_arrow_ray(G.ui_cmd_buffer, pos, x_ray, thickness, arrowhead_len, color_x);
draw_arrow_ray(G.ui_cmd_buffer, pos, y_ray, thickness, arrowhead_len, color_y);
//u32 color_quad = RGBA_32F(0, 1, 1, 0.3);
//u32 color_quad = RGBA_F(0, 1, 1, 0.3);
//struct quad quad = quad_from_rect(RECT(0, 0, 1, -1));
//quad = xform_mul_quad(xf, quad_scale(quad, 0.075f));
//draw_quad(G.ui_cmd_buffer, quad, color);
@ -332,7 +332,7 @@ INTERNAL void debug_draw_movement(struct sim_ent *ent)
f32 thickness = 2.f;
f32 arrow_len = 15.f;
u32 color_vel = RGBA_32F(1, 0.5, 0, 1);
u32 color_vel = COLOR_ORANGE;
struct xform xf = sim_ent_get_xform(ent);
struct v2 velocity = ent->linear_velocity;
@ -886,14 +886,13 @@ INTERNAL void user_update(void)
{
f32 thickness = 2;
u32 color = RGBA_32(0x3f, 0x3f, 0x3f, 0xFF);
struct v2 offset = v2_neg(xform_mul_v2(G.world_to_ui_xf, V2(0, 0)));
f32 spacing = xform_get_scale(G.world_to_ui_xf).x;
struct v2 pos = xform_invert_mul_v2(G.world_to_ui_xf, V2(0, 0));
struct v2 size = xform_basis_invert_mul_v2(G.world_to_ui_xf, G.ui_size);
draw_grid(G.world_cmd_buffer, RECT_FROM_V2(pos, size), color, thickness, spacing, offset);
draw_grid(G.world_cmd_buffer, RECT_FROM_V2(pos, size), 0, RGBA(0x3f, 0x3f, 0x3f, 0xFF), COLOR_RED, COLOR_GREEN, thickness, spacing, offset);
}
#if 0
@ -1069,8 +1068,8 @@ INTERNAL void user_update(void)
}
f32 thickness = 0.01f;
u32 color_start = RGBA_32F(1, 0.5, 0, opacity_a);
u32 color_end = RGBA_32F(1, 0.8, 0.4, opacity_b);
u32 color_start = RGBA_F(1, 0.5, 0, opacity_a);
u32 color_end = RGBA_F(1, 0.8, 0.4, opacity_b);
if (opacity_b > 0.99f) {
draw_circle(G.world_cmd_buffer, b, thickness / 2, color_end, 20);
@ -1109,8 +1108,8 @@ INTERNAL void user_update(void)
/* Draw xform */
if (!skip_debug_draw_transform) {
u32 color_x = RGBA_32F(1, 0, 0, 0.5);
u32 color_y = RGBA_32F(0, 1, 0, 0.5);
u32 color_x = RGBA_F(1, 0, 0, 0.5);
u32 color_y = RGBA_F(0, 1, 0, 0.5);
debug_draw_xform(xf, color_x, color_y);
}
@ -1118,7 +1117,7 @@ INTERNAL void user_update(void)
if (ent->local_collider.count > 0) {
struct aabb aabb = collider_aabb_from_collider(&ent->local_collider, xf);
f32 thickness = 1;
u32 color = RGBA_32F(1, 0, 1, 0.5);
u32 color = RGBA_F(1, 0, 1, 0.5);
struct quad quad = quad_from_aabb(aabb);
quad = xform_mul_quad(G.world_to_ui_xf, quad);
draw_quad_line(G.ui_cmd_buffer, quad, thickness, color);
@ -1132,7 +1131,7 @@ INTERNAL void user_update(void)
start = xform_mul_v2(G.world_to_ui_xf, start);
struct v2 end = v2_add(xf.og, ent->control.focus);
end = xform_mul_v2(G.world_to_ui_xf, end);
draw_arrow_line(G.ui_cmd_buffer, start, end, 3, 10, RGBA_32F(1, 1, 1, 0.5));
draw_arrow_line(G.ui_cmd_buffer, start, end, 3, 10, RGBA_F(1, 1, 1, 0.5));
}
#if 0
@ -1140,9 +1139,9 @@ INTERNAL void user_update(void)
if (!sprite_tag_is_nil(ent->sprite)) {
struct sprite_sheet *sheet = sprite_sheet_from_tag_async(sprite_frame_scope, sprite);
u32 quad_color = RGBA_32F(1, 0, 0.5, 1);
u32 point_color = RGBA_32F(1, 0, 0, 1);
u32 ray_color = RGBA_32F(1, 0, 0.5, 1);
u32 quad_color = RGBA_F(1, 0, 0.5, 1);
u32 point_color = RGBA_F(1, 0, 0, 1);
u32 ray_color = RGBA_F(1, 0, 0.5, 1);
for (u64 i = 0; i < sheet->slice_groups_count; ++i) {
struct sprite_sheet_slice_group *group = &sheet->slice_groups[i];
@ -1177,7 +1176,7 @@ INTERNAL void user_update(void)
/* Draw collider */
if (ent->local_collider.count > 0) {
struct collider_shape collider = ent->local_collider;
u32 color = RGBA_32F(1, 1, 0, 0.5);
u32 color = RGBA_F(1, 1, 0, 0.5);
f32 thickness = 2;
{
/* Draw collider using support points */
@ -1228,8 +1227,8 @@ INTERNAL void user_update(void)
/* Draw point */
{
//u32 color = contact.persisted ? RGBA_32F(1, 1, 0, 0.50) : RGBA_32F(1, 0, 0, 0.50);
u32 color = ALPHA_32_F(COLOR_YELLOW, 0.50);
//u32 color = contact.persisted ? RGBA_F(1, 1, 0, 0.50) : RGBA_F(1, 0, 0, 0.50);
u32 color = ALPHA_F(COLOR_YELLOW, 0.50);
//struct v2 point = xform_mul_v2(e0_xf, contact.p0_local);
//struct v2 point = contact.p0_initial_world;
draw_circle(G.ui_cmd_buffer, xform_mul_v2(G.world_to_ui_xf, dbg_pt), radius, color, 10);
@ -1297,7 +1296,7 @@ INTERNAL void user_update(void)
#if 0
{
f32 radius = 4;
u32 color = RGBA_32F(1, 1, 0, 0.5);
u32 color = RGBA_F(1, 1, 0, 0.5);
struct v2 a = xform_mul_v2(G.world_to_ui_xf, data->closest0);
struct v2 b = xform_mul_v2(G.world_to_ui_xf, data->closest1);
draw_circle(G.ui_cmd_buffer, a, radius, color, 10);
@ -1307,14 +1306,14 @@ INTERNAL void user_update(void)
/* Draw clipping */
{
f32 thickness = 2;
f32 thickness = 4;
f32 radius = 4;
u32 color_line = RGBA_32F(1, 0, 1, 0.25);
u32 color_a = RGBA_32F(1, 0, 0, 0.25);
u32 color_b = RGBA_32F(0, 1, 0, 0.25);
u32 color_line_clipped = RGBA_32F(1, 0, 1, 1);
u32 color_a_clipped = RGBA_32F(1, 0, 0, 1);
u32 color_b_clipped = RGBA_32F(0, 1, 0, 1);
u32 color_line = RGBA_F(1, 0, 1, 0.75);
u32 color_a = RGBA_F(1, 0, 0, 0.25);
u32 color_b = RGBA_F(0, 1, 0, 0.25);
u32 color_line_clipped = RGBA_F(1, 0, 1, 1);
u32 color_a_clipped = RGBA_F(1, 0, 0, 1);
u32 color_b_clipped = RGBA_F(0, 1, 0, 1);
{
struct v2 a = xform_mul_v2(G.world_to_ui_xf, collider_res.a0);
struct v2 b = xform_mul_v2(G.world_to_ui_xf, collider_res.b0);
@ -1388,7 +1387,7 @@ INTERNAL void user_update(void)
/* Draw menkowski */
{
u32 color = collider_res.solved ? RGBA_32F(0, 0, 0.25, 1) : RGBA_32F(0, 0.25, 0.25, 1);
u32 color = collider_res.solved ? RGBA_F(0, 0, 0.25, 1) : RGBA_F(0, 0.25, 0.25, 1);
f32 thickness = 2;
u32 detail = 512;
(UNUSED)thickness;
@ -1402,7 +1401,7 @@ INTERNAL void user_update(void)
/* Draw cloud */
{
u32 color = RGBA_32F(1, 1, 1, 1);
u32 color = RGBA_F(1, 1, 1, 1);
f32 radius = 2;
struct v2_array m = cloud(temp.arena, &e0_collider, &e1_collider, e0_xf, e1_xf);
@ -1416,7 +1415,7 @@ INTERNAL void user_update(void)
/* Draw prototype */
{
f32 thickness = 2;
u32 color = RGBA_32F(1, 1, 1, 0.25);
u32 color = RGBA_F(1, 1, 1, 0.25);
struct v2_array m = {
.points = collider_res.prototype.points,
@ -1431,9 +1430,9 @@ INTERNAL void user_update(void)
{
f32 thickness = 2;
u32 line_color = COLOR_YELLOW;
u32 color_first = RGBA_32F(1, 0, 0, 0.75);
u32 color_second = RGBA_32F(0, 1, 0, 0.75);
u32 color_third = RGBA_32F(0, 0, 1, 0.75);
u32 color_first = RGBA_F(1, 0, 0, 0.75);
u32 color_second = RGBA_F(0, 1, 0, 0.75);
u32 color_third = RGBA_F(0, 0, 1, 0.75);
struct collider_menkowski_simplex simplex = collider_res.simplex;
struct v2 simplex_points[] = { simplex.a.p, simplex.b.p, simplex.c.p };
@ -1475,7 +1474,7 @@ INTERNAL void user_update(void)
/* Draw hierarchy */
if (sim_ent_has_prop(parent, SEPROP_ACTIVE) && !parent->is_root) {
u32 color = RGBA_32F(0.6, 0.6, 1, 0.75);
u32 color = RGBA_F(0.6, 0.6, 1, 0.75);
f32 thickness = 2;
f32 arrow_height = 15;
@ -1486,7 +1485,7 @@ INTERNAL void user_update(void)
/* Draw camera rect */
if (sim_ent_has_prop(ent, SEPROP_CAMERA)) {
u32 color = ent == local_camera ? RGBA_32F(1, 1, 1, 0.5) : RGBA_32F(0, 0.75, 0, 0.5);
u32 color = ent == local_camera ? RGBA_F(1, 1, 1, 0.5) : RGBA_F(0, 0.75, 0, 0.5);
f32 thickness = 3;
struct xform quad_xf = xform_mul(xf, ent->camera_quad_xform);
@ -1505,7 +1504,7 @@ INTERNAL void user_update(void)
if (!G.debug_camera) {
__profscope(draw_crosshair);
struct v2 crosshair_pos = G.ui_cursor;
u32 tint = RGBA_32F(1, 1, 1, 1);
u32 tint = RGBA_F(1, 1, 1, 1);
struct sprite_tag crosshair_tag = sprite_tag_from_path(LIT("res/graphics/crosshair.ase"));
struct sprite_texture *t = sprite_texture_from_tag_async(sprite_frame_scope, crosshair_tag);
@ -1901,10 +1900,10 @@ INTERNAL void user_update(void)
/* Execute render cmds */
{
/* Clear textures */
renderer_texture_clear(G.world_texture, RGBA_32F(0.2f, 0.2f, 0.2f, 1.f));
renderer_texture_clear(G.ui_texture, RGBA_32F(0, 0, 0, 0));
renderer_texture_clear(G.final_texture, RGBA_32F(0, 0, 0, 0));
renderer_texture_clear(G.backbuffer_texture, RGBA_32F(0, 0, 0, 1));
renderer_texture_clear(G.world_texture, RGBA_F(0.2f, 0.2f, 0.2f, 1.f));
renderer_texture_clear(G.ui_texture, RGBA_F(0, 0, 0, 0));
renderer_texture_clear(G.final_texture, RGBA_F(0, 0, 0, 0));
renderer_texture_clear(G.backbuffer_texture, RGBA_F(0, 0, 0, 1));
/* Render to world texture */
renderer_texture_render(G.world_texture, G.world_cmd_buffer, G.world_to_ui_xf, ui_viewport, sprite_frame_scope);