コード例 #1
0
        public override bool Calculate()
        {
            tag = true;

            SuperFloat2 s_in2 = Inputs[0].GetValue <SuperFloat2>();
            SuperSource s_in  = Inputs[1].GetValue <SuperSource>();
            SuperFloat4 s_out = new SuperFloat4();


            string NodeCount   = MemoCount.ToString();
            string DefaultName = "SourceRGBA_" + NodeCount;
            string source      = "";
            string uv          = "";

            // uv
            if (s_in.Result == null)
            {
                source = "_MainTex";
            }
            else
            {
                source = s_in.Result;
            }

            // source
            if (s_in2.Result == null)
            {
                uv = "i.texcoord";
                if (source == "_MainTex")
                {
                    uv = "i.texcoord";
                }
                if (source == "_GrabTexture")
                {
                    uv = "i.screenuv";
                }
            }
            else
            {
                uv = s_in2.Result;
            }

            s_out.StringPreviewLines          = s_in.StringPreviewNew + s_in2.StringPreviewNew;
            s_out.ValueLine                   = "float4 " + DefaultName + " = tex2D(" + source + ", " + uv + ");\n";
            s_out.StringPreviewNew            = s_out.StringPreviewLines + s_out.ValueLine;
            s_out.Result                      = DefaultName;
            s_out.ParametersLines            += s_in.ParametersLines + s_in2.ParametersLines;
            s_out.ParametersDeclarationLines += s_in.ParametersDeclarationLines + s_in2.ParametersDeclarationLines;

            Outputs[0].SetValue <SuperFloat4>(s_out);

            count++;
            return(true);
        }
コード例 #2
0
        public override bool Calculate()
        {
            tag = true;

            SuperFloat4 s_in  = Inputs[0].GetValue <SuperFloat4>();
            SuperSource s_in2 = Inputs[1].GetValue <SuperSource>();
            SuperFloat4 s_out = new SuperFloat4();

            string NodeCount            = MemoCount.ToString();
            string NewVariable          = "PaletteSwapping2Texture_" + NodeCount;
            string DefaultNameVariable1 = "_PaletteSwapping2Texture_" + NodeCount;
            string PreviewVariable      = s_in.Result;
            string PreviewVariable2     = s_in2.Result;

            string DefaultParameters1 = ", Range(0, 1)) = " + Variable.ToString();

            FinalVariable = DefaultNameVariable1;
            if (s_in.Result == null)
            {
                PreviewVariable = "float4(0,1,1,1)";
            }
            if (s_in2.Result == null)
            {
                PreviewVariable2 = "float4(1,1,0,1)";
            }

            s_out.StringPreviewLines = s_in.StringPreviewNew + s_in2.StringPreviewNew;

            if (parametersOK)
            {
                s_out.ValueLine += "float4 " + NewVariable + " = PaletteSwapping2Texture(" + PreviewVariable2 + ", " + PreviewVariable + ", " + DefaultNameVariable1 + "); \n";
            }
            else
            {
                s_out.ValueLine += "float4 " + NewVariable + " = PaletteSwapping2Texture(" + PreviewVariable2 + ", " + PreviewVariable + ", " + Variable.ToString() + "); \n";
            }

            s_out.Result                      = NewVariable;
            s_out.StringPreviewNew            = s_out.StringPreviewLines + s_out.ValueLine;
            s_out.ParametersLines            += s_in.ParametersLines + s_in2.ParametersLines;
            s_out.ParametersDeclarationLines += s_in.ParametersDeclarationLines + s_in2.ParametersDeclarationLines;
            if (parametersOK)
            {
                s_out.ParametersLines            += DefaultNameVariable1 + "(\"" + DefaultNameVariable1 + "\"" + DefaultParameters1 + "\n";
                s_out.ParametersDeclarationLines += "float " + DefaultNameVariable1 + ";\n";
            }
            Outputs[0].SetValue <SuperFloat4>(s_out);
            count++;
            return(true);
        }
コード例 #3
0
        public override bool Calculate()
        {
            SuperSource s_out = new SuperSource();

            Node.GrabPassTag                 = true;
            s_out.StringPreviewLines         = "";
            s_out.ValueLine                  = "";
            s_out.Result                     = "_GrabTexture";
            s_out.StringPreviewNew           = s_out.StringPreviewLines + s_out.ValueLine;
            s_out.ParametersLines            = "";
            s_out.ParametersDeclarationLines = "";
            Outputs[0].SetValue <SuperSource>(s_out);

            return(true);
        }
コード例 #4
0
        public override bool Calculate()
        {
            SuperSource s_out = new SuperSource();

            string NodeCount   = MemoCount.ToString();
            string DefaultName = "_SourceNewTex_" + NodeCount;

            s_out.StringPreviewNew = s_out.ValueLine;
            s_out.Result           = DefaultName;
            FinalVariable          = DefaultName;

            s_out.ParametersLines            = DefaultName + "(\"" + DefaultName + "(RGB)\", 2D) = \"white\" { }\n";
            s_out.ParametersDeclarationLines = "sampler2D " + DefaultName + ";\n";


            Outputs[0].SetValue <SuperSource>(s_out);
            count++;
            return(true);
        }
コード例 #5
0
        public override bool Calculate()
        {
            tag = true;

            SuperFloat2 s_in  = Inputs[0].GetValue <SuperFloat2>();
            SuperSource s_in2 = Inputs[1].GetValue <SuperSource>();
            SuperFloat4 s_out = new SuperFloat4();


            string NodeCount            = MemoCount.ToString();
            string DefaultName          = "_PageCurl_" + NodeCount;
            string DefaultNameVariable1 = "_PageCurl_movement_" + NodeCount;
            string DefaultNameVariable2 = "_PageCurl_rotation_" + NodeCount;
            string DefaultNameVariable3 = "_PageCurl_Curve_" + NodeCount;
            string DefaultNameVariable4 = "_PageCurl_Shadow_" + NodeCount;
            string DefaultParameters1   = ", Range(-6, 6)) = " + Variable.ToString();
            string DefaultParameters2   = ", Range(-1, 1)) = " + Variable2.ToString();
            string DefaultParameters3   = ", Range(0, 0.3)) = " + Variable3.ToString();
            string DefaultParameters4   = ", Range(0, 8)) = " + Variable4.ToString();
            string uv     = s_in.Result;
            string Source = "";

            FinalVariable  = DefaultNameVariable1;
            FinalVariable2 = DefaultNameVariable2;
            FinalVariable3 = DefaultNameVariable3;
            FinalVariable4 = DefaultNameVariable4;

            // uv
            if (s_in2.Result == null)
            {
                Source = "_MainTex";
            }
            else
            {
                Source = s_in2.Result;
            }

            // source
            if (s_in.Result == null)
            {
                uv = "i.texcoord";
                if (Source == "_MainTex")
                {
                    uv = "i.texcoord";
                }
                if (Source == "_GrabTexture")
                {
                    uv = "i.screenuv";
                }
            }
            else
            {
                uv = s_in.Result;
            }

            s_out.StringPreviewLines = s_in.StringPreviewNew + s_in2.StringPreviewNew;
            if (parametersOK)
            {
                s_out.ValueLine = "float4 " + DefaultName + " = PageCurl(" + Source + "," + uv + "," + DefaultNameVariable1 + "," + DefaultNameVariable2 + "," + DefaultNameVariable3 + "," + DefaultNameVariable4 + ");\n";
            }
            else
            {
                s_out.ValueLine = "float4 " + DefaultName + " = PageCurl(" + Source + "," + uv + "," + Variable.ToString() + "," + Variable2.ToString() + "," + Variable3.ToString() + "," + Variable4.ToString() + ");\n";
            }

            s_out.StringPreviewNew = s_out.StringPreviewLines + s_out.ValueLine;
            s_out.ParametersLines += s_in.ParametersLines + s_in2.ParametersLines;

            s_out.Result = DefaultName;

            s_out.ParametersDeclarationLines += s_in.ParametersDeclarationLines + s_in2.ParametersDeclarationLines;
            if (parametersOK)
            {
                s_out.ParametersLines            += DefaultNameVariable1 + "(\"" + DefaultNameVariable1 + "\"" + DefaultParameters1 + "\n";
                s_out.ParametersLines            += DefaultNameVariable2 + "(\"" + DefaultNameVariable2 + "\"" + DefaultParameters2 + "\n";
                s_out.ParametersLines            += DefaultNameVariable3 + "(\"" + DefaultNameVariable3 + "\"" + DefaultParameters3 + "\n";
                s_out.ParametersLines            += DefaultNameVariable4 + "(\"" + DefaultNameVariable4 + "\"" + DefaultParameters4 + "\n";
                s_out.ParametersDeclarationLines += "float " + DefaultNameVariable1 + ";\n";
                s_out.ParametersDeclarationLines += "float " + DefaultNameVariable2 + ";\n";
                s_out.ParametersDeclarationLines += "float " + DefaultNameVariable3 + ";\n";
                s_out.ParametersDeclarationLines += "float " + DefaultNameVariable4 + ";\n";
            }

            Outputs[0].SetValue <SuperFloat4>(s_out);

            count++;
            return(true);
        }
コード例 #6
0
ファイル: WorldGrass.cs プロジェクト: lantun01/BinaryAssault
        public override bool Calculate()
        {
            Node.WorldPosTag = true;
            tag = true;

            SuperFloat2 s_in  = Inputs[0].GetValue <SuperFloat2>();
            SuperSource s_in2 = Inputs[1].GetValue <SuperSource>();
            SuperSource s_in3 = Inputs[2].GetValue <SuperSource>();
            SuperFloat4 s_out = new SuperFloat4();

            string NodeCount            = MemoCount.ToString();
            string DefaultName          = "_WorldGrassUV_" + NodeCount;
            string DefaultNameVariable1 = "_WorldGrassUV_Zoom_" + NodeCount;
            string DefaultNameVariable2 = "_WorldGrassUV_Worldsize_" + NodeCount;
            string DefaultNameVariable3 = "_WorldGrassUV_Shadowintensity_" + NodeCount;
            string DefaultNameVariable4 = "_WorldGrassUV_WindSpeed_" + NodeCount;
            string DefaultNameVariable5 = "_WorldGrassUV_WindDirection_" + NodeCount;
            string DefaultNameVariable6 = "_WorldGrassUV_GrassDirection_" + NodeCount;
            string DefaultParameters1   = ", Range(0.001, 1)) = " + Variable.ToString();
            string DefaultParameters2   = ", Range(0.01, 8)) = " + Variable2.ToString();
            string DefaultParameters3   = ", Range(0, 2)) = " + Variable3.ToString();
            string DefaultParameters4   = ", Range(0, 8)) = " + Variable4.ToString();
            string DefaultParameters5   = ", Range(-4, 4)) = " + Variable5.ToString();
            string DefaultParameters6   = ", Range(-8, 8)) = " + Variable6.ToString();
            string uv      = s_in.Result;
            string Source  = s_in2.Result;
            string Source2 = s_in3.Result;

            FinalVariable  = DefaultNameVariable1;
            FinalVariable2 = DefaultNameVariable2;
            FinalVariable3 = DefaultNameVariable3;
            FinalVariable4 = DefaultNameVariable4;
            FinalVariable5 = DefaultNameVariable5;
            FinalVariable6 = DefaultNameVariable6;



            // source
            if (s_in.Result == null)
            {
                uv = "i.texcoord";
                if (Source == "_MainTex")
                {
                    uv = "i.texcoord";
                }
                if (Source == "_GrabTexture")
                {
                    uv = "i.screenuv";
                }
            }
            else
            {
                uv = s_in.Result;
            }

            s_out.StringPreviewLines = s_in.StringPreviewNew + s_in2.StringPreviewNew + s_in2.StringPreviewNew + s_in3.StringPreviewNew;

            if (AddParameters)
            {
                s_out.ValueLine = "float4 " + DefaultName + " = WorldGrassDistortion(i.worldPos," + uv + "," + Source + ", " + Source2 + "," + DefaultNameVariable1 + ", " + DefaultNameVariable2 + "," + DefaultNameVariable3 + "," + DefaultNameVariable4 + "," + DefaultNameVariable5 + "," + DefaultNameVariable6 + ");\n";
            }
            else
            {
                s_out.ValueLine = "float4 " + DefaultName + " = WorldGrassDistortion(i.worldPos," + uv + "," + Source + ", " + Source2 + "," + Variable.ToString() + ", " + Variable2.ToString() + "," + Variable3.ToString() + "," + Variable4.ToString() + "," + Variable5.ToString() + "," + Variable6.ToString() + ");\n";
            }

            s_out.StringPreviewNew = s_out.StringPreviewLines + s_out.ValueLine;
            s_out.ParametersLines += s_in.ParametersLines + s_in2.ParametersLines + s_in2.ParametersLines + s_in3.ParametersLines;

            s_out.Result = DefaultName;
            s_out.ParametersDeclarationLines += s_in.ParametersDeclarationLines + s_in2.ParametersDeclarationLines + s_in2.ParametersDeclarationLines + s_in3.ParametersDeclarationLines;

            if (AddParameters)
            {
                s_out.ParametersLines            += DefaultNameVariable1 + "(\"" + DefaultNameVariable1 + "\"" + DefaultParameters1 + "\n";
                s_out.ParametersLines            += DefaultNameVariable2 + "(\"" + DefaultNameVariable2 + "\"" + DefaultParameters2 + "\n";
                s_out.ParametersLines            += DefaultNameVariable3 + "(\"" + DefaultNameVariable3 + "\"" + DefaultParameters3 + "\n";
                s_out.ParametersLines            += DefaultNameVariable4 + "(\"" + DefaultNameVariable4 + "\"" + DefaultParameters4 + "\n";
                s_out.ParametersLines            += DefaultNameVariable5 + "(\"" + DefaultNameVariable5 + "\"" + DefaultParameters5 + "\n";
                s_out.ParametersLines            += DefaultNameVariable6 + "(\"" + DefaultNameVariable6 + "\"" + DefaultParameters6 + "\n";
                s_out.ParametersDeclarationLines += "float " + DefaultNameVariable1 + ";\n";
                s_out.ParametersDeclarationLines += "float " + DefaultNameVariable2 + ";\n";
                s_out.ParametersDeclarationLines += "float " + DefaultNameVariable3 + ";\n";
                s_out.ParametersDeclarationLines += "float " + DefaultNameVariable4 + ";\n";
                s_out.ParametersDeclarationLines += "float " + DefaultNameVariable5 + ";\n";
                s_out.ParametersDeclarationLines += "float " + DefaultNameVariable6 + ";\n";
            }
            Outputs[0].SetValue <SuperFloat4>(s_out);

            count++;
            return(true);
        }
コード例 #7
0
        public override bool Calculate()
        {
            tag = true;

            SuperFloat2 s_in  = Inputs[0].GetValue <SuperFloat2>();
            SuperSource s_in2 = Inputs[1].GetValue <SuperSource>();
            SuperFloat4 s_in3 = Inputs[2].GetValue <SuperFloat4>();
            SuperFloat4 s_in4 = Inputs[3].GetValue <SuperFloat4>();
            SuperFloat4 s_out = new SuperFloat4();


            string NodeCount            = MemoCount.ToString();
            string DefaultName          = "_PatternMovementMask_" + NodeCount;
            string DefaultNameVariable1 = "_PatternMovementMask_PosX_" + NodeCount;
            string DefaultNameVariable2 = "_PatternMovementMask_PosY_" + NodeCount;
            string DefaultNameVariable3 = "_PatternMovementMask_Speed_" + NodeCount;
            string DefaultParameters1   = ", Range(-2, 2)) = " + Variable.ToString();
            string DefaultParameters2   = ", Range(-2, 2)) = " + Variable2.ToString();
            string DefaultParameters3   = ", Range(1, 16)) = " + Variable3.ToString();
            string uv     = s_in.Result;
            string Source = "";

            FinalVariable  = DefaultNameVariable1;
            FinalVariable2 = DefaultNameVariable2;
            FinalVariable3 = DefaultNameVariable3;
            string PreviewVariable  = s_in3.Result;
            string PreviewVariable2 = s_in4.Result;

            // uv
            if (s_in2.Result == null)
            {
                Source = "_MainTex";
            }
            else
            {
                Source = s_in2.Result;
            }

            // source
            if (s_in.Result == null)
            {
                uv = "i.texcoord";
                if (Source == "_MainTex")
                {
                    uv = "i.texcoord";
                }
                if (Source == "_GrabTexture")
                {
                    uv = "i.screenuv";
                }
            }
            else
            {
                uv = s_in.Result;
            }

            if (s_in3.Result == null)
            {
                PreviewVariable = "float4(0,0,0,1)";
            }
            if (s_in4.Result == null)
            {
                PreviewVariable2 = "float4(1,1,1,1)";
            }


            s_out.StringPreviewLines = s_in.StringPreviewNew + s_in2.StringPreviewNew + s_in3.StringPreviewNew + s_in4.StringPreviewNew;
            if (parametersOK)
            {
                s_out.ValueLine = "float4 " + DefaultName + " = PatternMovementMask(" + uv + "," + Source + "," + PreviewVariable + "," + PreviewVariable2 + "," + DefaultNameVariable1 + "," + DefaultNameVariable2 + "," + DefaultNameVariable3 + ");\n";
            }
            else
            {
                s_out.ValueLine = "float4 " + DefaultName + " = PatternMovementMask(" + uv + "," + Source + "," + PreviewVariable + "," + PreviewVariable2 + "," + Variable.ToString() + "," + Variable2.ToString() + "," + Variable3.ToString() + ");\n";
            }
            s_out.StringPreviewNew = s_out.StringPreviewLines + s_out.ValueLine;
            s_out.ParametersLines += s_in.ParametersLines + s_in2.ParametersLines + s_in3.ParametersLines + s_in4.ParametersLines;

            s_out.Result = DefaultName;

            s_out.ParametersDeclarationLines += s_in.ParametersDeclarationLines + s_in2.ParametersDeclarationLines + s_in3.ParametersDeclarationLines + s_in4.ParametersDeclarationLines;
            if (parametersOK)
            {
                s_out.ParametersLines            += DefaultNameVariable1 + "(\"" + DefaultNameVariable1 + "\"" + DefaultParameters1 + "\n";
                s_out.ParametersLines            += DefaultNameVariable2 + "(\"" + DefaultNameVariable2 + "\"" + DefaultParameters2 + "\n";
                s_out.ParametersLines            += DefaultNameVariable3 + "(\"" + DefaultNameVariable3 + "\"" + DefaultParameters3 + "\n";
                s_out.ParametersDeclarationLines += "float " + DefaultNameVariable1 + ";\n";
                s_out.ParametersDeclarationLines += "float " + DefaultNameVariable2 + ";\n";
                s_out.ParametersDeclarationLines += "float " + DefaultNameVariable3 + ";\n";
            }

            Outputs[0].SetValue <SuperFloat4>(s_out);

            count++;
            return(true);
        }
コード例 #8
0
        public override bool Calculate()
        {
            tag = true;

            SuperFloat2 s_in  = Inputs[0].GetValue <SuperFloat2>();
            SuperSource s_in2 = Inputs[1].GetValue <SuperSource>();
            SuperFloat4 s_out = new SuperFloat4();

            string NodeCount            = MemoCount.ToString();
            string DefaultName          = "_Emboss_" + NodeCount;
            string DefaultNameVariable1 = "_Emboss_Angle_" + NodeCount;
            string DefaultNameVariable2 = "_Emboss_Distance_" + NodeCount;
            string DefaultNameVariable3 = "_Emboss_Intensity_" + NodeCount;
            string DefaultNameVariable4 = "_Emboss_grayfade_" + NodeCount;
            string DefaultNameVariable5 = "_Emboss_original_" + NodeCount;
            string DefaultParameters1   = ", Range(-1, 1)) = " + Variable.ToString();
            string DefaultParameters2   = ", Range(0, 16)) = " + Variable2.ToString();
            string DefaultParameters3   = ", Range(-2, 2)) = " + Variable3.ToString();
            string DefaultParameters4   = ", Range(-2, 2)) = " + Variable4.ToString();
            string DefaultParameters5   = ", Range(-2, 2)) = " + Variable5.ToString();
            string uv     = s_in.Result;
            string Source = "";

            FinalVariable  = DefaultNameVariable1;
            FinalVariable2 = DefaultNameVariable2;
            FinalVariable3 = DefaultNameVariable3;
            FinalVariable4 = DefaultNameVariable4;
            FinalVariable5 = DefaultNameVariable5;

            // source
            if (s_in.Result == null)
            {
                uv = "i.texcoord";
            }
            else
            {
                uv = s_in.Result;
            }

            if (s_in2.Result == null)
            {
                Source = "_MainTex";
            }
            else
            {
                Source = s_in2.Result;
            }

            // source
            if (s_in.Result == null)
            {
                uv = "i.texcoord";
                if (Source == "_MainTex")
                {
                    uv = "i.texcoord";
                }
                if (Source == "_GrabTexture")
                {
                    uv = "i.screenuv";
                }
            }
            else
            {
                uv = s_in.Result;
            }

            s_out.StringPreviewLines = s_in.StringPreviewNew + s_in2.StringPreviewNew;

            if (parametersOK)
            {
                s_out.ValueLine = "float4 " + DefaultName + " = Emboss(" + Source + "," + uv + "," + DefaultNameVariable1 + "," + DefaultNameVariable2 + "," + DefaultNameVariable3 + "," + DefaultNameVariable4 + "," + DefaultNameVariable5 + ");\n";
            }
            else
            {
                s_out.ValueLine = "float4 " + DefaultName + " = Emboss(" + Source + "," + uv + "," + Variable.ToString() + "," + Variable2.ToString() + "," + Variable3.ToString() + "," + Variable4.ToString() + "," + Variable5.ToString() + ");\n";
            }

            s_out.StringPreviewNew            = s_out.StringPreviewLines + s_out.ValueLine;
            s_out.ParametersLines            += s_in.ParametersLines + s_in2.ParametersLines;
            s_out.Result                      = DefaultName;
            s_out.ParametersDeclarationLines += s_in.ParametersDeclarationLines + s_in2.ParametersDeclarationLines;

            if (parametersOK)
            {
                s_out.ParametersLines += DefaultNameVariable1 + "(\"" + DefaultNameVariable1 + "\"" + DefaultParameters1 + "\n";
                s_out.ParametersLines += DefaultNameVariable2 + "(\"" + DefaultNameVariable2 + "\"" + DefaultParameters2 + "\n";
                s_out.ParametersLines += DefaultNameVariable3 + "(\"" + DefaultNameVariable3 + "\"" + DefaultParameters3 + "\n";
                s_out.ParametersLines += DefaultNameVariable4 + "(\"" + DefaultNameVariable4 + "\"" + DefaultParameters4 + "\n";
                s_out.ParametersLines += DefaultNameVariable5 + "(\"" + DefaultNameVariable5 + "\"" + DefaultParameters5 + "\n";

                s_out.ParametersDeclarationLines += "float " + DefaultNameVariable1 + ";\n";
                s_out.ParametersDeclarationLines += "float " + DefaultNameVariable2 + ";\n";
                s_out.ParametersDeclarationLines += "float " + DefaultNameVariable3 + ";\n";
                s_out.ParametersDeclarationLines += "float " + DefaultNameVariable4 + ";\n";
                s_out.ParametersDeclarationLines += "float " + DefaultNameVariable5 + ";\n";
            }

            Outputs[0].SetValue <SuperFloat4>(s_out);

            count++;
            return(true);
        }
コード例 #9
0
        public override bool Calculate()
        {
            tag = true;
            SuperFloat2 s_in  = Inputs[0].GetValue <SuperFloat2>();
            SuperSource s_in2 = Inputs[1].GetValue <SuperSource>();
            SuperFloat4 s_in3 = Inputs[2].GetValue <SuperFloat4>();
            SuperFloat4 s_out = new SuperFloat4();

            string NodeCount            = MemoCount.ToString();
            string DefaultName          = "_Displacement_" + NodeCount;
            string DefaultNameVariable1 = "_Displacement_Value_" + NodeCount;
            string DefaultParameters1   = ", Range(-0.3, 0.3)) = " + Variable.ToString();
            string uv     = s_in.Result;
            string RGBA   = s_in3.Result;
            string Source = "";

            FinalVariable = DefaultNameVariable1;

            // uv
            if (s_in2.Result == null)
            {
                Source = "_MainTex";
            }
            else
            {
                Source = s_in2.Result;
            }

            if (s_in3.Result == null)
            {
                RGBA = "float4(0,0,0,1)";
            }
            else
            {
                RGBA = s_in3.Result;
            }


            // source
            if (s_in.Result == null)
            {
                uv = "i.texcoord";
                if (Source == "_MainTex")
                {
                    uv = "i.texcoord";
                }
                if (Source == "_GrabTexture")
                {
                    uv = "i.screenuv";
                }
            }
            else
            {
                uv = s_in.Result;
            }

            s_out.StringPreviewLines = s_in.StringPreviewNew + s_in2.StringPreviewNew + s_in3.StringPreviewNew;

            if (AddParameters)
            {
                if ((DisplacementX == true) && (DisplacementY == true))
                {
                    s_out.ValueLine = "float4 " + DefaultName + " = DisplacementUV(" + uv + "," + Source + "," + RGBA + ".r*" + RGBA + ".a," + RGBA + ".g*" + RGBA + ".a," + DefaultNameVariable1 + ");\n";
                }
                if ((DisplacementX == true) && (DisplacementY == false))
                {
                    s_out.ValueLine = "float4 " + DefaultName + " = DisplacementUV(" + uv + "," + Source + "," + RGBA + ".r*" + RGBA + ".a,0," + DefaultNameVariable1 + ");\n";
                }
                if ((DisplacementX == false) && (DisplacementY == true))
                {
                    s_out.ValueLine = "float4 " + DefaultName + " = DisplacementUV(" + uv + "," + Source + ",0," + RGBA + ".g*" + RGBA + ".a," + DefaultNameVariable1 + ");\n";
                }
                if ((DisplacementX == false) && (DisplacementY == false))
                {
                    s_out.ValueLine = "float4 " + DefaultName + " = DisplacementUV(" + uv + "," + Source + ",0,0," + DefaultNameVariable1 + ");\n";
                }
            }
            else
            {
                if ((DisplacementX == true) && (DisplacementY == true))
                {
                    s_out.ValueLine = "float4 " + DefaultName + " = DisplacementUV(" + uv + "," + Source + "," + RGBA + ".r*" + RGBA + ".a," + RGBA + ".g*" + RGBA + ".a," + Variable.ToString() + ");\n";
                }
                if ((DisplacementX == true) && (DisplacementY == false))
                {
                    s_out.ValueLine = "float4 " + DefaultName + " = DisplacementUV(" + uv + "," + Source + "," + RGBA + ".r*" + RGBA + ".a,0," + Variable.ToString() + ");\n";
                }
                if ((DisplacementX == false) && (DisplacementY == true))
                {
                    s_out.ValueLine = "float4 " + DefaultName + " = DisplacementUV(" + uv + "," + Source + ",0," + RGBA + ".g*" + RGBA + ".a," + Variable.ToString() + ");\n";
                }
                if ((DisplacementX == false) && (DisplacementY == false))
                {
                    s_out.ValueLine = "float4 " + DefaultName + " = DisplacementUV(" + uv + "," + Source + ",0,0," + Variable.ToString() + ");\n";
                }
            }

            s_out.StringPreviewNew = s_out.StringPreviewLines + s_out.ValueLine;
            s_out.ParametersLines += s_in.ParametersLines + s_in2.ParametersLines + s_in3.ParametersLines;

            s_out.Result = DefaultName;
            s_out.ParametersDeclarationLines += s_in.ParametersDeclarationLines + s_in2.ParametersDeclarationLines + s_in3.ParametersDeclarationLines;

            if (AddParameters)
            {
                s_out.ParametersLines            += DefaultNameVariable1 + "(\"" + DefaultNameVariable1 + "\"" + DefaultParameters1 + "\n";
                s_out.ParametersDeclarationLines += "float " + DefaultNameVariable1 + ";\n";
            }
            Outputs[0].SetValue <SuperFloat4>(s_out);

            count++;
            return(true);
        }
コード例 #10
0
        public override bool Calculate()
        {
            tag = true;
            SuperFloat2 s_in  = Inputs[0].GetValue <SuperFloat2>();
            SuperSource s_in2 = Inputs[1].GetValue <SuperSource>();
            SuperFloat2 s_out = new SuperFloat2();

            string NodeCount            = MemoCount.ToString();
            string DefaultName          = "_HumanBreathEx_" + NodeCount;
            string DefaultNameVariable1 = "_HumanBreatEx_Intensity_" + NodeCount;
            string DefaultNameVariable2 = "_HumanBreatEx_Speed_" + NodeCount;
            string DefaultNameVariable3 = "_HumanBreatEx_Side_Intensity_" + NodeCount;
            string DefaultParameters1   = ", Range(0, 2)) = " + Variable.ToString();
            string DefaultParameters2   = ", Range(0, 3)) = " + Variable2.ToString();
            string DefaultParameters3   = ", Range(0, 2)) = " + Variable3.ToString();
            string uv     = s_in.Result;
            string RGBA   = s_in2.Result;
            string Source = "";

            FinalVariable  = DefaultNameVariable1;
            FinalVariable2 = DefaultNameVariable2;
            FinalVariable3 = DefaultNameVariable3;

            // source
            if (s_in.Result == null)
            {
                uv = "i.texcoord";
                if (Source == "_MainTex")
                {
                    uv = "i.texcoord";
                }
                if (Source == "_GrabTexture")
                {
                    uv = "i.screenuv";
                }
            }
            else
            {
                uv = s_in.Result;
            }
            if (s_in2.Result == null)
            {
                Source = "_MainTex";
                if (uv == "i.texcoord")
                {
                    Source = "_MainTex";
                }
                if (uv == "i.screenuv")
                {
                    Source = "_GrabTexture";
                }
            }
            else
            {
                Source = s_in2.Result;
            }


            s_out.StringPreviewLines = s_in.StringPreviewNew + s_in2.StringPreviewNew;


            if (AddParameters)
            {
                s_out.ValueLine = "float2 " + DefaultName + " = HumanBreathExUV(" + uv + "," + RGBA + "," + DefaultNameVariable1 + "," + DefaultNameVariable2 + "," + DefaultNameVariable3 + ");\n";
            }
            else
            {
                s_out.ValueLine = "float2 " + DefaultName + " = HumanBreathExUV(" + uv + "," + RGBA + "," + Variable.ToString() + "," + Variable2.ToString() + "," + Variable3.ToString() + ");\n";
            }


            s_out.StringPreviewNew = s_out.StringPreviewLines + s_out.ValueLine;
            s_out.ParametersLines += s_in.ParametersLines + s_in2.ParametersLines;

            s_out.Result = DefaultName;
            s_out.ParametersDeclarationLines += s_in.ParametersDeclarationLines + s_in2.ParametersDeclarationLines;

            if (AddParameters)
            {
                s_out.ParametersLines            += DefaultNameVariable1 + "(\"" + DefaultNameVariable1 + "\"" + DefaultParameters1 + "\n";
                s_out.ParametersLines            += DefaultNameVariable2 + "(\"" + DefaultNameVariable2 + "\"" + DefaultParameters2 + "\n";
                s_out.ParametersLines            += DefaultNameVariable3 + "(\"" + DefaultNameVariable3 + "\"" + DefaultParameters3 + "\n";
                s_out.ParametersDeclarationLines += "float " + DefaultNameVariable1 + ";\n";
                s_out.ParametersDeclarationLines += "float " + DefaultNameVariable2 + ";\n";
                s_out.ParametersDeclarationLines += "float " + DefaultNameVariable3 + ";\n";
            }
            Outputs[0].SetValue <SuperFloat2>(s_out);

            count++;
            return(true);
        }
コード例 #11
0
        public override bool Calculate()
        {
            tag = true;

            SuperFloat2 s_in  = Inputs[0].GetValue <SuperFloat2>();
            SuperSource s_in2 = Inputs[1].GetValue <SuperSource>();
            SuperFloat4 s_in3 = Inputs[2].GetValue <SuperFloat4>();
            SuperFloat4 s_out = new SuperFloat4();


            string NodeCount            = MemoCount.ToString();
            string DefaultName          = "_DamageIncrustationTint_" + NodeCount;
            string DefaultNameVariable1 = "_DamageIncrustationTint_blend_" + NodeCount;
            string DefaultNameVariable2 = "_DamageIncrustationTint_zoom_" + NodeCount;
            string DefaultNameVariable3 = "_DamageIncrustationTint_posx_" + NodeCount;
            string DefaultNameVariable4 = "_DamageIncrustationTint_posy_" + NodeCount;
            string DefaultNameVariable5 = "_DamageIncrustationTint_color_" + NodeCount;
            string DefaultParameters1   = ", Range(0, 1)) = " + Variable.ToString();
            string DefaultParameters2   = ", Range(0, 8)) = " + Variable2.ToString();
            string DefaultParameters3   = ", Range(-2, 2)) = " + Variable3.ToString();
            string DefaultParameters4   = ", Range(-2, 2)) = " + Variable4.ToString();
            string DefaultParameters5   = ", COLOR) = (" + Variable5.r + "," + Variable5.g + "," + Variable5.b + "," + Variable5.a + ")";
            string uv     = s_in.Result;
            string Source = "";
            string Text   = "";

            FinalVariable  = DefaultNameVariable1;
            FinalVariable2 = DefaultNameVariable2;
            FinalVariable3 = DefaultNameVariable3;
            FinalVariable4 = DefaultNameVariable4;
            FinalVariable5 = DefaultNameVariable5;

            // uv
            if (s_in2.Result == null)
            {
                Source = "_MainTex";
            }
            else
            {
                Source = s_in2.Result;
            }

            // uv
            if (s_in3.Result == null)
            {
                Text = "float4(0,0,0,0)";
            }
            else
            {
                Text = s_in3.Result;
            }

            // source
            if (s_in.Result == null)
            {
                uv = "i.texcoord";
                if (Source == "_MainTex")
                {
                    uv = "i.texcoord";
                }
                if (Source == "_GrabTexture")
                {
                    uv = "i.screenuv";
                }
            }
            else
            {
                uv = s_in.Result;
            }

            s_out.StringPreviewLines = s_in.StringPreviewNew + s_in2.StringPreviewNew + s_in3.StringPreviewNew;
            if (parametersOK)
            {
                s_out.ValueLine = "float4 " + DefaultName + " = DamageIncrustationTint(" + uv + "," + Text + "," + Source + "," + DefaultNameVariable1 + "," + DefaultNameVariable2 + "," + DefaultNameVariable3 + "," + DefaultNameVariable4 + "," + DefaultNameVariable5 + ");\n";
            }
            else
            {
                s_out.ValueLine = "float4 " + DefaultName + " = DamageIncrustationTint(" + uv + "," + Text + "," + Source + "," + Variable.ToString() + "," + Variable2.ToString() + "," + Variable3.ToString() + "," + Variable4.ToString() + ", float4(" + Variable5.r.ToString() + "," + Variable5.g.ToString() + "," + Variable5.b.ToString() + "," + Variable5.a.ToString() + ")" + ");\n";
            }

            s_out.StringPreviewNew = s_out.StringPreviewLines + s_out.ValueLine;
            s_out.ParametersLines += s_in.ParametersLines + s_in2.ParametersLines + s_in3.ParametersLines;

            s_out.Result = DefaultName;

            s_out.ParametersDeclarationLines += s_in.ParametersDeclarationLines + s_in2.ParametersDeclarationLines + s_in3.ParametersDeclarationLines;
            if (parametersOK)
            {
                s_out.ParametersLines            += DefaultNameVariable1 + "(\"" + DefaultNameVariable1 + "\"" + DefaultParameters1 + "\n";
                s_out.ParametersLines            += DefaultNameVariable2 + "(\"" + DefaultNameVariable2 + "\"" + DefaultParameters2 + "\n";
                s_out.ParametersLines            += DefaultNameVariable3 + "(\"" + DefaultNameVariable3 + "\"" + DefaultParameters3 + "\n";
                s_out.ParametersLines            += DefaultNameVariable4 + "(\"" + DefaultNameVariable4 + "\"" + DefaultParameters4 + "\n";
                s_out.ParametersLines            += DefaultNameVariable5 + "(\"" + DefaultNameVariable5 + "\"" + DefaultParameters5 + "\n";
                s_out.ParametersDeclarationLines += "float " + DefaultNameVariable1 + ";\n";
                s_out.ParametersDeclarationLines += "float " + DefaultNameVariable2 + ";\n";
                s_out.ParametersDeclarationLines += "float " + DefaultNameVariable3 + ";\n";
                s_out.ParametersDeclarationLines += "float " + DefaultNameVariable4 + ";\n";
                s_out.ParametersDeclarationLines += "float4 " + DefaultNameVariable5 + ";\n";
            }

            Outputs[0].SetValue <SuperFloat4>(s_out);

            count++;
            return(true);
        }
コード例 #12
0
        public override bool Calculate()
        {
            tag = true;

            SuperFloat2 s_in  = Inputs[0].GetValue <SuperFloat2>();
            SuperSource s_in2 = Inputs[1].GetValue <SuperSource>();
            SuperFloat4 s_out = new SuperFloat4();


            string NodeCount            = MemoCount.ToString();
            string DefaultName          = "_ShadowLight_" + NodeCount;
            string DefaultNameVariable1 = "_ShadowLight_Precision_" + NodeCount;
            string DefaultNameVariable2 = "_ShadowLight_Size_" + NodeCount;
            string DefaultNameVariable3 = "_ShadowLight_Color_" + NodeCount;
            string DefaultNameVariable4 = "_ShadowLight_Intensity_" + NodeCount;
            string DefaultNameVariable5 = "_ShadowLight_PosX_" + NodeCount;
            string DefaultNameVariable6 = "_ShadowLight_PosY_" + NodeCount;
            string DefaultNameVariable7 = "_ShadowLight_NoSprite_" + NodeCount;
            string DefaultParameters1   = ", Range(1, 32)) = " + Variable.ToString();
            string DefaultParameters2   = ", Range(0, 16)) = " + Variable2.ToString();
            string DefaultParameters3   = ", COLOR) = (" + Variable3.r + "," + Variable3.g + "," + Variable3.b + "," + Variable3.a + ")";
            string DefaultParameters4   = ", Range(0, 4)) = " + Variable4.ToString();
            string DefaultParameters5   = ", Range(-1, 1)) = " + Variable5.ToString();
            string DefaultParameters6   = ", Range(-1, 1)) = " + Variable6.ToString();
            string DefaultParameters7   = ", Range(0, 1)) = " + Variable7.ToString();
            string uv     = s_in.Result;
            string Source = "";

            FinalVariable  = DefaultNameVariable1;
            FinalVariable2 = DefaultNameVariable2;
            FinalVariable3 = DefaultNameVariable3;
            FinalVariable4 = DefaultNameVariable4;
            FinalVariable5 = DefaultNameVariable5;
            FinalVariable6 = DefaultNameVariable6;
            FinalVariable7 = DefaultNameVariable7;

            // uv
            if (s_in2.Result == null)
            {
                Source = "_MainTex";
            }
            else
            {
                Source = s_in2.Result;
            }

            // source
            if (s_in.Result == null)
            {
                uv = "i.texcoord";
                if (Source == "_MainTex")
                {
                    uv = "i.texcoord";
                }
                if (Source == "_GrabTexture")
                {
                    uv = "i.screenuv";
                }
            }
            else
            {
                uv = s_in.Result;
            }

            s_out.StringPreviewLines = s_in.StringPreviewNew + s_in2.StringPreviewNew;
            if (parametersOK)
            {
                s_out.ValueLine = "float4 " + DefaultName + " = ShadowLight(" + Source + "," + uv + "," + DefaultNameVariable1 + "," + DefaultNameVariable2 + "," + DefaultNameVariable3 + "," + DefaultNameVariable4 + "," + DefaultNameVariable5 + "," + DefaultNameVariable6 + "," + DefaultNameVariable7 + ");\n";
            }
            else
            {
                string vcol = "float4(" + Variable3.r.ToString() + "," + Variable3.g.ToString() + "," + Variable3.b.ToString() + ",1)";


                s_out.ValueLine = "float4 " + DefaultName + " = ShadowLight(" + Source + "," + uv + "," + Variable.ToString() + "," + Variable2.ToString() + "," + vcol + "," + Variable4.ToString() + "," + Variable5.ToString() + "," + Variable6.ToString() + "," + Variable7.ToString() + ");\n";
            }
            s_out.StringPreviewNew = s_out.StringPreviewLines + s_out.ValueLine;
            s_out.ParametersLines += s_in.ParametersLines + s_in2.ParametersLines;

            s_out.Result = DefaultName;

            s_out.ParametersDeclarationLines += s_in.ParametersDeclarationLines + s_in2.ParametersDeclarationLines;
            if (parametersOK)
            {
                s_out.ParametersLines            += DefaultNameVariable1 + "(\"" + DefaultNameVariable1 + "\"" + DefaultParameters1 + "\n";
                s_out.ParametersLines            += DefaultNameVariable2 + "(\"" + DefaultNameVariable2 + "\"" + DefaultParameters2 + "\n";
                s_out.ParametersLines            += DefaultNameVariable3 + "(\"" + DefaultNameVariable3 + "\"" + DefaultParameters3 + "\n";
                s_out.ParametersLines            += DefaultNameVariable4 + "(\"" + DefaultNameVariable4 + "\"" + DefaultParameters4 + "\n";
                s_out.ParametersLines            += DefaultNameVariable5 + "(\"" + DefaultNameVariable5 + "\"" + DefaultParameters5 + "\n";
                s_out.ParametersLines            += DefaultNameVariable6 + "(\"" + DefaultNameVariable6 + "\"" + DefaultParameters6 + "\n";
                s_out.ParametersLines            += DefaultNameVariable7 + "(\"" + DefaultNameVariable7 + "\"" + DefaultParameters7 + "\n";
                s_out.ParametersDeclarationLines += "float " + DefaultNameVariable1 + ";\n";
                s_out.ParametersDeclarationLines += "float " + DefaultNameVariable2 + ";\n";
                s_out.ParametersDeclarationLines += "float4 " + DefaultNameVariable3 + ";\n";
                s_out.ParametersDeclarationLines += "float " + DefaultNameVariable4 + ";\n";
                s_out.ParametersDeclarationLines += "float " + DefaultNameVariable5 + ";\n";
                s_out.ParametersDeclarationLines += "float " + DefaultNameVariable6 + ";\n";
                s_out.ParametersDeclarationLines += "float " + DefaultNameVariable7 + ";\n";
            }

            Outputs[0].SetValue <SuperFloat4>(s_out);

            count++;
            return(true);
        }
コード例 #13
0
        public override bool Calculate()
        {
            tag = true;

            SuperFloat2 s_in  = Inputs[0].GetValue <SuperFloat2>();
            SuperFloat2 s_in2 = Inputs[1].GetValue <SuperFloat2>();
            SuperSource s_in3 = Inputs[2].GetValue <SuperSource>();
            SuperFloat4 s_out = new SuperFloat4();


            string NodeCount             = MemoCount.ToString();
            string DefaultName           = "_Generate_3DPlanet_" + NodeCount;
            string DefaultNameVariable1  = "_Generate_3DPlanet_RotationY_" + NodeCount;
            string DefaultNameVariable2  = "_Generate_3DPlanet_RotationX_" + NodeCount;
            string DefaultNameVariable3  = "_Generate_3DPlanet_LightDirection_X_" + NodeCount;
            string DefaultNameVariable4  = "_Generate_3DPlanet_LightDirection_Y_" + NodeCount;
            string DefaultNameVariable5  = "_Generate_3DPlanet_LightDirection_Z_" + NodeCount;
            string DefaultNameVariable6  = "_Generate_3DPlanet_Light_Color_" + NodeCount;
            string DefaultNameVariable7  = "_Generate_3DPlanet_Speed_" + NodeCount;
            string DefaultNameVariable8  = "_Generate_3DPlanet_HaloIntensity_" + NodeCount;
            string DefaultNameVariable9  = "_Generate_3DPlanet_HaloSize_" + NodeCount;
            string DefaultNameVariable10 = "_Generate_3DPlanet_HaloColor_" + NodeCount;
            string DefaultNameVariable11 = "_Generate_3DPlanet_InsideShadow_" + NodeCount;
            string DefaultNameVariable12 = "_Generate_3DPlanet_StrangeX_" + NodeCount;
            string DefaultNameVariable13 = "_Generate_3DPlanet_StrangeY_" + NodeCount;
            string DefaultNameVariable14 = "_Generate_3DPlanet_CloudVolume_" + NodeCount;
            string DefaultNameVariable15 = "_Generate_3DPlanet_CloudIntensity_" + NodeCount;
            string DefaultNameVariable16 = "_Generate_3DPlanet_CloudDistortion_" + NodeCount;
            string DefaultNameVariable17 = "_Generate_3DPlanet_CloudColor_" + NodeCount;
            string DefaultParameters1    = ", Range(-4, 4)) = " + Variable.ToString();
            string DefaultParameters2    = ", Range(-4, 4)) = " + Variable2.ToString();
            string DefaultParameters3    = ", Range(-4, 4)) = " + Variable3.ToString();
            string DefaultParameters4    = ", Range(-4, 4)) = " + Variable4.ToString();
            string DefaultParameters5    = ", Range(-4, 4)) = " + Variable5.ToString();
            string DefaultParameters6    = ", COLOR) = (" + Variable6.r + "," + Variable6.g + "," + Variable6.b + "," + Variable6.a + ")";
            string DefaultParameters7    = ", Range(-8, 8)) = " + Variable7.ToString();
            string DefaultParameters8    = ", Range(0, 1)) = " + Variable8.ToString();
            string DefaultParameters9    = ", Range(-0.05, 0.05)) = " + Variable9.ToString();
            string DefaultParameters10   = ", COLOR) = (" + Variable10.r + "," + Variable10.g + "," + Variable10.b + "," + Variable10.a + ")";
            string DefaultParameters11   = ", Range(-1, 1)) = " + Variable11.ToString();
            string DefaultParameters12   = ", Range(-2, 2)) = " + Variable12.ToString();
            string DefaultParameters13   = ", Range(-2, 2)) = " + Variable13.ToString();
            string DefaultParameters14   = ", Range(-0.1, 1.1)) = " + Variable14.ToString();
            string DefaultParameters15   = ", Range(-2, 2)) = " + Variable15.ToString();
            string DefaultParameters16   = ", Range(-2, 8)) = " + Variable16.ToString();
            string DefaultParameters17   = ", COLOR) = (" + Variable17.r + "," + Variable17.g + "," + Variable17.b + "," + Variable17.a + ")";
            string uv     = s_in.Result;
            string uv2    = s_in2.Result;
            string Source = "";

            FinalVariable   = DefaultNameVariable1;
            FinalVariable2  = DefaultNameVariable2;
            FinalVariable3  = DefaultNameVariable3;
            FinalVariable4  = DefaultNameVariable4;
            FinalVariable5  = DefaultNameVariable5;
            FinalVariable6  = DefaultNameVariable6;
            FinalVariable7  = DefaultNameVariable7;
            FinalVariable8  = DefaultNameVariable8;
            FinalVariable9  = DefaultNameVariable9;
            FinalVariable10 = DefaultNameVariable10;
            FinalVariable11 = DefaultNameVariable11;
            FinalVariable12 = DefaultNameVariable12;
            FinalVariable13 = DefaultNameVariable13;
            FinalVariable14 = DefaultNameVariable14;
            FinalVariable15 = DefaultNameVariable15;
            FinalVariable16 = DefaultNameVariable16;
            FinalVariable17 = DefaultNameVariable17;

            if (s_in3.Result == null)
            {
                Source = "_MainTex";
            }
            else
            {
                Source = s_in3.Result;
            }

            if (s_in.Result == null)
            {
                uv = "i.texcoord";
                if (Source == "_MainTex")
                {
                    uv = "i.texcoord";
                }
                if (Source == "_GrabTexture")
                {
                    uv = "i.screenuv";
                }
            }
            else
            {
                uv = s_in.Result;
            }

            if (s_in2.Result == null)
            {
                uv2 = "i.texcoord";
                if (Source == "_MainTex")
                {
                    uv2 = "i.texcoord";
                }
                if (Source == "_GrabTexture")
                {
                    uv2 = "i.screenuv";
                }
            }
            else
            {
                uv2 = s_in2.Result;
            }

            s_out.StringPreviewLines = s_in.StringPreviewNew + s_in2.StringPreviewNew + s_in3.StringPreviewNew;
            if (parametersOK)
            {
                s_out.ValueLine = "float4 " + DefaultName + " = Generate_3DPlanet(" + Source + "," + uv + "," + uv2 + ", float2(" + DefaultNameVariable1 + "," + DefaultNameVariable2 + "),float3(" + DefaultNameVariable3 + "," + DefaultNameVariable4 + "," + DefaultNameVariable5 + "),"
                                  + DefaultNameVariable6 + ","
                                  + DefaultNameVariable7 + ","
                                  + DefaultNameVariable8 + ","
                                  + DefaultNameVariable9 + ","
                                  + DefaultNameVariable10 + ","
                                  + DefaultNameVariable11 + ","
                                  + DefaultNameVariable12 + ","
                                  + DefaultNameVariable13 + ","
                                  + DefaultNameVariable14 + ","
                                  + DefaultNameVariable15 + ","
                                  + DefaultNameVariable16 + ","
                                  + DefaultNameVariable17 + ""
                                  + ");\n";
            }
            else
            {
                string vcol  = "float4(" + Variable6.r.ToString() + "," + Variable6.g.ToString() + "," + Variable6.b.ToString() + "," + Variable6.a.ToString() + ")";
                string vcol2 = "float4(" + Variable10.r.ToString() + "," + Variable10.g.ToString() + "," + Variable10.b.ToString() + "," + Variable10.a.ToString() + ")";
                string vcol3 = "float4(" + Variable17.r.ToString() + "," + Variable17.g.ToString() + "," + Variable17.b.ToString() + "," + Variable17.a.ToString() + ")";

                s_out.ValueLine = "float4 " + DefaultName + " = Generate_3DPlanet(" + Source + "," + uv + "," + uv2 + ", float2(" + Variable.ToString() + "," + Variable2.ToString() + "),float3(" + Variable3.ToString() + "," + Variable4.ToString() + "," + Variable5.ToString() + "),"
                                  + vcol + ","
                                  + Variable7.ToString() + ","
                                  + Variable8.ToString() + ","
                                  + Variable9.ToString() + ","
                                  + vcol2 + ","
                                  + Variable11.ToString() + ","
                                  + Variable12.ToString() + ","
                                  + Variable13.ToString() + ","
                                  + Variable14.ToString() + ","
                                  + Variable15.ToString() + ","
                                  + Variable16.ToString() + ","
                                  + vcol3 + ""
                                  + ");\n";
            }
            s_out.StringPreviewNew = s_out.StringPreviewLines + s_out.ValueLine;
            s_out.ParametersLines += s_in.ParametersLines + s_in2.ParametersLines + s_in3.ParametersLines;

            s_out.Result = DefaultName;

            s_out.ParametersDeclarationLines += s_in.ParametersDeclarationLines + s_in2.ParametersDeclarationLines + s_in3.ParametersDeclarationLines;
            if (parametersOK)
            {
                s_out.ParametersLines            += DefaultNameVariable1 + "(\"" + DefaultNameVariable1 + "\"" + DefaultParameters1 + "\n";
                s_out.ParametersLines            += DefaultNameVariable2 + "(\"" + DefaultNameVariable2 + "\"" + DefaultParameters2 + "\n";
                s_out.ParametersLines            += DefaultNameVariable3 + "(\"" + DefaultNameVariable3 + "\"" + DefaultParameters3 + "\n";
                s_out.ParametersLines            += DefaultNameVariable4 + "(\"" + DefaultNameVariable4 + "\"" + DefaultParameters4 + "\n";
                s_out.ParametersLines            += DefaultNameVariable5 + "(\"" + DefaultNameVariable5 + "\"" + DefaultParameters5 + "\n";
                s_out.ParametersLines            += DefaultNameVariable6 + "(\"" + DefaultNameVariable6 + "\"" + DefaultParameters6 + "\n";
                s_out.ParametersLines            += DefaultNameVariable7 + "(\"" + DefaultNameVariable7 + "\"" + DefaultParameters7 + "\n";
                s_out.ParametersLines            += DefaultNameVariable8 + "(\"" + DefaultNameVariable8 + "\"" + DefaultParameters8 + "\n";
                s_out.ParametersLines            += DefaultNameVariable9 + "(\"" + DefaultNameVariable9 + "\"" + DefaultParameters9 + "\n";
                s_out.ParametersLines            += DefaultNameVariable10 + "(\"" + DefaultNameVariable10 + "\"" + DefaultParameters10 + "\n";
                s_out.ParametersLines            += DefaultNameVariable11 + "(\"" + DefaultNameVariable11 + "\"" + DefaultParameters11 + "\n";
                s_out.ParametersLines            += DefaultNameVariable12 + "(\"" + DefaultNameVariable12 + "\"" + DefaultParameters12 + "\n";
                s_out.ParametersLines            += DefaultNameVariable13 + "(\"" + DefaultNameVariable13 + "\"" + DefaultParameters13 + "\n";
                s_out.ParametersLines            += DefaultNameVariable14 + "(\"" + DefaultNameVariable14 + "\"" + DefaultParameters14 + "\n";
                s_out.ParametersLines            += DefaultNameVariable15 + "(\"" + DefaultNameVariable15 + "\"" + DefaultParameters15 + "\n";
                s_out.ParametersLines            += DefaultNameVariable16 + "(\"" + DefaultNameVariable16 + "\"" + DefaultParameters16 + "\n";
                s_out.ParametersLines            += DefaultNameVariable17 + "(\"" + DefaultNameVariable17 + "\"" + DefaultParameters17 + "\n";
                s_out.ParametersDeclarationLines += "float " + DefaultNameVariable1 + ";\n";
                s_out.ParametersDeclarationLines += "float " + DefaultNameVariable2 + ";\n";
                s_out.ParametersDeclarationLines += "float " + DefaultNameVariable3 + ";\n";
                s_out.ParametersDeclarationLines += "float " + DefaultNameVariable4 + ";\n";
                s_out.ParametersDeclarationLines += "float " + DefaultNameVariable5 + ";\n";
                s_out.ParametersDeclarationLines += "float4 " + DefaultNameVariable6 + ";\n";
                s_out.ParametersDeclarationLines += "float " + DefaultNameVariable7 + ";\n";
                s_out.ParametersDeclarationLines += "float " + DefaultNameVariable8 + ";\n";
                s_out.ParametersDeclarationLines += "float " + DefaultNameVariable9 + ";\n";
                s_out.ParametersDeclarationLines += "float4 " + DefaultNameVariable10 + ";\n";
                s_out.ParametersDeclarationLines += "float " + DefaultNameVariable11 + ";\n";
                s_out.ParametersDeclarationLines += "float " + DefaultNameVariable12 + ";\n";
                s_out.ParametersDeclarationLines += "float " + DefaultNameVariable13 + ";\n";
                s_out.ParametersDeclarationLines += "float " + DefaultNameVariable14 + ";\n";
                s_out.ParametersDeclarationLines += "float " + DefaultNameVariable15 + ";\n";
                s_out.ParametersDeclarationLines += "float " + DefaultNameVariable16 + ";\n";
                s_out.ParametersDeclarationLines += "float4 " + DefaultNameVariable17 + ";\n";
            }

            Outputs[0].SetValue <SuperFloat4>(s_out);

            count++;
            return(true);
        }
コード例 #14
0
        public override bool Calculate()
        {
            tag = true;

            SuperFloat2 s_in  = Inputs[0].GetValue <SuperFloat2>();
            SuperSource s_in2 = Inputs[1].GetValue <SuperSource>();
            SuperFloat4 s_out = new SuperFloat4();


            string NodeCount            = MemoCount.ToString();
            string DefaultName          = "_OutlineEmpty_" + NodeCount;
            string DefaultNameVariable1 = "_OutlineEmpty_Size_" + NodeCount;
            string DefaultNameVariable2 = "_OutlineEmpty_Color_" + NodeCount;
            string DefaultParameters1   = ", Range(1, 16)) = 16.0";
            string DefaultParameters2   = ", COLOR) = (1,1,1,1)";
            string uv     = s_in.Result;
            string Source = "";

            FinalVariable  = DefaultNameVariable1;
            FinalVariable2 = DefaultNameVariable2;

            // uv
            if (s_in2.Result == null)
            {
                Source = "_MainTex";
            }
            else
            {
                Source = s_in2.Result;
            }

            // source
            if (s_in.Result == null)
            {
                uv = "i.texcoord";
                if (Source == "_MainTex")
                {
                    uv = "i.texcoord";
                }
                if (Source == "_GrabTexture")
                {
                    uv = "i.screenuv";
                }
            }
            else
            {
                uv = s_in.Result;
            }

            s_out.StringPreviewLines = s_in.StringPreviewNew + s_in2.StringPreviewNew;

            s_out.ValueLine        = "float4 " + DefaultName + " = OutLineEmpty(" + uv + "," + Source + "," + DefaultNameVariable1 + "," + DefaultNameVariable2 + ");\n";
            s_out.StringPreviewNew = s_out.StringPreviewLines + s_out.ValueLine;
            s_out.ParametersLines += s_in.ParametersLines + s_in2.ParametersLines;

            s_out.Result = DefaultName;

            s_out.ParametersDeclarationLines += s_in.ParametersDeclarationLines + s_in2.ParametersDeclarationLines;
            s_out.ParametersLines            += DefaultNameVariable1 + "(\"" + DefaultNameVariable1 + "\"" + DefaultParameters1 + "\n";
            s_out.ParametersLines            += DefaultNameVariable2 + "(\"" + DefaultNameVariable2 + "\"" + DefaultParameters2 + "\n";
            s_out.ParametersDeclarationLines += "float " + DefaultNameVariable1 + ";\n";
            s_out.ParametersDeclarationLines += "float4 " + DefaultNameVariable2 + ";\n";

            Outputs[0].SetValue <SuperFloat4>(s_out);

            count++;
            result = s_out.StringPreviewNew;
            return(true);
        }
コード例 #15
0
        public override bool Calculate()
        {
            tag = true;

            SuperFloat2 s_in  = Inputs[0].GetValue <SuperFloat2>();
            SuperFloat2 s_in2 = Inputs[1].GetValue <SuperFloat2>();
            SuperSource s_in3 = Inputs[2].GetValue <SuperSource>();
            SuperFloat4 s_out = new SuperFloat4();


            string NodeCount            = MemoCount.ToString();
            string DefaultName          = "_GenerateSimple3DSphere_" + NodeCount;
            string DefaultNameVariable1 = "_GenerateSimple3DSphere_RotationY_" + NodeCount;
            string DefaultNameVariable2 = "_GenerateSimple3DSphere_RotationX_" + NodeCount;
            string DefaultParameters1   = ", Range(-4, 4)) = " + Variable.ToString();
            string DefaultParameters2   = ", Range(-4, 4)) = " + Variable2.ToString();
            string uv     = s_in.Result;
            string uv2    = s_in2.Result;
            string Source = "";

            FinalVariable  = DefaultNameVariable1;
            FinalVariable2 = DefaultNameVariable2;

            if (s_in3.Result == null)
            {
                Source = "_MainTex";
            }
            else
            {
                Source = s_in3.Result;
            }

            if (s_in.Result == null)
            {
                uv = "i.texcoord";
                if (Source == "_MainTex")
                {
                    uv = "i.texcoord";
                }
                if (Source == "_GrabTexture")
                {
                    uv = "i.screenuv";
                }
            }
            else
            {
                uv = s_in.Result;
            }

            if (s_in2.Result == null)
            {
                uv2 = "i.texcoord";
                if (Source == "_MainTex")
                {
                    uv2 = "i.texcoord";
                }
                if (Source == "_GrabTexture")
                {
                    uv2 = "i.screenuv";
                }
            }
            else
            {
                uv2 = s_in2.Result;
            }

            s_out.StringPreviewLines = s_in.StringPreviewNew + s_in2.StringPreviewNew + s_in3.StringPreviewNew;
            if (parametersOK)
            {
                s_out.ValueLine = "float4 " + DefaultName + " = SimpleGenerate3DSpherize(" + Source + "," + uv + "," + uv2 + ", float2(" + DefaultNameVariable1 + "," + DefaultNameVariable2 + "));\n";
            }
            else
            {
                s_out.ValueLine = "float4 " + DefaultName + " = SimpleGenerate3DSpherize(" + Source + "," + uv + "," + uv2 + ", float2(" + Variable.ToString() + "," + Variable2.ToString() + "));\n";
            }
            s_out.StringPreviewNew = s_out.StringPreviewLines + s_out.ValueLine;
            s_out.ParametersLines += s_in.ParametersLines + s_in2.ParametersLines + s_in3.ParametersLines;

            s_out.Result = DefaultName;

            s_out.ParametersDeclarationLines += s_in.ParametersDeclarationLines + s_in2.ParametersDeclarationLines + s_in3.ParametersDeclarationLines;
            if (parametersOK)
            {
                s_out.ParametersLines            += DefaultNameVariable1 + "(\"" + DefaultNameVariable1 + "\"" + DefaultParameters1 + "\n";
                s_out.ParametersLines            += DefaultNameVariable2 + "(\"" + DefaultNameVariable2 + "\"" + DefaultParameters2 + "\n";
                s_out.ParametersDeclarationLines += "float " + DefaultNameVariable1 + ";\n";
                s_out.ParametersDeclarationLines += "float " + DefaultNameVariable2 + ";\n";
            }

            Outputs[0].SetValue <SuperFloat4>(s_out);

            count++;
            return(true);
        }
コード例 #16
0
ファイル: TurnMetal.cs プロジェクト: lantun01/BinaryAssault
        public override bool Calculate()
        {
            tag = true;

            SuperFloat2 s_in  = Inputs[0].GetValue <SuperFloat2>();
            SuperSource s_in2 = Inputs[1].GetValue <SuperSource>();
            SuperFloat4 s_out = new SuperFloat4();

            string NodeCount            = MemoCount.ToString();
            string DefaultName          = "_TurnMetal_" + NodeCount;
            string DefaultNameVariable1 = "_TurnMetal_Speed_" + NodeCount;
            string DefaultParameters1   = ", Range(-8, 8)) = " + Variable.ToString();
            string uv     = s_in.Result;
            string Source = "";

            FinalVariable = DefaultNameVariable1;

            // uv
            if (s_in2.Result == null)
            {
                Source = "_MainTex";
            }
            else
            {
                Source = s_in2.Result;
            }

            // source
            if (s_in.Result == null)
            {
                uv = "i.texcoord";
                if (Source == "_MainTex")
                {
                    uv = "i.texcoord";
                }
                if (Source == "_GrabTexture")
                {
                    uv = "i.screenuv";
                }
            }
            else
            {
                uv = s_in.Result;
            }

            s_out.StringPreviewLines = s_in.StringPreviewNew + s_in2.StringPreviewNew;

            if (parametersOK)
            {
                s_out.ValueLine = "float4 " + DefaultName + " = ColorTurnMetal(" + uv + "," + Source + "," + DefaultNameVariable1 + ");\n";
            }
            else
            {
                s_out.ValueLine = "float4 " + DefaultName + " = ColorTurnMetal(" + uv + "," + Source + "," + Variable.ToString() + ");\n";
            }
            s_out.StringPreviewNew = s_out.StringPreviewLines + s_out.ValueLine;
            s_out.ParametersLines += s_in.ParametersLines + s_in2.ParametersLines;

            s_out.Result = DefaultName;

            s_out.ParametersDeclarationLines += s_in.ParametersDeclarationLines + s_in2.ParametersDeclarationLines;

            if (parametersOK)
            {
                s_out.ParametersLines            += DefaultNameVariable1 + "(\"" + DefaultNameVariable1 + "\"" + DefaultParameters1 + "\n";
                s_out.ParametersDeclarationLines += "float " + DefaultNameVariable1 + ";\n";
            }
            Outputs[0].SetValue <SuperFloat4>(s_out);

            count++;
            return(true);
        }
コード例 #17
0
        public override bool Calculate()
        {
            tag = true;

            SuperFloat2 s_in  = Inputs[0].GetValue <SuperFloat2>();
            SuperFloat2 s_in2 = Inputs[1].GetValue <SuperFloat2>();
            SuperSource s_in3 = Inputs[2].GetValue <SuperSource>();
            SuperFloat4 s_out = new SuperFloat4();


            string NodeCount            = MemoCount.ToString();
            string DefaultName          = "_Generate3DSphere_" + NodeCount;
            string DefaultNameVariable1 = "_Generate3DSphere_RotationY_" + NodeCount;
            string DefaultNameVariable2 = "_Generate3DSphere_RotationX_" + NodeCount;
            string DefaultNameVariable3 = "_Generate3DSphere_LightDirection_X_" + NodeCount;
            string DefaultNameVariable4 = "_Generate3DSphere_LightDirection_Y_" + NodeCount;
            string DefaultNameVariable5 = "_Generate3DSphere_LightDirection_Z_" + NodeCount;
            string DefaultNameVariable6 = "_Generate3DSphere_Light_Color_" + NodeCount;
            string DefaultParameters1   = ", Range(-4, 4)) = " + Variable.ToString();
            string DefaultParameters2   = ", Range(-4, 4)) = " + Variable2.ToString();
            string DefaultParameters3   = ", Range(-10, 10)) = " + Variable3.ToString();
            string DefaultParameters4   = ", Range(-10, 10)) = " + Variable4.ToString();
            string DefaultParameters5   = ", Range(-10, 10)) = " + Variable5.ToString();
            string DefaultParameters6   = ", COLOR) = (" + Variable6.r + "," + Variable6.g + "," + Variable6.b + "," + Variable6.a + ")";
            string uv     = s_in.Result;
            string uv2    = s_in2.Result;
            string Source = "";

            FinalVariable  = DefaultNameVariable1;
            FinalVariable2 = DefaultNameVariable2;
            FinalVariable3 = DefaultNameVariable3;
            FinalVariable4 = DefaultNameVariable4;
            FinalVariable5 = DefaultNameVariable5;
            FinalVariable6 = DefaultNameVariable6;

            if (s_in3.Result == null)
            {
                Source = "_MainTex";
            }
            else
            {
                Source = s_in3.Result;
            }

            if (s_in.Result == null)
            {
                uv = "i.texcoord";
                if (Source == "_MainTex")
                {
                    uv = "i.texcoord";
                }
                if (Source == "_GrabTexture")
                {
                    uv = "i.screenuv";
                }
            }
            else
            {
                uv = s_in.Result;
            }

            if (s_in2.Result == null)
            {
                uv2 = "i.texcoord";
                if (Source == "_MainTex")
                {
                    uv2 = "i.texcoord";
                }
                if (Source == "_GrabTexture")
                {
                    uv2 = "i.screenuv";
                }
            }
            else
            {
                uv2 = s_in2.Result;
            }

            s_out.StringPreviewLines = s_in.StringPreviewNew + s_in2.StringPreviewNew + s_in3.StringPreviewNew;
            if (parametersOK)
            {
                s_out.ValueLine = "float4 " + DefaultName + " = Generate3DSpherize(" + Source + "," + uv + "," + uv2 + ", float2(" + DefaultNameVariable1 + "," + DefaultNameVariable2 + "),float3(" + DefaultNameVariable3 + "," + DefaultNameVariable4 + "," + DefaultNameVariable5 + ")," + DefaultNameVariable6 + ");\n";
            }
            else
            {
                string vcol = "float4(" + Variable6.r.ToString() + "," + Variable6.g.ToString() + "," + Variable6.b.ToString() + "," + Variable6.a.ToString() + ")";

                s_out.ValueLine = "float4 " + DefaultName + " = Generate3DSpherize(" + Source + "," + uv + "," + uv2 + ", float2(" + Variable.ToString() + "," + Variable2.ToString() + "),float3(" + Variable3.ToString() + "," + Variable4.ToString() + "," + Variable5.ToString() + ")," + vcol + ");\n";
            }
            s_out.StringPreviewNew = s_out.StringPreviewLines + s_out.ValueLine;
            s_out.ParametersLines += s_in.ParametersLines + s_in2.ParametersLines + s_in3.ParametersLines;

            s_out.Result = DefaultName;

            s_out.ParametersDeclarationLines += s_in.ParametersDeclarationLines + s_in2.ParametersDeclarationLines + s_in3.ParametersDeclarationLines;
            if (parametersOK)
            {
                s_out.ParametersLines            += DefaultNameVariable1 + "(\"" + DefaultNameVariable1 + "\"" + DefaultParameters1 + "\n";
                s_out.ParametersLines            += DefaultNameVariable2 + "(\"" + DefaultNameVariable2 + "\"" + DefaultParameters2 + "\n";
                s_out.ParametersLines            += DefaultNameVariable3 + "(\"" + DefaultNameVariable3 + "\"" + DefaultParameters3 + "\n";
                s_out.ParametersLines            += DefaultNameVariable4 + "(\"" + DefaultNameVariable4 + "\"" + DefaultParameters4 + "\n";
                s_out.ParametersLines            += DefaultNameVariable5 + "(\"" + DefaultNameVariable5 + "\"" + DefaultParameters5 + "\n";
                s_out.ParametersLines            += DefaultNameVariable6 + "(\"" + DefaultNameVariable6 + "\"" + DefaultParameters6 + "\n";
                s_out.ParametersDeclarationLines += "float " + DefaultNameVariable1 + ";\n";
                s_out.ParametersDeclarationLines += "float " + DefaultNameVariable2 + ";\n";
                s_out.ParametersDeclarationLines += "float " + DefaultNameVariable3 + ";\n";
                s_out.ParametersDeclarationLines += "float " + DefaultNameVariable4 + ";\n";
                s_out.ParametersDeclarationLines += "float " + DefaultNameVariable5 + ";\n";
                s_out.ParametersDeclarationLines += "float4 " + DefaultNameVariable6 + ";\n";
            }

            Outputs[0].SetValue <SuperFloat4>(s_out);

            count++;
            return(true);
        }