Render Presets (.NET)

Render presets allow you to define the settings that should be used when rendering 3D objects on screen or during the output of a layout. There are two types of render presets: standard and custom. The five standard render presets (Draft, Low, Medium, High, and Presentation) cannot be modified as they are defined with the application. Custom render presets are stored in the “ACAD_RENDER_SETTINGS” named dictionary as MentalRayRenderSettings objects.

A second named dictionary, “ACAD_RENDER_PLOT_SETTINGS”, is used to store a copy of a render preset so it can be assigned to a Viewport or PlotSettings object.

List the available render presets

This example lists the render presets that are stored in the current drawing.

VB.NET

Imports Autodesk.AutoCAD.Runtime
Imports Autodesk.AutoCAD.ApplicationServices
Imports Autodesk.AutoCAD.DatabaseServices
Imports Autodesk.AutoCAD.Colors
Imports Autodesk.AutoCAD.GraphicsInterface

' Lists the available render presets
<CommandMethod("ListRenderPresets")> _
Public Shared Sub ListRenderPresets()
    ' Get the current document and database, and start a transaction
    Dim acDoc As Document = Application.DocumentManager.MdiActiveDocument
    Dim acCurDb As Database = acDoc.Database

    Using acTrans As Transaction = acCurDb.TransactionManager.StartTransaction()
        Dim namedObjs As DBDictionary = _
            acTrans.GetObject(acCurDb.NamedObjectsDictionaryId, _
                              OpenMode.ForRead)

        ' Output a message to the Command Line history
        acDoc.Editor.WriteMessage(vbLf & "Default render presets: ")

        ' List the default render presets that are defined 
        ' as part of the application
        acDoc.Editor.WriteMessage(vbLf & "  Draft")
        acDoc.Editor.WriteMessage(vbLf & "  Low")
        acDoc.Editor.WriteMessage(vbLf & "  Medium")
        acDoc.Editor.WriteMessage(vbLf & "  High")
        acDoc.Editor.WriteMessage(vbLf & "  Presentation")

        ' Check to see if the "ACAD_RENDER_SETTINGS" named dictionary exists
        If namedObjs.Contains("ACAD_RENDER_SETTINGS") = True Then
            ' Open the named dictionary
            Dim renderSettings As DBDictionary = _
                acTrans.GetObject(namedObjs.GetAt("ACAD_RENDER_SETTINGS"), _
                                  OpenMode.ForRead)

            ' Output a message to the Command Line history
            acDoc.Editor.WriteMessage(vbLf & "Custom render presets: ")

            ' Step through and list each of the custom render presets
            For Each entry As DBDictionaryEntry In renderSettings
                Dim renderSetting As MentalRayRenderSettings = _
                    acTrans.GetObject(entry.Value, OpenMode.ForRead)

                ' Output the name of the custom render preset
                acDoc.Editor.WriteMessage(vbLf & "  " & renderSetting.Name)
            Next
        Else
            ' If no custom render presets exist, then output the following message
            acDoc.Editor.WriteMessage(vbLf & _
                                      "No custom render presets available.")
        End If

        ' Check to see if the "ACAD_RENDER_PLOT_SETTINGS" named dictionary exists
        If namedObjs.Contains("ACAD_RENDER_PLOT_SETTINGS") = True Then
            ' Open the named dictionary
            Dim renderSettings As DBDictionary = _
                acTrans.GetObject(namedObjs.GetAt("ACAD_RENDER_PLOT_SETTINGS"), _
                                  OpenMode.ForRead)

            ' Output a message to the Command Line history
            acDoc.Editor.WriteMessage(vbLf & "Custom render plot presets: ")

            ' Step through and list each of the custom render presets
            For Each entry As DBDictionaryEntry In renderSettings
                Dim renderSetting As MentalRayRenderSettings = _
                    acTrans.GetObject(entry.Value, OpenMode.ForRead)

                ' Output the name of the custom render preset
                acDoc.Editor.WriteMessage(vbLf & "  " & renderSetting.Name)
            Next
        Else
            ' If no custom render plot presets exist, then output the following message
            acDoc.Editor.WriteMessage(vbLf & _
                                      "No custom render plot presets available.")
        End If

        ' Discard any changes
        acTrans.Abort()
    End Using
End Sub

C#

using Autodesk.AutoCAD.Runtime;
using Autodesk.AutoCAD.ApplicationServices;
using Autodesk.AutoCAD.DatabaseServices;
using Autodesk.AutoCAD.Colors;
using Autodesk.AutoCAD.GraphicsInterface;

// Lists the available render presets
[CommandMethod("ListRenderPresets")]
public static void ListRenderPresets()
{
    // Get the current document and database, and start a transaction
    Document acDoc = Application.DocumentManager.MdiActiveDocument;
    Database acCurDb = acDoc.Database;

    using (Transaction acTrans = acCurDb.TransactionManager.StartTransaction())
    {
        DBDictionary namedObjs = acTrans.GetObject(acCurDb.NamedObjectsDictionaryId,
                                                   OpenMode.ForRead) as DBDictionary;

        // Output a message to the Command Line history
        acDoc.Editor.WriteMessage("\nDefault render presets: ");

        // List the default render presets that are defined 
        // as part of the application
        acDoc.Editor.WriteMessage("\n  Draft");
        acDoc.Editor.WriteMessage("\n  Low");
        acDoc.Editor.WriteMessage("\n  Medium");
        acDoc.Editor.WriteMessage("\n  High");
        acDoc.Editor.WriteMessage("\n  Presentation");

        // Check to see if the "ACAD_RENDER_SETTINGS" named dictionary exists
        if (namedObjs.Contains("ACAD_RENDER_SETTINGS") == true)
        {
            // Open the named dictionary
            DBDictionary renderSettings = acTrans.GetObject(namedObjs.GetAt("ACAD_RENDER_SETTINGS"),
                                                            OpenMode.ForRead) as DBDictionary;

            // Output a message to the Command Line history
            acDoc.Editor.WriteMessage("\nCustom render presets: ");

            // Step through and list each of the custom render presets
            foreach (DBDictionaryEntry entry in renderSettings)
            {
                MentalRayRenderSettings renderSetting = acTrans.GetObject(entry.Value, 
                                               OpenMode.ForRead) as MentalRayRenderSettings;

                // Output the name of the custom render preset
                acDoc.Editor.WriteMessage("\n  " + renderSetting.Name);
            }
        }
        else
        {
            // If no custom render presets exist, then output the following message
            acDoc.Editor.WriteMessage("\nNo custom render presets available.");
        }

        // Check to see if the "ACAD_RENDER_PLOT_SETTINGS" named dictionary exists
        if (namedObjs.Contains("ACAD_RENDER_PLOT_SETTINGS") == true)
        {
            // Open the named dictionary
            DBDictionary renderSettings = 
                acTrans.GetObject(namedObjs.GetAt("ACAD_RENDER_PLOT_SETTINGS"), 
                                                  OpenMode.ForRead) as DBDictionary;

            // Output a message to the Command Line history
            acDoc.Editor.WriteMessage("\nCustom render plot presets: ");

            // Step through and list each of the custom render presets
            foreach (DBDictionaryEntry entry in renderSettings)
            {
                MentalRayRenderSettings renderSetting = 
                    acTrans.GetObject(entry.Value, OpenMode.ForRead) as MentalRayRenderSettings;

                // Output the name of the custom render preset
                acDoc.Editor.WriteMessage("\n  " + renderSetting.Name);
            }
        }
        else
        {
            // If no custom render plot presets exist, then output the following message
            acDoc.Editor.WriteMessage("\nNo custom render plot presets available.");
        }

        // Discard any changes
        acTrans.Abort();
    }
}

Create or edit a render preset

This example creates or edits a render preset named MyPreset. A helper function named GetDefaultRenderPreset is defined and used to get the recreate the settings of one of the standard render presets.

VB.NET

Imports Autodesk.AutoCAD.Runtime
Imports Autodesk.AutoCAD.ApplicationServices
Imports Autodesk.AutoCAD.DatabaseServices
Imports Autodesk.AutoCAD.Colors
Imports Autodesk.AutoCAD.GraphicsInterface

' Creates a new render preset
<CommandMethod("CreateRenderPreset")> _
Public Shared Sub CreateRenderPreset()
    ' Get the current document and database, and start a transaction
    Dim acDoc As Document = Application.DocumentManager.MdiActiveDocument
    Dim acCurDb As Database = acDoc.Database

    Using acTrans As Transaction = acCurDb.TransactionManager.StartTransaction()
        Dim namedObjs As DBDictionary = _
            acTrans.GetObject(acCurDb.NamedObjectsDictionaryId, OpenMode.ForRead)

        Try
            ' Check to see if the Render Settings dictionary already exists
            Dim renderSettings As DBDictionary
            If namedObjs.Contains("ACAD_RENDER_SETTINGS") = True Then
                renderSettings = _
                    acTrans.GetObject(namedObjs.GetAt("ACAD_RENDER_SETTINGS"), _
                                      OpenMode.ForWrite)
            Else
                ' If it does not exist, create it and add it to the drawing
                namedObjs.UpgradeOpen()
                renderSettings = New DBDictionary
                namedObjs.SetAt("ACAD_RENDER_SETTINGS", renderSettings)
                acTrans.AddNewlyCreatedDBObject(renderSettings, True)
            End If

            ' Create the new render preset, based on 
            ' the settings of the Medium render preset
            If renderSettings.Contains("MyPreset") = False Then
                Using renderSetting As New MentalRayRenderSettings
                    GetDefaultRenderPreset(renderSetting, "Medium")

                    renderSetting.Name = "MyPreset"
                    renderSetting.Description = "Custom new render preset"
                    renderSettings.SetAt("MyPreset", renderSetting)
                    acTrans.AddNewlyCreatedDBObject(renderSetting, True)
                End Using
            End If

            ' Set the new render preset current
            Application.UIBindings.RenderEngine.CurrentRenderPresetName = _
                "MyPreset"

        Catch es As Autodesk.AutoCAD.Runtime.Exception
            MsgBox(es.Message)
        Finally
            acTrans.Commit()
        End Try
    End Using
End Sub

Private Shared Sub GetDefaultRenderPreset( _
                   ByRef renderPreset As MentalRayRenderSettings, _
                   ByVal name As String)
    ' Set the values common to multiple default render presets
    renderPreset.BackFacesEnabled = False
    renderPreset.DiagnosticBackgroundEnabled = False
    renderPreset.DiagnosticBSPMode = _
        DiagnosticBSPMode.Depth
    renderPreset.DiagnosticGridMode = _
        New MentalRayRenderSettingsTraitsDiagnosticGridModeParameter( _
            DiagnosticGridMode.Object, 10.0)

    renderPreset.DiagnosticMode = _
        DiagnosticMode.Off
    renderPreset.DiagnosticPhotonMode = _
        DiagnosticPhotonMode.Density
    renderPreset.DisplayIndex = 0
    renderPreset.EnergyMultiplier = 1.0
    renderPreset.ExportMIEnabled = False
    renderPreset.ExportMIFileName = ""
    renderPreset.FGRayCount = 100

    ' FGSampleRadius cannot be set, it returns invalid input
    renderPreset.FGSampleRadiusState = _
        New MentalRayRenderSettingsTraitsBoolParameter( _
            False, False, False)

    renderPreset.FinalGatheringEnabled = False
    renderPreset.FinalGatheringMode = _
        FinalGatheringMode.FinalGatherOff
    renderPreset.GIPhotonsPerLight = 1000
    renderPreset.GISampleCount = 500
    renderPreset.GISampleRadius = 1.0
    renderPreset.GISampleRadiusEnabled = False
    renderPreset.GlobalIlluminationEnabled = False
    renderPreset.LightLuminanceScale = 1500.0
    renderPreset.MaterialsEnabled = True
    renderPreset.MemoryLimit = 1048

    renderPreset.PhotonTraceDepth = _
        New MentalRayRenderSettingsTraitsTraceParameter( _
            5, 5, 5)
    renderPreset.PreviewImageFileName = ""
    renderPreset.RayTraceDepth = _
        New MentalRayRenderSettingsTraitsTraceParameter( _
            3, 3, 3)
    renderPreset.RayTracingEnabled = False
    renderPreset.Sampling = _
        New MentalRayRenderSettingsTraitsIntegerRangeParameter( _
            -2, -1)
    renderPreset.SamplingContrastColor = _
        New MentalRayRenderSettingsTraitsFloatParameter( _
            0.1, 0.1, 0.1, 0.1)
    renderPreset.SamplingFilter = _
        New MentalRayRenderSettingsTraitsSamplingParameter( _
            Filter.Box, 1.0, 1.0)

    renderPreset.ShadowMapsEnabled = False
    renderPreset.ShadowMode = ShadowMode.Simple
    renderPreset.ShadowSamplingMultiplier = _
        ShadowSamplingMultiplier.SamplingMultiplierZero
    renderPreset.ShadowsEnabled = True
    renderPreset.TextureSampling = False
    renderPreset.TileOrder = TileOrder.Hilbert
    renderPreset.TileSize = 32

    Select Case name.ToUpper()
        ' Assigns the values to match the Draft render preset
        Case "DRAFT"
            renderPreset.Description = _
                "The lowest rendering quality which entails no raytracing, " & _
                "no texture filtering and force 2-sided is inactive."
            renderPreset.Name = "Draft"
        Case ("LOW")
            renderPreset.Description = _
                "Rendering quality is improved over Draft. " & _
                "Low anti-aliasing and a raytracing depth of 3 " & _
                "reflection/refraction are processed."
            renderPreset.Name = "Low"

            renderPreset.RayTracingEnabled = True

            renderPreset.Sampling = _
                New MentalRayRenderSettingsTraitsIntegerRangeParameter( _
                    -1, 0)
            renderPreset.SamplingContrastColor = _
                New MentalRayRenderSettingsTraitsFloatParameter( _
                    0.1, 0.1, 0.1, 0.1)
            renderPreset.SamplingFilter = _
                New MentalRayRenderSettingsTraitsSamplingParameter( _
                    Filter.Triangle, 2.0, 2.0)

            renderPreset.ShadowSamplingMultiplier = _
                ShadowSamplingMultiplier.SamplingMultiplierOneFourth
        Case "MEDIUM"
            renderPreset.BackFacesEnabled = True
            renderPreset.Description = _
                "Rendering quality is improved over Low to include " & _
                "texture filtering and force 2-sided is active. " & _
                "Moderate anti-aliasing and a raytracing depth of " & _
                "5 reflections/refractions are processed."

            renderPreset.FGRayCount = 200
            renderPreset.FinalGatheringMode = _
                FinalGatheringMode.FinalGatherAuto
            renderPreset.GIPhotonsPerLight = 10000

            renderPreset.Name = "Medium"
            renderPreset.RayTraceDepth = _
                New MentalRayRenderSettingsTraitsTraceParameter( _
                    5, 5, 5)
            renderPreset.RayTracingEnabled = True
            renderPreset.Sampling = _
                New MentalRayRenderSettingsTraitsIntegerRangeParameter( _
                    0, 1)
            renderPreset.SamplingContrastColor = _
                New MentalRayRenderSettingsTraitsFloatParameter( _
                    0.05, 0.05, 0.05, 0.05)
            renderPreset.SamplingFilter = _
                New MentalRayRenderSettingsTraitsSamplingParameter( _
                    Filter.Gauss, 3.0, 3.0)

            renderPreset.ShadowSamplingMultiplier = _
                ShadowSamplingMultiplier.SamplingMultiplierOneHalf
            renderPreset.TextureSampling = True
        Case "HIGH"
            renderPreset.BackFacesEnabled = True
            renderPreset.Description = _
                "Rendering quality is improved over Medium. " & _
                "High anti-aliasing and a raytracing depth of 7 " & _
                "reflections/refractions are processed."

            renderPreset.FGRayCount = 500
            renderPreset.FinalGatheringMode = _
                FinalGatheringMode.FinalGatherAuto
            renderPreset.GIPhotonsPerLight = 10000

            renderPreset.Name = "High"
            renderPreset.RayTraceDepth = _
                New MentalRayRenderSettingsTraitsTraceParameter( _
                    7, 7, 7)
            renderPreset.RayTracingEnabled = True
            renderPreset.Sampling = _
                New MentalRayRenderSettingsTraitsIntegerRangeParameter( _
                    0, 2)
            renderPreset.SamplingContrastColor = _
                New MentalRayRenderSettingsTraitsFloatParameter( _
                    0.05, 0.05, 0.05, 0.05)
            renderPreset.SamplingFilter = _
                New MentalRayRenderSettingsTraitsSamplingParameter( _
                    Filter.Mitchell, 4.0, 4.0)

            renderPreset.ShadowSamplingMultiplier = _
                ShadowSamplingMultiplier.SamplingMultiplierOne
            renderPreset.TextureSampling = True
        Case "PRESENTATION"
            renderPreset.BackFacesEnabled = True
            renderPreset.Description = _
                "Rendering quality is improved over High. " & _
                "Very high anti-aliasing and a raytracing depth of 9 " & _
                "reflections/refractions are processed."

            renderPreset.FGRayCount = 1000
            renderPreset.FinalGatheringMode = _
                FinalGatheringMode.FinalGatherAuto
            renderPreset.GIPhotonsPerLight = 10000

            renderPreset.Name = "Presentation"
            renderPreset.RayTraceDepth = _
                New MentalRayRenderSettingsTraitsTraceParameter( _
                    9, 9, 9)
            renderPreset.RayTracingEnabled = True
            renderPreset.Sampling = _
                New MentalRayRenderSettingsTraitsIntegerRangeParameter( _
                    1, 2)
            renderPreset.SamplingContrastColor = _
                New MentalRayRenderSettingsTraitsFloatParameter( _
                    0.05, 0.05, 0.05, 0.05)
            renderPreset.SamplingFilter = _
                New MentalRayRenderSettingsTraitsSamplingParameter( _
                    Filter.Lanczos, 4.0, 4.0)

            renderPreset.ShadowSamplingMultiplier = _
                ShadowSamplingMultiplier.SamplingMultiplierOne
            renderPreset.TextureSampling = True
    End Select
End Sub

C#

using Autodesk.AutoCAD.Runtime;
using Autodesk.AutoCAD.ApplicationServices;
using Autodesk.AutoCAD.DatabaseServices;
using Autodesk.AutoCAD.Colors;
using Autodesk.AutoCAD.GraphicsInterface;

// Creates a new render preset
[CommandMethod("CreateRenderPreset")]
public static void CreateRenderPreset()
{
    // Get the current document and database, and start a transaction
    Document acDoc = Application.DocumentManager.MdiActiveDocument;
    Database acCurDb = acDoc.Database;

    using (Transaction acTrans = acCurDb.TransactionManager.StartTransaction())
    {
        DBDictionary namedObjs = acTrans.GetObject(acCurDb.NamedObjectsDictionaryId,
                                                   OpenMode.ForRead) as DBDictionary;

        try
        {
            // Check to see if the Render Settings dictionary already exists
            DBDictionary renderSettings = default(DBDictionary);
            if (namedObjs.Contains("ACAD_RENDER_SETTINGS") == true)
            {
                renderSettings = acTrans.GetObject(namedObjs.GetAt("ACAD_RENDER_SETTINGS"), 
                                                   OpenMode.ForWrite) as DBDictionary;
            }
            else
            {
                // If it does not exist, create it and add it to the drawing
                namedObjs.UpgradeOpen();
                renderSettings = new DBDictionary();
                namedObjs.SetAt("ACAD_RENDER_SETTINGS", renderSettings);
                acTrans.AddNewlyCreatedDBObject(renderSettings, true);
            }

            // Create the new render preset, based on 
            // the settings of the Medium render preset
            if (renderSettings.Contains("MyPreset") == false)
            {
                MentalRayRenderSettings renderSetting = new MentalRayRenderSettings();
                GetDefaultRenderPreset(ref renderSetting, "Medium");

                renderSetting.Name = "MyPreset";
                renderSetting.Description = "Custom new render preset";
                renderSettings.SetAt("MyPreset", renderSetting);
                acTrans.AddNewlyCreatedDBObject(renderSetting, true);

                renderSetting.Dispose();
            }

            // Set the new render preset current
            Application.UIBindings.RenderEngine.CurrentRenderPresetName = "MyPreset";
        }
        catch (Autodesk.AutoCAD.Runtime.Exception es)
        {
            System.Windows.Forms.MessageBox.Show(es.Message);
        }
        finally
        {
            acTrans.Commit();
        }
    }
}

// Method used to populate a MentalRayRenderSettings object with the
// same settings used by the standard render presets
private static void GetDefaultRenderPreset(
                    ref MentalRayRenderSettings renderPreset,
                    string name)
{
    // Set the values common to multiple default render presets
    renderPreset.BackFacesEnabled = false;
    renderPreset.DiagnosticBackgroundEnabled = false;
    renderPreset.DiagnosticBSPMode =
        DiagnosticBSPMode.Depth;
    renderPreset.DiagnosticGridMode =
        new MentalRayRenderSettingsTraitsDiagnosticGridModeParameter(
            DiagnosticGridMode.Object, (float)10.0);

    renderPreset.DiagnosticMode =
        DiagnosticMode.Off;
    renderPreset.DiagnosticPhotonMode =
        DiagnosticPhotonMode.Density;
    renderPreset.DisplayIndex = 0;
    renderPreset.EnergyMultiplier = (float)1.0;
    renderPreset.ExportMIEnabled = false;
    renderPreset.ExportMIFileName = "";
    renderPreset.FGRayCount = 100;

    // FGSampleRadius cannot be set, it returns invalid input
    renderPreset.FGSampleRadiusState =
        new MentalRayRenderSettingsTraitsBoolParameter(
            false, false, false);

    renderPreset.FinalGatheringEnabled = false;
    renderPreset.FinalGatheringMode =
        FinalGatheringMode.FinalGatherOff;
    renderPreset.GIPhotonsPerLight = 1000;
    renderPreset.GISampleCount = 500;
    renderPreset.GISampleRadius = 1.0;
    renderPreset.GISampleRadiusEnabled = false;
    renderPreset.GlobalIlluminationEnabled = false;
    renderPreset.LightLuminanceScale = 1500.0;
    renderPreset.MaterialsEnabled = true;
    renderPreset.MemoryLimit = 1048;

    renderPreset.PhotonTraceDepth =
        new MentalRayRenderSettingsTraitsTraceParameter(
            5, 5, 5);
    renderPreset.PreviewImageFileName = "";
    renderPreset.RayTraceDepth =
        new MentalRayRenderSettingsTraitsTraceParameter(
            3, 3, 3);
    renderPreset.RayTracingEnabled = false;
    renderPreset.Sampling =
        new MentalRayRenderSettingsTraitsIntegerRangeParameter(
            -2, -1);
    renderPreset.SamplingContrastColor =
        new MentalRayRenderSettingsTraitsFloatParameter(
            (float)0.1, (float)0.1, (float)0.1, (float)0.1);
    renderPreset.SamplingFilter =
        new MentalRayRenderSettingsTraitsSamplingParameter(
            Filter.Box, 1.0, 1.0);

    renderPreset.ShadowMapsEnabled = false;
    renderPreset.ShadowMode = ShadowMode.Simple;
    renderPreset.ShadowSamplingMultiplier =
        ShadowSamplingMultiplier.SamplingMultiplierZero;
    renderPreset.ShadowsEnabled = true;
    renderPreset.TextureSampling = false;
    renderPreset.TileOrder = TileOrder.Hilbert;
    renderPreset.TileSize = 32;

    switch (name.ToUpper())
    {
        // Assigns the values to match the Draft render preset
        case "DRAFT":
            renderPreset.Description =
                "The lowest rendering quality which entails no raytracing, " +
                "no texture filtering and force 2-sided is inactive.";
            renderPreset.Name = "Draft";
            break;
        case "LOW":
            renderPreset.Description =
                "Rendering quality is improved over Draft. " +
                "Low anti-aliasing and a raytracing depth of 3 " +
                "reflection/refraction are processed.";
            renderPreset.Name = "Low";

            renderPreset.RayTracingEnabled = true;

            renderPreset.Sampling =
                new MentalRayRenderSettingsTraitsIntegerRangeParameter(
                    -1, 0);
            renderPreset.SamplingContrastColor =
                new MentalRayRenderSettingsTraitsFloatParameter(
                    (float)0.1, (float)0.1, (float)0.1, (float)0.1);
            renderPreset.SamplingFilter =
                new MentalRayRenderSettingsTraitsSamplingParameter(
                    Filter.Triangle, 2.0, 2.0);

            renderPreset.ShadowSamplingMultiplier =
                ShadowSamplingMultiplier.SamplingMultiplierOneFourth;
            break;
        case "MEDIUM":
            renderPreset.BackFacesEnabled = true;
            renderPreset.Description =
                "Rendering quality is improved over Low to include " +
                "texture filtering and force 2-sided is active. " +
                "Moderate anti-aliasing and a raytracing depth of " +
                "5 reflections/refractions are processed.";

            renderPreset.FGRayCount = 200;
            renderPreset.FinalGatheringMode =
                FinalGatheringMode.FinalGatherAuto;
            renderPreset.GIPhotonsPerLight = 10000;

            renderPreset.Name = "Medium";
            renderPreset.RayTraceDepth =
                new MentalRayRenderSettingsTraitsTraceParameter(
                    5, 5, 5);
            renderPreset.RayTracingEnabled = true;
            renderPreset.Sampling =
                new MentalRayRenderSettingsTraitsIntegerRangeParameter(
                    0, 1);
            renderPreset.SamplingContrastColor =
                new MentalRayRenderSettingsTraitsFloatParameter(
                    (float)0.05, (float)0.05, (float)0.05, (float)0.05);
            renderPreset.SamplingFilter =
                new MentalRayRenderSettingsTraitsSamplingParameter(
                    Filter.Gauss, 3.0, 3.0);

            renderPreset.ShadowSamplingMultiplier =
                ShadowSamplingMultiplier.SamplingMultiplierOneHalf;
            renderPreset.TextureSampling = true;
            break;
        case "HIGH":
            renderPreset.BackFacesEnabled = true;
            renderPreset.Description =
                "Rendering quality is improved over Medium. " +
                "High anti-aliasing and a raytracing depth of 7 " +
                "reflections/refractions are processed.";

            renderPreset.FGRayCount = 500;
            renderPreset.FinalGatheringMode =
                FinalGatheringMode.FinalGatherAuto;
            renderPreset.GIPhotonsPerLight = 10000;

            renderPreset.Name = "High";
            renderPreset.RayTraceDepth =
                new MentalRayRenderSettingsTraitsTraceParameter(
                    7, 7, 7);
            renderPreset.RayTracingEnabled = true;
            renderPreset.Sampling =
                new MentalRayRenderSettingsTraitsIntegerRangeParameter(
                    0, 2);
            renderPreset.SamplingContrastColor =
                new MentalRayRenderSettingsTraitsFloatParameter(
                    (float)0.05, (float)0.05, (float)0.05, (float)0.05);
            renderPreset.SamplingFilter =
                new MentalRayRenderSettingsTraitsSamplingParameter(
                    Filter.Mitchell, 4.0, 4.0);

            renderPreset.ShadowSamplingMultiplier =
                ShadowSamplingMultiplier.SamplingMultiplierOne;
            renderPreset.TextureSampling = true;
            break;
        case "PRESENTATION":
            renderPreset.BackFacesEnabled = true;
            renderPreset.Description =
                "Rendering quality is improved over High. " +
                "Very high anti-aliasing and a raytracing depth of 9 " +
                "reflections/refractions are processed.";

            renderPreset.FGRayCount = 1000;
            renderPreset.FinalGatheringMode =
                FinalGatheringMode.FinalGatherAuto;
            renderPreset.GIPhotonsPerLight = 10000;

            renderPreset.Name = "Presentation";
            renderPreset.RayTraceDepth =
                new MentalRayRenderSettingsTraitsTraceParameter(
                    9, 9, 9);
            renderPreset.RayTracingEnabled = true;
            renderPreset.Sampling =
                new MentalRayRenderSettingsTraitsIntegerRangeParameter(
                    1, 2);
            renderPreset.SamplingContrastColor =
                new MentalRayRenderSettingsTraitsFloatParameter(
                    (float)0.05, (float)0.05, (float)0.05, (float)0.05);
            renderPreset.SamplingFilter =
                new MentalRayRenderSettingsTraitsSamplingParameter(
                    Filter.Lanczos, 4.0, 4.0);

            renderPreset.ShadowSamplingMultiplier =
                ShadowSamplingMultiplier.SamplingMultiplierOne;
            renderPreset.TextureSampling = true;
            break;
    }
}