|
@@ -342,8 +342,8 @@ void VoxelLightBaker::_plot_face(int p_idx, int p_level, int p_x, int p_y, int p
|
|
if (lnormal == Vector3()) //just in case normal as nor provided
|
|
if (lnormal == Vector3()) //just in case normal as nor provided
|
|
lnormal = normal;
|
|
lnormal = normal;
|
|
|
|
|
|
- int uv_x = CLAMP(Math::fposmod(uv.x, 1.0f) * bake_texture_size, 0, bake_texture_size - 1);
|
|
|
|
- int uv_y = CLAMP(Math::fposmod(uv.y, 1.0f) * bake_texture_size, 0, bake_texture_size - 1);
|
|
|
|
|
|
+ int uv_x = CLAMP(int(Math::fposmod(uv.x, 1.0f) * bake_texture_size), 0, bake_texture_size - 1);
|
|
|
|
+ int uv_y = CLAMP(int(Math::fposmod(uv.y, 1.0f) * bake_texture_size), 0, bake_texture_size - 1);
|
|
|
|
|
|
int ofs = uv_y * bake_texture_size + uv_x;
|
|
int ofs = uv_y * bake_texture_size + uv_x;
|
|
albedo_accum.r += p_material.albedo[ofs].r;
|
|
albedo_accum.r += p_material.albedo[ofs].r;
|