v4.0
shader
指定したオブジェクトにアタッチされたイミディエイト シェーダですべてのデフォルト テクスチャ接続ポイントの位置を指定します。
要求されたプリセットおよびイメージを作成し、作成したすべてのプリセットと指定した接続ポイントに既存のシェーダをブレンドします。
このコマンドは BlendInTextureLayers
コマンドと同等ですが、新しく作成されたシェーダも調べる点が異なります。
oReturn = BlendInTextureLayersInsp( [PresetNames], [InputObjs], [SharedMatAction], [NotifyNoResult], [Mode], [Ambient], [Diffuse], [Transparency], [Reflection] ); |
作成されたレイヤを XSICollection として戻します。 Mode の値が siReplaceNoBlend である場合は、最初のプリセットが、レイヤではなくシェーダとして戻されます。
| パラメータ | タイプ | 詳細 | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| PresetNames | 文字列 | レイヤを作成するシェーダ/イメージに対応するシェーダ プリセット
デフォルト値: 「Image」 |
||||||||||
| InputObjs | 文字列 | デフォルトのテクスチャ接続ポイントを検索するオブジェクトのリスト
デフォルト値: 現在選択されている値 |
||||||||||
| SharedMatAction | Integer | 共有マテリアルをローカルに設定するかどうかを設定します。 注:
「2」または「3」に設定すると、ユーザに選択を求めるポップアップ ダイアログが表示されます(0=No または 1=Yes)。
「2」に設定されている場合に記録されているコマンドが再度実行されると、ユーザの応答に応じてコマンドは「可」または「不可」の応答を自動的に返します。
「3」に設定されている場合には、再度ポップアップ ダイアログが表示されます。
デフォルト値:2 (初級ユーザに確認)
|
||||||||||
| NotifyNoResult | ブール | プリセットが作成されない場合に、ユーザに通知するには True。
デフォルト値:False (通知しない) |
||||||||||
| Mode | siBlendInTextureLayersModes | 新しいプリセットでのブレンディング方法
デフォルト値:siBlendInTextureLayers (置き換えない) |
||||||||||
| Ambient | ブール | True の場合、アンビエント ポート(存在する場合)にブレンドします。
デフォルト値:True (アンビエントを適用) |
||||||||||
| Diffuse | ブール | True の場合、ディフューズ ポート(存在する場合)にブレンドします。
デフォルト値:True (ディフューズを適用) |
||||||||||
| Transparency | ブール | True の場合、トランスペアレンシ ポート(存在する場合)にブレンドします。
デフォルト値:False (トランスペアレンシを適用しない) |
||||||||||
| Reflection | ブール | True の場合、リフレクション ポート(存在する場合)にブレンドします。
デフォルト値:False (リフレクションを適用しない) |
'
' This example demonstrates how to apply blended shaders to all texture ports on a
' cube. It also shows how to access the shader information both from the collection
' returned by BlendInTextureLayersInsp and through the object's material.
'
NewScene , false
' Create a default cube
Set oBox = ActiveSceneRoot.AddGeometry( "Cube", "MeshSurface" )
' Apply Cloud and Gradient presets on all texture ports
Set oLayers = BlendInTextureLayersInsp( "Cloud,Gradient", oBox, 1, False, False )
' At this point you will also see a Multiple Property Sets page pop up for the shaders.
' Now display the name of the created shaders:
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.Shaders( "Phong" ) & ".Gradient_Layer.mode", 8
' View the results in a rendered frame. (Now the colors seem to be quite mottled.)
RenderPasses oDefPass, 1, 1
' Output of above script:
'INFO : "Cloud_Layer created with shader Cloud"
'INFO : "Gradient_Layer created with shader Gradient"
|