Vector2 fscreen_dims;
Camera3D cam;
-
Image barrow_image;
Texture barrow_texture;
Texture barrow_albedo;
Vector3 player_velocity;
Vector3 player_rotation;
-float forward_speed = 0.025f;
+float forward_speed = 0.015f;
float forward_speed_decay = 0.05f;
float rotate_speed = 0.8f;
float rotate_speed_decay = 0.10f;
while((key = GetKeyPressed()));
}
+void initialize_prerenderer()
+{
+ fscreen_dims = (Vector2){.x=1200.0f, .y=800.0f};
+}
+
void initialize_renderer()
{
- fscreen_dims = (Vector2){.x=screen_dims.x, .y=screen_dims.y};
shader = LoadShader("./src/shaders/lighting.vs", "./src/shaders/lighting.fs");
shader.locs[SHADER_LOC_VECTOR_VIEW] = GetShaderLocation(shader, "viewPos");
void start_render_loop()
{
+ initialize_prerenderer();
InitWindow(fscreen_dims.x, fscreen_dims.y, screen_title);
+ SetWindowState(FLAG_VSYNC_HINT | FLAG_WINDOW_RESIZABLE);
initialize_renderer();
Rectangle minimap_dest = {.width = 64.0f*img_export_scale.x, .height = 64.0f*img_export_scale.y, .x = 0.0f, .y = 0.0f};
SetShaderValue(shader, screen_dims_shader_loc, &fscreen_dims, SHADER_UNIFORM_VEC2);
UpdateCameraPro(&cam, player_velocity, player_rotation, 0.0f);
+
BeginDrawing();
ClearBackground(BLACK);
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);
EndDrawing();
const vec3 v3_unit = vec3(1.0f, 1.0f, 1.0f);
float lumWeight = 0.0f;
+const vec2 candle_pos = vec2(0.5, 0.5);
+
// A single iteration of Bob Jenkins' One-At-A-Time hashing algorithm.
uint hash( uint x ) {
x += ( x << 10u );
// Texel color fetching from texture sampler
vec4 texelColor = texture(texture0, fragTexCoord);
- // NOTE: Implement here your fragment shader code
-
- const float max_dist = 6.0f;
+ const float max_dist = 4.0f;
const float max_lum = 0.7f;
float cam_dist_z = gl_FragCoord.z/gl_FragCoord.w;
- float norm_dist_z = cam_dist_z/max_dist;
+ float norm_dist_z = (cam_dist_z/max_dist);
+
+ vec2 uv = gl_FragCoord.xy/screen_dims;
finalColor = texelColor*colDiffuse;
{
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);
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)
+ {
+ finalColor.b = 1.0f;
+ }
}