Render Gamma How to manage in C#?


Render Gamma How to manage in C#? RhinoDoc.ActiveDoc.RenderSettings; ? @nathanletwory

Hi @taraskydon,

I believe this slider controls this:

https://developer.rhino3d.com/api/rhinocommon/rhino.render.linearworkflow/postprocessgamma

– Dale

2 Likes

Indeed, doc.RenderSettings.LinearWorkflow gives you access to that info.

1 Like

Here is the working method I use. thanks for the tip.

public static void SetParameterGamma(bool on, float gamma)
    {
        var rs = RhinoDoc.ActiveDoc.RenderSettings;
    
        rs.LinearWorkflow.PostProcessGammaOn = true;
        rs.LinearWorkflow.PostProcessGamma = gamma;

        RhinoDoc.ActiveDoc.RenderSettings = rs;
    }
1 Like

Indeed that is how it is done.

For the reader in the future stumbling on this: It is required to first get the RenderSettings object, make changes, and then set it back to the RhinoDoc.RenderSettings property. Trying to setting directly say like doc.RenderSettings.LinearWorkflow.PostProcessGamnmaOn = true; does not work. It is setting the property on the document that actually will trigger the change properly.

2 Likes