Raytraced bake fixes

This commit is contained in:
luboslenco
2025-08-28 19:39:03 +02:00
parent a6a2087c36
commit 38317e21c9
3 changed files with 9 additions and 11 deletions
+1 -1
View File
@@ -757,7 +757,7 @@ void gpu_raytrace_acceleration_structure_add(gpu_raytrace_acceleration_structure
vb_count++;
}
inst_t inst = { .i = vb_i, .m = _transform };
inst_t inst = { .i = vb_i, .m = _transform };
instances[instances_count] = inst;
instances_count++;
}
+7 -9
View File
@@ -140,7 +140,7 @@ function render_path_raytrace_commands(use_live_layer: bool) {
}
}
function render_path_raytrace_raytrace_init(shader_name: string, build: bool = true, bake: bool = false) {
function render_path_raytrace_raytrace_init(shader_name: string, build: bool = true) {
if (render_path_raytrace_first) {
render_path_raytrace_first = false;
scene_embed_data("bnoise_sobol.k");
@@ -152,7 +152,7 @@ function render_path_raytrace_raytrace_init(shader_name: string, build: bool = t
}
if (build) {
render_path_raytrace_build_data(bake);
render_path_raytrace_build_data();
}
{
@@ -178,7 +178,7 @@ function render_path_raytrace_raytrace_init(shader_name: string, build: bool = t
}
}
function render_path_raytrace_build_data(bake: bool = false) {
function render_path_raytrace_build_data() {
if (context_raw.merged_object == null) {
util_mesh_merge();
}
@@ -196,13 +196,11 @@ function render_path_raytrace_build_data(bake: bool = false) {
render_path_raytrace_transform = mat4_identity();
}
if (!bake) {
let sc: f32 = mo.base.transform.scale.x * mo.data.scale_pos;
if (mo.base.parent != null) {
sc *= mo.base.parent.transform.scale.x;
}
render_path_raytrace_transform = mat4_scale(render_path_raytrace_transform, vec4_create(sc, sc, sc));
let sc: f32 = mo.base.transform.scale.x * mo.data.scale_pos;
if (mo.base.parent != null) {
sc *= mo.base.parent.transform.scale.x;
}
render_path_raytrace_transform = mat4_scale(render_path_raytrace_transform, vec4_create(sc, sc, sc));
render_path_raytrace_vb = mo.data._.vertex_buffer;
render_path_raytrace_ib = mo.data._.index_buffer;
+1 -1
View File
@@ -63,7 +63,7 @@ function render_path_raytrace_bake_commands(parse_paint_material: (b?: bool)=>vo
sys_notify_on_next_frame(parse_paint_material);
render_path_raytrace_first = true;
render_path_raytrace_raytrace_init(render_path_raytrace_bake_get_bake_shader_name(), rebuild, true);
render_path_raytrace_raytrace_init(render_path_raytrace_bake_get_bake_shader_name(), rebuild);
return false;
}