## Lens Shader Presets

List of available Lens Shader presets. Lens shaders are used when a primary ray is cast by the camera. They may modify the ray's origin and direction to implement cameras other than the standard pinhole camera and they may modify the result of the primary ray to implement effects such as lens flares or a cartoon effect.
For more information, see the user guide

Note | See Shader Presets for a list of different shader preset types. Also see Alphabetical Listing of All Shader Presets for a complete list of available shaders.

Preset | Shaders
--- | ---
Lens\Camera_projection.Preset | mib Lookup Background mental ray Shader. See the Softimage.mib_lookup_background.1.0 shader definition reference page. For an example of how to use this preset, see the ConnectLensShader2 Example
Lens\Cartoon.Preset | ari_toon_lens mental ray Shader. See the Softimage.toon_len.1.0 shader definition reference page. For an example of how to use this preset, see the ConnectLensShader2 Example
Lens\Depth_of_field.Preset | Depth Of Field mental ray Shader. See the Softimage.sib_dof.1.0 shader definition reference page. For an example of how to use this preset, see the ConnectLensShader2 Example
Lens\Fast_lens_effects.Preset | Bionic_Lens mental ray Shader. See the Softimage.Bionic_Lens_len.1.0 shader definition reference page. For an example of how to use this preset, see the ConnectLensShader Example
Lens\Fisheye.Preset | sib_fisheye output parameter See the Softimage.sib_fisheye.1.0 shader definition reference page. For an example of how to use this preset, see the ConnectLensShader2 Example
Lens\Flare.Preset | oz_len_flares mental ray Shader. See the Softimage.FLARES_LEN.1.0 shader definition reference page. For an example of how to use this preset, see the ConnectLensShader Example
Lens\Lens_Effects.Preset | sib_fx_lens output parameter See the Softimage.sib_fx_lens.1.0 shader definition reference page. For an example of how to use this preset, see the ConnectLensShader2 Example
Lens\Panoramic.Preset | Cylindric mental ray Shader. See the Softimage.Cylindric_len.1.0 shader definition reference page. For an example of how to use this preset, see the ConnectLensShader2 Example
Lens\Self_antialiasing.Preset | Color Result See the Softimage.sprite_len.1.0 shader definition reference page. For an example of how to use this preset, see the ConnectLensShader2 Example
Lens\Starburst_flare.Preset | Color Result See the Softimage.Flares_Stars_len.1.0 shader definition reference page. For an example of how to use this preset, see the ConnectLensShader2 Example
Lens\Stereoscopic.Preset | nstereo mental ray Shader. See the Softimage.NSTEREO_LEN.1.0 shader definition reference page. For an example of how to use this preset, see the ConnectLensShader2 Example
Lens\Toon_Ink_Lens.Preset | sitoon_ink output parameter See the Softimage.sitoon_ink.1.0 shader definition reference page. For an example of how to use this preset, see the ConnectLensShader2 Example
Lens\True_lens_emulator.Preset | Color Result See the Softimage.real_camera_len.1.0 shader definition reference page. For an example of how to use this preset, see the ConnectLensShader2 Example
Lens\Z_depth.Preset | Lens Depth mental ray Shader. See the Softimage.sib_lens_depth.1.0 shader definition reference page. For an example of how to use this preset, see the ConnectLensShader2 Example
Lens\mental images\Lume_Distortion.Preset | Lume_Distortion output parameter See the Softimage.Lume_Distortion.1.0 shader definition reference page. For an example of how to use this preset, see the ConnectLensShader2 Example
Lens\mental images\mia_Bokeh_Lens.Preset | mia Lens Bokeh mental ray Shader. See the Softimage.mia_lens_bokeh.1.0 shader definition reference page. For an example of how to use this preset, see the ConnectLensShader2 Example
Lens\mental images\mia_Photographic_Exposure.Preset | mia Photographic Exposure mental ray Shader. See the Softimage.mia_exposure_photographic.1.0 shader definition reference page. For an example of how to use this preset, see the ConnectLensShader2 Example
Lens\mental images\mia_Simple_Tone_Mapping.Preset | mia Exposure Simple mental ray Shader. See the Softimage.mia_exposure_simple.1.0 shader definition reference page. For an example of how to use this preset, see the ConnectLensShader2 Example

### ConnectLensShader Example

    function ConnectLensShader( in_preset )
    {
            // Set up a scene with a couple lights and a camera
            NewScene( null, false );
            GetPrimLight("Neon.Preset", "Neon");
            GetPrimLight("LightFlat.Preset");
            GetPrimCamera("Telephoto", "camera");

            // Plug in the new lens shader
            SIAddArrayElement("camera1.camera.lensshader");
            var oShaderList = InsertShader(in_preset, "camera1.camera.Item");

            // InsertShader returns a collection, which we can use to build a convenient string
            var sInputObjs = "camera1.camera."+oShaderList(0).Name+".lights";

            // Now connect the two lights into the light list
            SIAddArrayElement(sInputObjs);
            SetReference2(sInputObjs+".lights", "light1", null);
            SIAddArrayElement(sInputObjs);
            SetReference2(sInputObjs+".lights[1]", "Neon", null);

            // Return the lens shader
            return oShaderList(0);
    }

### ConnectLensShader2 Example

    function ConnectLensShader2( in_preset )
    {
            NewScene( null, false );
            var obj = Application.ActiveSceneRoot.AddCamera( "Telephoto", "MyTestNode" );
            obj.AddMaterial( in_preset, true, "MyTestNode" );
            var oShader = Dictionary.GetObject("MyTestNode.camera.MyTestNode");
            return oShader;
    }