CreateShaderFromCLSID

導入

v7.0

カテゴリ

レンダリング

詳細

指定された CLSID に基づいて Shader を Render Tree に追加します。

スクリプト構文

oReturn = CreateShaderFromCLSID( [Clsid], [Container], Name );

戻り値

新しい Shader オブジェクト。

パラメータ

パラメータ タイプ 詳細
Clsid 不明

デフォルト値:ArgumentHandler がこの値を解決する場合があります。

Container 選択リスト ノードの追加先シェーダ コンパウンドまたはマテリアル。

デフォルト値:指定されていない場合は、シェーダ コンテナを選択するよう求められます。

Name 文字列 新しいシェーダの名前

JScript の例

/*
        This example demonstrates how to use the CreateShaderFromCLSID command.
*/
NewScene(null, false);
CreatePrim("Sphere", "MeshSurface", null, null);
// Create an Image Shader using its CLSID found in the SPDL an nest it under the material.
// From txt2d-image-explicit.spdl CLSID={1C500B61-023C-11D3-8C03-00A0243E3672}
CreateShaderFromCLSID( "{1C500B61-023C-11D3-8C03-00A0243E3672}", "Sources.Materials.DefaultLib.Scene_Material", "Image");
SIConnectShaderToCnxPoint("Sources.Materials.DefaultLib.Scene_Material.Image", 
        "Sources.Materials.DefaultLib.Scene_Material.Phong.diffuse", false);
CreateShaderCompound("Sources.Materials.DefaultLib.Scene_Material.Phong", null);
// Create a Fractal Shader using its CLSID found in the SPDL an nest it under the shader compound.
// From txt3d-fractal_v3.spdl CLSID={A5B2C100-9288-11D4-933F-00E0293D48C6}
CreateShaderFromCLSID( "{A5B2C100-9288-11D4-933F-00E0293D48C6}", 
        "Sources.Materials.DefaultLib.Scene_Material.ShaderCompound", "Fractal");
SIConnectShaderToCnxPoint("Sources.Materials.DefaultLib.Scene_Material.ShaderCompound.Fractal", 
        "Sources.Materials.DefaultLib.Scene_Material.ShaderCompound.Phong.specular", false);

関連項目

CreateShaderFromPreset CreateShadersFromMaterialPreset CreateShaderFromProgID CreateShaderCompound NestShaders UnnestShaders AddShaderCompoundPort RemoveShaderCompoundPort MoveShaderCompoundPort RenameShaderCompoundPort ExportShaderCompound ImportShaderCompound ExplodeShaderCompound SetShaderCompoundPropertiesEx GetShaderCompoundProperties EditShaderCompoundPPGLogic