def config_rendering(
    resolution=(480, 640),
    renderer="cycles",
    render_samples=64,
    render_exr=False,
    thread_limit=8,
):
    """Adjust rendering settings.

    Args:
      resolution: Integer tuple for image resolution
      renderer: Either 'cycles' or 'eevee'
      render_samples: Integer that determines sample quality, rendering time
      use_gpu: Whether to use the GPU for rendering
      render_exr: Set true to output segmentation and depth ground truth
    """

    if renderer == "eevee":
        C.scene.render.engine = "BLENDER_EEVEE"
        C.scene.eevee.taa_render_samples = render_samples

    elif renderer == "cycles":
        C.scene.render.engine = "CYCLES"
        # C.scene.cycles.device = 'GPU'
        C.scene.cycles.samples = render_samples
        C.scene.cycles.use_denoising = True
        # C.scene.cycles.denoiser = 'OPTIX'

    C.scene.render.resolution_x = resolution[1]
    C.scene.render.resolution_y = resolution[0]
    # C.scene.render.threads_mode = 'FIXED'
    # C.scene.render.threads = thread_limit

    if render_exr:
        C.scene.render.image_settings.file_format = "OPEN_EXR_MULTILAYER"
        C.scene.render.image_settings.color_mode = "RGBA"
        C.scene.render.image_settings.color_depth = "32"
        C.window.view_layer.use_pass_object_index = True
        C.window.view_layer.use_pass_material_index = True
        C.window.view_layer.use_pass_z = True

    else:
        C.scene.render.image_settings.color_mode = "RGB"
Adjust rendering settings.

    Args:
      resolution: Integer tuple for image resolution
      renderer: Either 'cycles' or 'eevee'
      render_samples: Integer that determines sample quality, rendering time
      use_gpu: Whether to use the GPU for rendering
      render_exr: Set true to output segmentation and depth ground truth
    
infinigen/assets/objects/trees/utils/helper.py