예제 #1
0
        private void addPixelShaderButton_Click(object sender, EventArgs e)
        {
            EffectComponent component = new EffectComponent();

            component.Name     = "NewPixelShader";
            component.IsInline = false;

            HlslSemantic outputSemantic = Semantics.Find("COLOR", true, false);

            outputSemantic.ResourceNumber = 0;
            component.ReturnType.Add(new EffectParameterDefinition(
                                         "Color",
                                         outputSemantic.Type,
                                         outputSemantic));

            mEffectDefinition.PixelShaders.Add(component);

            effectEdit_pixelShaderListChanged(sender, e);

            pixelShadersList.SelectedItem = component;

            if (mEffectDefinition.PixelShaders.Count > 0)
            {
                pixelShaderEditor.Enabled = true;
            }
        }
예제 #2
0
        private void addVertexShaderButton_Click(object sender, EventArgs e)
        {
            EffectComponent component = new EffectComponent();

            component.Name     = "NewVertexShader";
            component.IsInline = false;

            HlslSemantic inputSemantic = Semantics.Find("POSITION", true, true);

            inputSemantic.ResourceNumber = 0;
            component.Parameters.Add(new EffectParameterDefinition(
                                         "Position",
                                         inputSemantic.Type,
                                         inputSemantic));
            HlslSemantic outputSemantic = Semantics.Find("POSITION", true, false);

            outputSemantic.ResourceNumber = 0;
            component.ReturnType.Add(new EffectParameterDefinition(
                                         "Position",
                                         outputSemantic.Type,
                                         outputSemantic));

            mEffectDefinition.VertexShaders.Add(component);

            effectEdit_vertexShaderListChanged(sender, e);

            vertexShadersList.SelectedItem = component;

            if (mEffectDefinition.VertexShaders.Count > 0)
            {
                vertexShaderEditor.Enabled = true;
            }
        }
예제 #3
0
 public EffectParameterDefinition(String name, HlslTypeDefinition type, HlslSemantic semantic)
 {
     Name            = name;
     Type            = type;
     HasStorageClass = false;
     HasSemantic     = true;
     StorageClass    = StorageClass.None;
     Semantic        = semantic;
 }
예제 #4
0
 public EffectParameterDefinition(String name, HlslTypeDefinition type, StorageClass storageClass)
 {
     Name            = name;
     Type            = type;
     HasStorageClass = true;
     HasSemantic     = false;
     StorageClass    = storageClass;
     Semantic        = new HlslSemantic();
 }