user: Show practical ways to work with Surface in a Blender add-on or script – include code.

assistant: Backface Culling
:   Backface Culling hides the back side of faces.
    This option should be turned on whenever it is possible, as it has an impact on performance.

    Camera
    :   Use back face culling to hide the back side of the face.

    Shadow
    :   Use back face culling when casting shadows.

    Light Probe Volume
    :   Use back face culling when baking [Light Probe Volumes](light_probes/volume.html).
        Additionally helps rejecting capture point inside the object to avoid light leaking

Displacement
:   Controls how the displacement output from the shader node tree is used.

    Bump Only:
    :   Use Bump Mapping to simulated the appearance of displacement.
        This only modifies the shading normal of the object. Vertex position is not affected.

    Displacement Only:
    :   This mode is not supported and falls back to *Displacement and Bump*.

    Displacement and Bump:
    :   Combination of true displacement and bump mapping for finer details.
        Vertex position is modified.

Max Distance
:   The maximum distance a vertex can be displaced when using true displacement.
    Displacements over this threshold may cause visibility issues.
    These visibility issues can be observed when the object is out of view at the edge of screen
    with parts being displaced inside the view. The object would then disappear because of camera culling.
    This can also produce missing shadow updates where the displaced geometry is.

Transparent shadows
:   Use transparent shadows for this material if it contains a Transparent BSDF.
    Disabling will render faster but not give accurate shadows.

Render Method
:   Controls the blending and the compatibility with certain features.

    Dithered:
    :   Allows for grayscale hashed transparency, and compatible with render passes and raytracing.
        Also know as deferred rendering.

        When using *Dithered* render method, the materials are rendered in layers.
        Each layer can only transmit (e.g. refract) light emitted from previous layers.
        If no intersection with the layers below exists, the transmissive BSDFs will fallback to light probes.

        Raytraced Transmission
        :   Use raytracing to determine transmitted color instead of using only light probes.
            This prevents the surface from contributing to the lighting of surfaces not using this setting.

    Blended:
    :   Allows the colored transparency, but incompatible with render passes and raytracing.
        Also known as forward rendering.

Transparency Overlap
:   If enabled, all transparent fragments will be rendered.
    If disabled, only the front-most surface fragments will be rendered.
    This option can be disabled to fix sorting issues caused by blending order.
    Only available for the *Blended* render method.

Thickness
:   Determines what model to use to approximate the object geometry.

    Sphere:
    :   Approximate the object as a sphere whose diameter is equal to the thickness defined by the node tree.
        This is more suited to objects with rounder edges (e.g. a monkey head), and is perfectly suited to spheres.

    Slab:
    :   Approximate the object as an infinite slab of thickness defined by the node tree.
        This is more suited to very flat or thin objects (e.g. glass panels, grass blades).

From Shadow
:   Use the shadow maps from shadow casting lights to refine the thickness defined by the material node tree.
    This takes the minimum thickness between the shadow map and the material node tree value.
    This is useful for objects where pre-computation is difficult (e.g. complex meshes), impossible
    (e.g. procedural geometry with displacement) or just impractical.
    However, this will have a performance impact that scale with the number of render samples.