The problem was caused by this line:
int3 mapPos = int3(floor(rayPos + 0.5));
I used ChatGPT for code conversion and somehow missed that it made this silent addition.
Topic:
Graphics & Games
SubTopic:
General
Tags: