Build level-of-detail mesh k (lod_segments(k) segments around) and add it
to the level-of-detail node (compiled for the windows if compile).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(Sphere), | intent(inout) | :: | self | |||
| integer, | intent(in) | :: | k |
index into lod_segments |
||
| logical, | intent(in) | :: | compile |
true: compile it now (the sphere is shown) |
subroutine build_lod_mesh(self, k, compile) type(Sphere), intent(inout) :: self integer, intent(in) :: k !! index into lod_segments logical, intent(in) :: compile !! true: compile it now (the sphere is shown) type(c_ptr) :: mesh mesh = ellipsoid_create(self%built_radii, [1.0_c_float, 1.0_c_float, 1.0_c_float, 1.0_c_float], self%image, & lod_segments(k), lod_segments(k) / 2, self%night, translucent=self%translucent) if (.not. c_associated(mesh)) then write(*, '(a,i0,a)') 'vkframes: Sphere '//self%name()//': could not build its ', lod_segments(k), '-segment mesh' return end if self%lod_mesh(k) = mesh call apply_material_to(self, mesh) if (compile) then if (vkf_compile_node(mesh) /= 0) write(*, '(a)') 'vkframes: Sphere '//self%name()//': could not compile a mesh' end if if (vkf_sphere_lod_add(self%lod_node, mesh, int(lod_segments(k), c_int)) /= 0) & write(*, '(a)') 'vkframes: Sphere '//self%name()//': could not add a mesh' end subroutine build_lod_mesh