Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tiny fix for lightmapper DDA #86583

Merged
merged 1 commit into from
Jan 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion editor/plugins/lightmap_gi_editor_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ void LightmapGIEditorPlugin::_bake_select_file(const String &p_file) {
EditorNode::get_singleton()->show_warning(TTR("Lightmap data is not local to the scene."));
} break;
case LightmapGI::BAKE_ERROR_TEXTURE_SIZE_TOO_SMALL: {
EditorNode::get_singleton()->show_warning(TTR("Maximum texture size is too small for the lightmap images."));
EditorNode::get_singleton()->show_warning(TTR("Maximum texture size is too small for the lightmap images.\nWhile this can be fixed by increasing the maximum texture size, it is recommended you split the scene into more objects instead."));
} break;
default: {
} break;
Expand Down
11 changes: 10 additions & 1 deletion modules/lightmapper_rd/lm_compute.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,16 @@ uint trace_ray(vec3 p_from, vec3 p_to, bool p_any_hit, out float r_distance, out
break;
}

bvec3 mask = lessThanEqual(side.xyz, min(side.yzx, side.zxy));
// There should be only one axis updated at a time for DDA to work properly.
bvec3 mask = bvec3(true, false, false);
float m = side.x;
if (side.y < m) {
m = side.y;
mask = bvec3(false, true, false);
}
if (side.z < m) {
mask = bvec3(false, false, true);
}
side += vec3(mask) * delta;
icell += ivec3(vec3(mask)) * step;
iters++;
Expand Down
Loading