예제 #1
0
    void SetWaveTall(WAVETYPE waveTall)
    {
        if (waveTall == WAVETYPE.NONE)
        {
            return;
        }
        if (waveTextureName == WAVETYPE.NONE || waveTextureName != waveTall)
        {
            Texture tex = Resources.Load(waveTexs[(int)waveTall]) as Texture;
            gameObject.GetComponent <Renderer>().material.SetTexture(Shaderparams[1], tex);
            waveTextureName = waveTall;
            switch (waveTall)
            {
            case WAVETYPE.STILL:
                gameObject.GetComponent <Renderer>().material.SetFloat(Shaderparams[2], 0.013f);
                gameObject.GetComponent <Renderer>().material.mainTextureScale = new Vector2(8, 8);
                break;
                break;

            case WAVETYPE.NORMAL:
                gameObject.GetComponent <Renderer>().material.SetFloat(Shaderparams[2], Random.Range(0.013f, 0.02f));
                gameObject.GetComponent <Renderer>().material.mainTextureScale = new Vector2(4, 4);
                break;

            case WAVETYPE.TALL:
                gameObject.GetComponent <Renderer>().material.SetFloat(Shaderparams[2], 0.02f);
                gameObject.GetComponent <Renderer>().material.mainTextureScale = new Vector2(2, 2);
                break;
            }
        }
    }
예제 #2
0
    public void SetWater(float clearness, WAVETYPE_COLOR coltype, float wavePower, WAVETYPE waveTall)
    {
        //透明度のセット
        SetClearness(clearness);

        //水の色の設定
        SetWaterColor(coltype);

        //波の高さの設定
        SetWaveTall(waveTall);
    }
예제 #3
0
        public gaborTemplate(gaborTemplateCinfo theCinfo)
        {
            Debug.Assert(theCinfo.myWidth % 2 == 1);
            Debug.Assert(theCinfo.myHeight % 2 == 1);

            myHeight = theCinfo.myHeight;
            myWidth = theCinfo.myWidth;

            myFrequency = theCinfo.myFrequency;
            myOrientation = theCinfo.myOrientation;
            myVariance = theCinfo.myVariance;

            myScaleHeight = theCinfo.myScaleHeight;
            myScaleWidth = theCinfo.myScaleWidth;

            amIcos = theCinfo.myWaveType;

            myTemplate = new double[myWidth, myHeight];

            for (int widthCounter = 0; widthCounter < myWidth; widthCounter++)
            {
                for (int heightCounter = 0; heightCounter < myHeight; heightCounter++)
                {
                    double thisX = ((widthCounter - getEffWidth()) * myScaleWidth);
                    double thisY = ((heightCounter - getEffHeight()) * myScaleHeight);

                    if (Convert.ToBoolean(amIcos))
                    {
                        myTemplate[widthCounter, heightCounter] = planeFunctions.planeCos(myFrequency, myOrientation, thisX, thisY) * planeFunctions.planeGaussianAtOrigin(myVariance, thisX, thisY);
                    }
                    else
                    {
                        myTemplate[widthCounter, heightCounter] = planeFunctions.planeSin(myFrequency, myOrientation, thisX, thisY) * planeFunctions.planeGaussianAtOrigin(myVariance, thisX, thisY);
                    }
                }
            }
        }