## Lightmap Shader Presets

List of available Lightmap Shader presets. Lightmap shaders are used to sample object surfaces and store the result in a file that can be used later. For example, you can use a lightmap shader to bake a complex material into a single texture file. Lightmaps are also used by the Fast Subsurface Scattering and Fast Skin shaders to store information about scattered light.

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
--- | ---
Lightmap\Color_Sampler.Preset | Color Sampler mental ray Shader. See the Softimage.sib_lightmap_color_sampler.1.0 shader definition reference page. For an example of how to use this preset, see the ConnectLightMapShader Example
Lightmap\mental images\misss_lightmap_write.Preset | misss Lightmap Write mental ray Shader. See the Softimage.misss_lightmap_write.1.0 shader definition reference page. For an example of how to use this preset, see the ConnectLightMapShader Example

### ConnectLightMapShader Example

    function ConnectLightMapShader( in_preset )

    {

    	NewScene( null, false );

    	CreatePrim("Grid", "MeshSurface");

    	var oShader = CreateShaderFromPreset(in_preset, "Sources.Materials.DefaultLib.Scene_Material");

    	SIConnectShaderToCnxPoint(oShader.FullName+".out",

    		"Sources.Materials.DefaultLib.Scene_Material.lightmap", false);

    	if (!oShader) { return null; }

    	return (oShader.Type == "XSICollection") ? oShader(0) : oShader;

    }