Skip to content

Commit

Permalink
fix blackhole warping
Browse files Browse the repository at this point in the history
the cubemap sampling was incorrect
  • Loading branch information
BarthPaleologue committed Sep 6, 2024
1 parent 1c6f8c4 commit a7054d8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/shaders/blackhole.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -274,10 +274,11 @@ void main() {
behindBH = behindBH && dot(closestPointEndRay - camera_position, object_position - camera_position) >= 0.0;

vec4 bg = vec4(0.0);
if(uv.x >= 0.0 && uv.x <= 1.0 && uv.y >= 0.0 && uv.y <= 1.0 && behindBH) {
if(uv.x > 0.0 && uv.x < 1.0 && uv.y > 0.0 && uv.y < 1.0 && behindBH) {
bg = texture2D(textureSampler, uv);
} else {
rayDir = vec3(starfieldRotation * vec4(rayDir, 1.0));
rayDir.z *= -1.0;
bg = texture(starfieldTexture, rayDir);
}

Expand Down

0 comments on commit a7054d8

Please sign in to comment.