Application prototype #14

Merged
glen merged 101 commits from app-proto into main 2024-10-21 23:38:28 +00:00
Showing only changes of commit e80adf831d - Show all commits

View File

@ -141,11 +141,11 @@ void main() {
int frag_cnt = 0;
for (int i = 0; i < sphere_cnt; ++i) {
vec2 hit_depths = sphere_cast(sphere_list[i], dir);
if (!isnan(hit_depths[0])) {
if (hit_depths[0] > 0.) {
frags[frag_cnt] = sphere_shading(sphere_list[i], hit_depths[0] * dir, color_list[i], i);
++frag_cnt;
}
if (!isnan(hit_depths[1])) {
if (hit_depths[1] > 0.) {
frags[frag_cnt] = sphere_shading(sphere_list[i], hit_depths[1] * dir, color_list[i], i);
++frag_cnt;
}