v1.0
Adds a light list or object list to shaders.
AddObjectsToShader( [InputObjs], [Target] ); |
Parameter | Type | Description |
---|---|---|
InputObjs | String |
List of objects to add to the shader. Default Value: Current selection. If there is no current selection, the user is prompted to pick the objects. |
Target | String |
List of shader properties (lights, difflights, or objs). Default Value: Current selection |
' ' This example creates a spotlight with a realistic light emission ' by adding a spotlight to the scene, applying a volume shader to the ' default pass, and then connecting it to the spotlight. ' NewScene , false ' Get a spot light GetPrimLight "Spot", "Center_Stage", , , oSpotObj ' Apply a light shader and get an object pointer to it (the returned ' value is an XSICollection containing the shader as its only member) Set oRetValue = SIApplyShader( "Fast_light_effects.Preset", oSpotObj ) Set oLightShader = oRetValue(0) ' Add a volume shader on the default pass and save its fullname Set oDefPass = GetValue( "Passes.Default_Pass" ) sVolShader = SIApplyShaderToCnxPoint( "Fast_volume_effects.Preset", _ oDefPass & ".VolumeShaderStack", , false ) sLightCnxPnt = sVolShader & ".Lights" ' Render a single frame of the default pass just to see the spotlight ' before connecting it to the volume shader RenderPasses oDefPass, 1, 1 ' Now add the Spot to the Volume shader light list AddObjectsToShader oSpotObj, sLightCnxPnt ' Render a single frame of the default pass just to see the spotlight ' after connecting it to the volume shader RenderPasses oDefPass, 1, 1 |