import bpy

def setup_renderer(shape_parameters, engine="CYCLES"):
    
    # Set up and do the render
    this_scene = bpy.context.scene
    if engine=="CYCLES":
        this_scene.render.engine = 'CYCLES'
        this_scene.cycles.device = 'CPU'
        this_scene.cycles.samples = 12.0
        this_scene.cycles.caustics_reflective = False
        this_scene.cycles.caustics_refractive = False
        this_scene.cycles.max_bounces = 0.0
    this_scene.render.use_border = False
    this_scene.render.border_max_y = 0.75
    this_scene.render.border_min_y = 0.33
    this_scene.render.border_min_x = 0.25 
    this_scene.render.border_max_x = 0.65 
    this_scene.render.resolution_x = 600.0
    this_scene.render.resolution_y = 600.0
    this_scene.render.tile_x = 32
    this_scene.render.tile_y = 32
    this_scene.render.resolution_percentage = 50.0   