apply_color Subroutine

private subroutine apply_color(g)

A region's color, through its mesh's material (the unlit shader multiplies the vertex color, white, by the diffuse color).

Arguments

Type IntentOptional Attributes Name
type(ShadowRegion), intent(in) :: g

the region (umbra, penumbra or antumbra)


Calls

proc~~apply_color~~CallsGraph proc~apply_color apply_color proc~check_status check_status proc~apply_color->proc~check_status proc~mesh_set_material mesh_set_material proc~apply_color->proc~mesh_set_material interface~vkf_mesh_material vkf_mesh_material proc~mesh_set_material->interface~vkf_mesh_material interface~vkf_mesh_material_changed vkf_mesh_material_changed proc~mesh_set_material->interface~vkf_mesh_material_changed

Called by

proc~~apply_color~~CalledByGraph proc~apply_color apply_color proc~set_region_color ShadowCones%set_region_color proc~set_region_color->proc~apply_color proc~shadow_build_contents ShadowCones%shadow_build_contents proc~shadow_build_contents->proc~apply_color

Source Code

    subroutine apply_color(g)
        type(ShadowRegion), intent(in) :: g                 !! the region (umbra, penumbra or antumbra)
        real(c_float) :: c(4)
        if (.not. c_associated(g%mesh)) return
        c = real(g%color, c_float)
        call check_status(mesh_set_material(g%mesh, c, c, [0.0_c_float, 0.0_c_float, 0.0_c_float, 1.0_c_float], &
                                     [0.0_c_float, 0.0_c_float, 0.0_c_float, 1.0_c_float], 0.0_c_float), 'shadow')
    end subroutine apply_color