voxcity.visualizer.renderer_gpu.GPURenderer =========================================== .. py:class:: voxcity.visualizer.renderer_gpu.GPURenderer(width: int = 1920, height: int = 1080, samples_per_pixel: int = 64, max_depth: int = 6, arch: str = 'gpu') High-level GPU renderer for VoxCity objects. .. py:attribute:: taichi_renderer .. py:attribute:: width :value: 1920 .. py:attribute:: height :value: 1080 .. py:method:: render_city(city: voxcity.models.VoxCity, voxel_color_map: str | dict = 'default', camera_position: Optional[Tuple[float, float, float]] = None, camera_look_at: Optional[Tuple[float, float, float]] = None, camera_up: Tuple[float, float, float] = (0, 0, 1), fov: float = 25.0, floor_enabled: bool = True, floor_color: Tuple[float, float, float] = (0.3, 0.35, 0.3), light_direction: Optional[Tuple[float, float, float]] = None, ambient: Tuple[float, float, float] = (0.15, 0.15, 0.18), output_path: Optional[str] = None, show_progress: bool = True, building_sim_mesh=None, building_value_name: str = 'svf_values', building_colormap: str = 'viridis', building_vmin: Optional[float] = None, building_vmax: Optional[float] = None, building_nan_color: str = 'gray', building_emissive: float = 0.5, render_voxel_buildings: bool = False, ground_sim_grid: Optional[numpy.ndarray] = None, ground_dem_grid: Optional[numpy.ndarray] = None, ground_z_offset: Optional[float] = None, ground_view_point_height: Optional[float] = None, ground_colormap: str = 'viridis', ground_vmin: Optional[float] = None, ground_vmax: Optional[float] = None, ground_emissive: float = 0.5) -> numpy.ndarray Render a VoxCity to an image using GPU ray tracing. :param city: The VoxCity object to render :type city: VoxCity :param voxel_color_map: Color map for voxel classes :type voxel_color_map: str or dict :param camera_position: Camera position. Auto-computed if not specified. :type camera_position: tuple, optional :param camera_look_at: Camera look-at point. Auto-computed if not specified. :type camera_look_at: tuple, optional :param camera_up: Camera up vector :type camera_up: tuple :param fov: Field of view in degrees :type fov: float :param floor_enabled: Whether to render a floor plane that receives shadows :type floor_enabled: bool :param floor_color: RGB color of the floor (0-1 range) :type floor_color: Tuple[float, float, float] :param light_direction: Light direction vector :type light_direction: tuple :param ambient: Ambient light color :type ambient: tuple :param output_path: If provided, save the rendered image to this path :type output_path: str, optional :param show_progress: Whether to show rendering progress :type show_progress: bool :param building_sim_mesh: Building mesh with simulation results in metadata :type building_sim_mesh: trimesh, optional :param building_value_name: Metadata key for building values (e.g., 'svf_values', 'global', 'direct') :type building_value_name: str :param building_colormap: Matplotlib colormap for building values :type building_colormap: str :param building_vmin: Minimum value for building color scale :type building_vmin: float, optional :param building_vmax: Maximum value for building color scale :type building_vmax: float, optional :param building_nan_color: Color for NaN/invalid building values :type building_nan_color: str :param building_emissive: Emissive/luminous intensity for building simulation mesh (0=no emission, >0=glowing) :type building_emissive: float :param render_voxel_buildings: Whether to render voxel buildings when building_sim_mesh is provided :type render_voxel_buildings: bool :param ground_sim_grid: 2D array of ground-level simulation values (e.g., GVI, solar) :type ground_sim_grid: np.ndarray, optional :param ground_dem_grid: 2D DEM array for ground surface positioning :type ground_dem_grid: np.ndarray, optional :param ground_z_offset: Height offset for ground surface above DEM :type ground_z_offset: float, optional :param ground_view_point_height: Alternative height parameter for ground surface :type ground_view_point_height: float, optional :param ground_colormap: Matplotlib colormap for ground values :type ground_colormap: str :param ground_vmin: Minimum value for ground color scale :type ground_vmin: float, optional :param ground_vmax: Maximum value for ground color scale :type ground_vmax: float, optional :param ground_emissive: Emissive/luminous intensity for ground simulation mesh (0=no emission, >0=glowing) :type ground_emissive: float :returns: Rendered image as (H, W, 3) RGB array :rtype: np.ndarray .. py:method:: render_rotation(city: voxcity.models.VoxCity, voxel_color_map: str | dict = 'default', output_directory: str = 'output', file_prefix: str = 'city_rotation', num_frames: int = 240, camera_height_factor: float = 0.5, camera_distance_factor: float = 1.5, look_at_z_factor: float = -0.1, fov: float = 25.0, floor_enabled: bool = True, floor_color: Tuple[float, float, float] = (0.3, 0.35, 0.3), show_progress: bool = True, building_sim_mesh=None, building_value_name: str = 'svf_values', building_colormap: str = 'viridis', building_vmin: Optional[float] = None, building_vmax: Optional[float] = None, building_nan_color: str = 'gray', building_emissive: float = 0.5, render_voxel_buildings: bool = False, ground_sim_grid: Optional[numpy.ndarray] = None, ground_dem_grid: Optional[numpy.ndarray] = None, ground_z_offset: Optional[float] = None, ground_view_point_height: Optional[float] = None, ground_colormap: str = 'viridis', ground_vmin: Optional[float] = None, ground_vmax: Optional[float] = None, ground_emissive: float = 0.5) -> List[str] Render a rotating view of the city. :param city: The VoxCity to render :type city: VoxCity :param voxel_color_map: Color map for voxel classes :type voxel_color_map: str or dict :param output_directory: Directory to save frames :type output_directory: str :param file_prefix: Prefix for frame filenames :type file_prefix: str :param num_frames: Number of frames in rotation :type num_frames: int :param camera_height_factor: Camera height relative to scene diagonal :type camera_height_factor: float :param camera_distance_factor: Camera distance relative to scene diagonal :type camera_distance_factor: float :param look_at_z_factor: Look-at Z offset as fraction of diagonal (negative = object appears higher) :type look_at_z_factor: float :param fov: Field of view :type fov: float :param floor_enabled: Whether to render a floor plane that receives shadows :type floor_enabled: bool :param floor_color: RGB color of the floor (0-1 range) :type floor_color: Tuple[float, float, float] :param show_progress: Whether to show progress :type show_progress: bool :param building_sim_mesh: Building mesh with simulation results in metadata :type building_sim_mesh: trimesh, optional :param building_value_name: Metadata key for building values :type building_value_name: str :param building_colormap: Matplotlib colormap for building values :type building_colormap: str :param building_vmin: Value range for building color scale :type building_vmin: float, optional :param building_vmax: Value range for building color scale :type building_vmax: float, optional :param building_nan_color: Color for NaN values :type building_nan_color: str :param render_voxel_buildings: Whether to render voxel buildings with sim mesh :type render_voxel_buildings: bool :param ground_sim_grid: 2D array of ground simulation values :type ground_sim_grid: np.ndarray, optional :param ground_dem_grid: 2D DEM array :type ground_dem_grid: np.ndarray, optional :param ground_z_offset: Height offset for ground surface :type ground_z_offset: float, optional :param ground_view_point_height: Height offset for ground surface :type ground_view_point_height: float, optional :param ground_colormap: Matplotlib colormap for ground values :type ground_colormap: str :param ground_vmin: Value range for ground color scale :type ground_vmin: float, optional :param ground_vmax: Value range for ground color scale :type ground_vmax: float, optional :returns: Paths to rendered frame files :rtype: List[str] .. py:method:: render_multi_view(city: voxcity.models.VoxCity, voxel_color_map: str | dict = 'default', output_directory: str = 'output', file_prefix: str = 'city_view', camera_height_factor: float = 0.5, camera_distance_factor: float = 1.5, look_at_z_factor: float = -0.1, fov: float = 25.0, floor_enabled: bool = True, floor_color: Tuple[float, float, float] = (0.3, 0.35, 0.3), show_progress: bool = True, views: Optional[List[str]] = None, building_sim_mesh=None, building_value_name: str = 'svf_values', building_colormap: str = 'viridis', building_vmin: Optional[float] = None, building_vmax: Optional[float] = None, building_nan_color: str = 'gray', building_emissive: float = 0.5, render_voxel_buildings: bool = False, ground_sim_grid: Optional[numpy.ndarray] = None, ground_dem_grid: Optional[numpy.ndarray] = None, ground_z_offset: Optional[float] = None, ground_view_point_height: Optional[float] = None, ground_colormap: str = 'viridis', ground_vmin: Optional[float] = None, ground_vmax: Optional[float] = None, ground_emissive: float = 0.5) -> List[Tuple[str, str]] Render multiple standard views of the city. :param city: The VoxCity to render :type city: VoxCity :param voxel_color_map: Color map for voxel classes :type voxel_color_map: str or dict :param output_directory: Directory to save images :type output_directory: str :param file_prefix: Prefix for image filenames :type file_prefix: str :param camera_height_factor: Camera height relative to scene diagonal :type camera_height_factor: float :param camera_distance_factor: Camera distance relative to scene diagonal :type camera_distance_factor: float :param look_at_z_factor: Look-at Z offset as fraction of diagonal (negative = object appears higher) :type look_at_z_factor: float :param fov: Field of view in degrees :type fov: float :param floor_enabled: Whether to render a floor plane that receives shadows :type floor_enabled: bool :param floor_color: RGB color of the floor (0-1 range) :type floor_color: Tuple[float, float, float] :param show_progress: Whether to show progress :type show_progress: bool :param views: List of view names to render. If None, renders all standard views. Available views: - Isometric: 'iso_front_right', 'iso_front_left', 'iso_back_right', 'iso_back_left' - Orthographic: 'xy_top', 'yz_right', 'xz_front', 'yz_left', 'xz_back' :type views: List[str], optional :param building_sim_mesh: :param building_value_name: :param building_colormap: :param building_vmin: :param : :param building_vmax: Building overlay parameters (same as render_rotation) :param building_nan_color: Building overlay parameters (same as render_rotation) :param render_voxel_buildings: Building overlay parameters (same as render_rotation) :param ground_sim_grid: :param ground_dem_grid: :param ground_z_offset: :param ground_view_point_height: :param : :param ground_colormap: Ground overlay parameters (same as render_rotation) :param ground_vmin: Ground overlay parameters (same as render_rotation) :param ground_vmax: Ground overlay parameters (same as render_rotation) :returns: List of (view_name, filepath) tuples :rtype: List[Tuple[str, str]]