Beispiel #1
0
                protected override ProTeGe_Texture GetBandNoise(int i, int resolution)
                {
                    int noiseSize = (int)(resolution / Mathf.Pow(2, i));

                    ProTeGe_Texture noise = white.Generate(noiseSize);

                    noise.size = noiseSize;

                    if (noise.size >= 4)
                    {
                        ProTeGe_Texture scaledNoise = new ProTeGe_Texture(noise.size / 2);
                        scaledNoise.CopyFrom(noise, true);
                        scaledNoise.upscaleMode = ProTeGe_Texture.UpscaleModes.Bicubic;
                        scaledNoise.size       *= 2;

                        matDiff.SetTexture("_Tex2", scaledNoise.renderTexture);
                        noise.ApplyMaterial(matDiff);

                        scaledNoise.Release();
                    }

                    noise.upscaleMode = ProTeGe_Texture.UpscaleModes.Bicubic;
                    noise.size        = Globals.instance.textureSize_preview;

                    return(noise);
                }