~ | Fixing path

This commit is contained in:
TheRedShip
2025-02-22 17:51:59 +01:00
committed by tomoron
parent 4b32b3b19f
commit fab9bead64
3 changed files with 5 additions and 5 deletions

View File

@ -246,7 +246,7 @@ hitInfo traverseBVHs(Ray ray, inout Stats stats)
hitInfo temp_hit = traceBVH(transformedRay, BvhData[i], stats); hitInfo temp_hit = traceBVH(transformedRay, BvhData[i], stats);
float transformed_t = temp_hit.t / bvh_data.scale; float transformed_t = temp_hit.t * (1.0 / bvh_data.scale);
if (transformed_t < hit.t) if (transformed_t < hit.t)
{ {
GPUTriangle triangle = triangles[temp_hit.obj_index]; GPUTriangle triangle = triangles[temp_hit.obj_index];
@ -322,8 +322,8 @@ void main()
if (pixel_coords.x >= int(u_resolution.x) || pixel_coords.y >= int(u_resolution.y)) if (pixel_coords.x >= int(u_resolution.x) || pixel_coords.y >= int(u_resolution.y))
return; return;
vec2 uv = ((vec2(pixel_coords)) / u_resolution) * 2.0 - 1.0;; vec2 uv = ((vec2(pixel_coords)) * (1.0 / u_resolution)) * 2.0 - 1.0;;
uv.x *= u_resolution.x / u_resolution.y; uv.x *= u_resolution.x * (1.0 / u_resolution.y);
vec3 color = debugColor(uv); vec3 color = debugColor(uv);

View File

@ -67,7 +67,7 @@ void main()
totalWeight += weight; totalWeight += weight;
} }
} }
light /= totalWeight; light * (1.0 / totalWeight);
if (u_pass == u_pass_count - 1) if (u_pass == u_pass_count - 1)
{ {
vec4 color = light * imageLoad(color_texture, pixel_coords); vec4 color = light * imageLoad(color_texture, pixel_coords);

View File

@ -112,7 +112,7 @@ int Camera::portalTeleport(Scene *scene, float delta_time, Renderer &renderer)
float distance_future_pos = glm::length(future_pos - _position); float distance_future_pos = glm::length(future_pos - _position);
float distance_portal = glm::length(point_projected - _position); float distance_portal = glm::length(point_projected - _position);
float imprecision = 0.1f; float imprecision = 0.101f;
if (distance_portal <= distance_future_pos && glm::dot(glm::normalize(future_pos - _position), obj.normal) > 0.0f) if (distance_portal <= distance_future_pos && glm::dot(glm::normalize(future_pos - _position), obj.normal) > 0.0f)
{ {
std::cout << "Teleport" << std::endl; std::cout << "Teleport" << std::endl;