v4.0
shader
要求されたプリセットとともにレイヤを作成して戻します。また、指定のポートをレイヤに追加します。
注: このコマンドは BlendInTextureLayersWithPorts
と同等ですが、新しく作成されたシェーダも調べる点が異なります。
oReturn = BlendInTextureLayersWithPortsInsp( [PresetNames], [InputObjs] ); |
作成されたレイヤを XSICollection として戻します。
| パラメータ | タイプ | 詳細 |
|---|---|---|
| PresetNames | 文字列 | 接続するシェーダ/イメージに対応するシェーダ
プリセット
デフォルト値: 「Image」 |
| InputObjs | 文字列 | 新しいレイヤをブレンドするシェーダ接続のリスト。
デフォルト値: 現在選択されている値 |
'
' This example demonstrates how to apply blended shaders to a specific connection
' point on a cube. It also shows how to access the shader information both from the
' collection returned by BlendInTextureLayersWithPortsInsp and through the object's material.
'
NewScene , false
' Create a default cube and apply a default Phong shader:
Set oBox = ActiveSceneRoot.AddGeometry( "Cube", "MeshSurface" )
ApplyShader , oBox
' Apply Cloud and Gradient presets on the cube's Material Surface port:
Set oLayers = BlendInTextureLayersWithPortsInsp( "Cloud,Gradient", _
oBox.Material.Parameters( "Surface" ) )
' At this point you will also see a Multiple Property Sets page pop up for the shaders.
' Now display the name of the created layers:
For Each oLayer In oLayers
Set oShader = SIGetShaderOnCnxPoint( oLayer & ".color" )
Application.LogMessage oLayer.Name & " created with shader " & oShader.Name
Next
' View the results in a rendered frame. (The colors appear quite smooth.)
RenderPasses oDefPass, 1, 1
' Set the mode of the Gradient to "Darken":
SetValue oBox.Material & ".Gradient_Layer.mode", 8
' View the results in a rendered frame. (Now the colors seem to have a mottled effect.)
RenderPasses oDefPass, 1, 1
' Output of above script:
'INFO : "Cloud_Layer created with shader Cloud"
'INFO : "Gradient_Layer created with shader Gradient"
|