diff --git a/assets/scenes/PBRTest.glb b/assets/scenes/PBRTest.glb index cdf485b0..1b771e94 100644 --- a/assets/scenes/PBRTest.glb +++ b/assets/scenes/PBRTest.glb @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:598e172dc3ebe8ab618efbc19c9982547c35af98f05edf41597fc32df8e6a19d -size 39536 +oid sha256:dd139370a8046302200ff6b8a4de04a37942af21e265d0950ea2082763628772 +size 13858688 diff --git a/assets/scenes/pbr_test.blend b/assets/scenes/pbr_test.blend index 79b9099a..6b54d321 100644 --- a/assets/scenes/pbr_test.blend +++ b/assets/scenes/pbr_test.blend @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:bc2fc2a8d2eb8adf4a1cf0730a19cc0e6cc9999f7626c122da62afdd5eb07df5 -size 60454849 +oid sha256:a50b4ae3241d39e99a4965d8ed5fc399226c14df50a6250be3a2d4f11dcbb4a5 +size 47192389 diff --git a/source/gltf_P3N3T4U2.hlsl b/source/gltf_P3N3T4U2.hlsl index 549003b8..281a570a 100644 --- a/source/gltf_P3N3T4U2.hlsl +++ b/source/gltf_P3N3T4U2.hlsl @@ -23,7 +23,6 @@ struct Interpolators { float3 tangent : TANGENT0; float3 binormal : BINORMAL0; float2 uv : TEXCOORD0; - float4 clip : TEXCOORD1; }; Interpolators vert(VertexIn i) { @@ -42,7 +41,6 @@ Interpolators vert(VertexIn i) { o.tangent = normalize(mul(orientation, i.tangent.xyz)); o.binormal = normalize(cross(o.tangent, o.normal) * i.tangent.w); o.uv = uv_transform(i.uv, material_data.tex_transform); - o.clip = clip_pos; return o; } @@ -65,7 +63,7 @@ float4 frag(Interpolators i, bool front_face : SV_IsFrontFace) : SV_TARGET { float3 V = normalize(camera_data.view_pos - i.world_pos); float3 R = reflect(-V, N); - float2 screen_uv = (i.clip.xy / i.clip.w) * 0.5 + 0.5; + float2 screen_uv = (i.clip_pos.xy / i.clip_pos.w) * 0.5 + 0.5; float4 out_color = 0; if (consts.perm & GLTF_PERM_PBR_METALLIC_ROUGHNESS) { diff --git a/source/irradiance.hlsl b/source/irradiance.hlsl index 8fb4e839..3bedfc05 100644 --- a/source/irradiance.hlsl +++ b/source/irradiance.hlsl @@ -41,7 +41,7 @@ float4 frag(Interpolators i) : SV_TARGET { float3 tmp_vec = cos(phi) * right + sin(phi) * up; float3 sample_vec = cos(theta) * normal + sin(theta) * tmp_vec; - // Clamp each sample to 1 to avoid blowout + // Clamp each sample to 10 to avoid blowout irradiance += min(env_map.Sample(material_sampler, sample_vec).rgb, 10) * cos(theta) * sin(theta); sample_count++; diff --git a/source/noclipcontrollersystem.c b/source/noclipcontrollersystem.c index c34eddf4..ebf369f6 100644 --- a/source/noclipcontrollersystem.c +++ b/source/noclipcontrollersystem.c @@ -92,6 +92,7 @@ void noclip_update_tick(ecs_iter_t *it) { translate(&transform->transform, velocity); rotate(&transform->transform, angular_velocity); + transform->dirty = true; } TracyCZoneEnd(ctx); } diff --git a/source/thirdpersonsystems.cpp b/source/thirdpersonsystems.cpp index e3909224..79d31d15 100644 --- a/source/thirdpersonsystems.cpp +++ b/source/thirdpersonsystems.cpp @@ -64,7 +64,9 @@ void update_tp_movement(flecs::world &ecs, float delta_time, // Construct target position to move the camera to // TODO: Make this adjustable by the player - float distance = 10.0f; + static float distance = 10.0f; + distance += input.mouse.wheel.y; + distance = clampf(distance, 5, 15); float3 camera_pos = body_to_cam * distance; // TODO: The local space offset we want the camera to focus on