player_rotation.x = rotate_speed;
}
+ if (IsKeyDown(KEY_SPACE) || IsKeyDown(KEY_LEFT_SHIFT) || IsKeyDown(KEY_RIGHT_SHIFT))
+ {
+ //player_velocity.x *= 2.0f;
+ }
+
switch(key)
{
default:
void initialize_prerenderer()
{
- fscreen_dims = (Vector2){.x=1200.0f, .y=800.0f};
+ fscreen_dims = (Vector2){.x=screen_dims.x, .y=screen_dims.y};
}
void initialize_renderer()
cam = (Camera3D){0};
cam.position = barrow_position;
cam.position.y -= 0.5f;
- cam.position.x = barrow_scale.x/2 + barrow_position.x;
+ cam.position.x = 0;//barrow_scale.x/2;
+ cam.position.z = -barrow_scale.z/2;
cam.target = (Vector3){0.0f, cam.position.y - 12.0f, 0.0f};
cam.up = (Vector3){0.0f, 1.0f, 0.0f};
- cam.fovy = 75.0f;
+ cam.fovy = 90.0f;
cam.projection= CAMERA_PERSPECTIVE;
DisableCursor();
EndMode3D();
DrawTexturePro(barrow_texture, minimap_src, minimap_dest, (Vector2){0.0f, 0.0f}, 0.0f, RAYWHITE);
- DrawText(TextFormat("%f, %f", fscreen_dims.x, fscreen_dims.y), 0, 32, 32, RAYWHITE);
- DrawFPS(10, 10);
+ DrawFPS(fscreen_dims.x - 80, 10);
EndDrawing();
/* Decay forward velocity and rotation */
// Texel color fetching from texture sampler
vec4 texelColor = texture(texture0, fragTexCoord);
- const float max_dist = 4.0f;
- const float max_lum = 0.7f;
+ const float max_dist = 7.5f;
+ const float lit_dist = 2.5f;
+ const float max_lum = 1.0f;
float cam_dist_z = gl_FragCoord.z/gl_FragCoord.w;
float norm_dist_z = (cam_dist_z/max_dist);
float norm_x_dist = abs(gl_FragCoord.x - (screen_dims.x/2))/(screen_dims.x/2);
lumWeight = min(max_lum, 1.0f - easeInQuart(norm_dist_z));
}
-
vec3 lumWeights = v3_unit * lumWeight;
- float lum = dot(finalColor.rgb, lumWeights);
- float rand = random(fragTexCoord);
- lumWeights *= lum;
- finalColor.rgb = mix(vec3(227/255, 60/255, 0/255), finalColor.rgb, lumWeights);
- finalColor.a = 1.0f;
// All single color channel variations with this looks cool as FUCK
// turns this into three levels going b-r-g
- //float norm_y_dist = (gl_FragCoord.y * screen_dims.y) / screen_dims.y;
float norm_y_dist = uv.y;
finalColor.b = 0.0f;
- if(distance(uv, vec2(0.25, 0.35)) <= 0.25)
+ if(cam_dist_z < lit_dist)
{
- finalColor.b = 1.0f;
+ float norm_x_dist = abs(gl_FragCoord.x - (screen_dims.x/2))/(screen_dims.x/2);
+ lumWeights.r = 1.8f * (1.0f - norm_dist_z);
}
+
+ float lum = dot(finalColor.rgb, lumWeights);
+ float rand = random(fragTexCoord);
+ lumWeights *= lum;
+ finalColor.rgb = mix(vec3(227/255, 60/255, 0/255), finalColor.rgb, lumWeights);
+ finalColor.a = 1.0f;
+
}
const char chars[6] = {' ', ' ', ' ', '+', '#', '@'};
const int max_chars = sizeof(chars) / sizeof(chars[0]) - 1;
-const IVec2 screen_dims = {.x = 1200, .y = 800};
+const IVec2 screen_dims = {.x = 1800, .y = 1200};
const char* screen_title = "Barrow Crawler";
const int target_fps = 60;
}
/* Set up seed-points to create connected rooms */
- const int seed_count = 9;//sqrt(grid_size.x) * 2;
+ const int seed_count = 10;//sqrt(grid_size.x) * 2;
const int width = 12 * (grid_size.x/128);
const int height = width * 1;
const float small_room_radius = 16.0f;
angle += phase;
int seed_x = ((cosf(angle) * (grid_size.x/4.0f)) + (grid_size.x/2.0f));
- int seed_y = ((sinf(angle) * (grid_size.x/4.0f)) + (grid_size.x/2.0f));
+ int seed_y = ((sinf(angle) * (grid_size.y/4.0f)) + (grid_size.y/2.0f));
+
+
grid[seed_x][seed_y].b = 1.0f;
grid[seed_x][seed_y].c = 0.0f;
uint32_t albedo_buffer[pgrid_size.x][pgrid_size.y];
uint32_t large_albedo_buffer[pgrid_size.x*img_export_scale.x][pgrid_size.y*img_export_scale.y];
+ int entrance_radius = 16.0f;
+ int seed_x = grid_size.x/2;
+ int seed_y = entrance_radius;
+ for (int x = seed_x-entrance_radius; x < seed_x+entrance_radius; x++)
+ {
+ for (int y = seed_y-entrance_radius; y < seed_y+entrance_radius; y++)
+ {
+ if ((sqrtf(((x-seed_x)*(x-seed_x))+((y-seed_y)*(y-seed_y))) < entrance_radius))
+ grid_buffer[x][y].a = 0.0f;
+ }
+ }
+
for (int x = 0; x < pgrid_size.x; x++)
{
for (int y = 0; y < pgrid_size.y; y++)