v7.0
シェーダ コンパウンドを作成します。
oReturn = CreateShaderCompound( InputObj, [Name] ); |
パラメータ | タイプ | 説明 |
---|---|---|
InputObj | 文字列 |
コンパウンド対象のシェーダ。 デフォルト値:指定されていない場合は、選択するよう求められます。 |
Name | 文字列 |
新しいシェーダ コンパウンドの名前。 デフォルト値: "" |
/* This example demonstrates how to use the CreateShaderCompound command. */ NewScene(null, false); CreatePrim("Sphere", "MeshSurface", null, null); // Create an Image Shader using its ProgID and nest it under the material CreateShaderFromProgID( "Softimage.txt2d-image-explicit.1", "Sources.Materials.DefaultLib.Scene_Material", "Image"); SIConnectShaderToCnxPoint("Sources.Materials.DefaultLib.Scene_Material.Image", "Sources.Materials.DefaultLib.Scene_Material.Phong.diffuse", false); // Create a shader compound containing the Phong Shader and automatically // exposing the Diffuse Port because there is a connection on it. CreateShaderCompound("Sources.Materials.DefaultLib.Scene_Material.Phong", "MyCompound"); // Create a Fractal Shader using its ProgID and nest it under the shader compound. CreateShaderFromProgID( "Softimage.txt3d-fractal_v3.1", "Sources.Materials.DefaultLib.Scene_Material.MyCompound", "Fractal"); SIConnectShaderToCnxPoint("Sources.Materials.DefaultLib.Scene_Material.MyCompound.Fractal", "Sources.Materials.DefaultLib.Scene_Material.MyCompound.Phong.specular", false); |
' ' This example demonstrates how to build a very simple shader compound. ' NewScene , false CreatePrim "Torus", "MeshSurface" ' Connect a Texture Grid shader to the Phong's Ambient property CreateShaderFromPreset "Shaders\Texture\Grid.Preset", _ "Sources.Materials.DefaultLib.Scene_Material" SIConnectShaderToCnxPoint "Sources.Materials.DefaultLib.Scene_Material.Grid", _ "Sources.Materials.DefaultLib.Scene_Material.Phong.ambient", False ' Connect a Gradient shader to the Texture Grid's Line Color property CreateShaderFromPreset "Shaders\Texture\Gradient.Preset", _ "Sources.Materials.DefaultLib.Scene_Material" SIConnectShaderToCnxPoint "Sources.Materials.DefaultLib.Scene_Material.Gradient", _ "Sources.Materials.DefaultLib.Scene_Material.Grid.line_color", False ' Create a shader compound out of the Gradient and Grid shaders and expose some input ports ' (the output port was automatically created since the Grid was connected to the Phong CreateShaderCompound "Sources.Materials.DefaultLib.Scene_Material.Gradient," _ + "Sources.Materials.DefaultLib.Scene_Material.Grid" AddShaderCompoundPort "Sources.Materials.DefaultLib.Scene_Material.ShaderCompound.Gradient.range_min", _ "Sources.Materials.DefaultLib.Scene_Material.ShaderCompound" AddShaderCompoundPort "Sources.Materials.DefaultLib.Scene_Material.ShaderCompound.Gradient.range_max", _ "Sources.Materials.DefaultLib.Scene_Material.ShaderCompound" |
CreateShaderFromPreset CreateShadersFromMaterialPreset CreateShaderFromCLSID CreateShaderFromProgID NestShaders UnnestShaders AddShaderCompoundPort RemoveShaderCompoundPort MoveShaderCompoundPort RenameShaderCompoundPort ExportShaderCompound ImportShaderCompound ExplodeShaderCompound SetShaderCompoundPropertiesEx GetShaderCompoundProperties EditShaderCompoundPPGLogic ShaderContainer.CreateCompound