public void GetTexture(TextureTypes texType)
    {
        EditorGUILayout.Space();
        GUILayout.Label("Enter " + texType);
        switch (texType)
        {
        case TextureTypes.Diffuse:
            Diffuse = EditorGUILayout.ObjectField(Diffuse, typeof(Texture), false);
            break;

        case TextureTypes.Metallic:
            Metallic = EditorGUILayout.ObjectField(Metallic, typeof(Texture), false);
            break;

        case TextureTypes.Gloss:
            Gloss = EditorGUILayout.ObjectField(Gloss, typeof(Texture), false);
            break;

        case TextureTypes.Roughness:
            Roughness = EditorGUILayout.ObjectField(Roughness, typeof(Texture), false);
            break;

        case TextureTypes.Normal:
            Normal = EditorGUILayout.ObjectField(Normal, typeof(Texture), false);
            break;

        case TextureTypes.Texture:
            Texture = EditorGUILayout.ObjectField(Texture, typeof(Texture), false);
            break;
        }
    }
    //
    // Display data on textures
    //

    public void DisplayTexture(TextureTypes textureType)
    {
        switch (textureType)
        {
        case TextureTypes.None:
            displayDataOnTexture.DisplayNoTexture();
            break;

        case TextureTypes.Flowfield_Obstacle:
            displayDataOnTexture.DisplayTexture_FlowField_DistanceToObstacle();
            break;

        case TextureTypes.Flowfield_Target:
            displayDataOnTexture.DisplayTexture_FlowField_DistanceToTarget();
            break;

        case TextureTypes.Voronoi_Field:
            displayDataOnTexture.DisplayTexture_VoronoiField();
            break;

        case TextureTypes.Voronoi_Diagram:
            displayDataOnTexture.DisplayTexture_VoronoiDiagram();
            break;
        }
    }
示例#3
0
        public TTexture(Vector3 loc,
                        int resolution,
                        int density,
                        TextureTypes type,
                        bool byTile = false)
        {
            this.resolution = resolution;
            this.density    = density;

            this.Loc  = loc;
            this.Type = type;

            this.totalPix = (resolution * density) * (resolution * density);

            this.byTile = byTile;

            if (this.Type != TextureTypes.NoTexture)
            {
                this.Tex = new Texture2D(resolution * density,
                                         resolution * density);
                this.Colors = this.Tex.GetPixels();
            }

            this.finished = false;
        }
示例#4
0
 protected Texture(string name, TextureSampler sampler, ColorSpaceTypes colorSpace, TextureTypes textureType)
 {
     Name        = name;
     Sampler     = sampler;
     ColorSpace  = colorSpace;
     TextureType = textureType;
 }
示例#5
0
        public Texture(FileInfo file) : base(file)
        {
            BitmapImage image = GetImage();

            this.Width      = image.Width;
            this.Height     = image.Height;
            this.Resolution = Width.ToString() + "x" + Height.ToString();
            this.Type       = DetermineType();
        }
示例#6
0
 protected Texture(string name, TextureSampler sampler, ColorSpaceTypes colorSpace, TextureTypes textureType)
 {
     if (name == null)
     {
         throw new ArgumentNullException("name");
     }
     Name        = name;
     Sampler     = sampler;
     ColorSpace  = colorSpace;
     TextureType = textureType;
 }
示例#7
0
        public GetTextureParam(string name, TextureTypes textureType, float metallicFactor, float roughnessFactor, int?i0, int?i1, int?i2, int?i3, int?i4, int?i5)
        {
            if (string.IsNullOrEmpty(name))
            {
                throw new ArgumentNullException();
            }
            m_name = name;

            TextureType     = textureType;
            MetallicFactor  = metallicFactor;
            RoughnessFactor = roughnessFactor;
            Index0          = (ushort?)i0;
            Index1          = (ushort?)i1;
            Index2          = (ushort?)i2;
            Index3          = (ushort?)i3;
            Index4          = (ushort?)i4;
            Index5          = (ushort?)i5;
        }
    //
    // Generate data on textures
    //

    public void GenerateTexture(Map map, TextureTypes textureType)
    {
        switch (textureType)
        {
        case TextureTypes.Flowfield_Obstacle:
            displayDataOnTexture.GenerateTexture_FlowField_DistanceToObstacle(map);
            break;

        case TextureTypes.Flowfield_Target:
            displayDataOnTexture.GenerateTexture_FlowField_DistanceToTarget(map);
            break;

        case TextureTypes.Voronoi_Field:
            displayDataOnTexture.GenerateTexture_VoronoiField(map);
            break;

        case TextureTypes.Voronoi_Diagram:
            displayDataOnTexture.GenerateTexture_VoronoiDiagram(map);
            break;
        }
    }
示例#9
0
        //==============================================
        // CONSTRUCTOR

        // creates a random island given a few parameters
        public Island(Vector3 init,
                      Vector3 scale,
                      noiseFunc method,
                      TextureTypes t,
                      int density,
                      MeshLib.MaskMethod m = null)
            : base(init, scale, method, t, density)
        {
            // adjust the y coordinate of the island
            this.Loc = new Vector3(Loc.x, -1 * Random.Range(1, islandRange), Loc.z);

            // assign the type of mask
            this.Mask = m != null ? m : MeshLib.Mask.GenRandom();

            if (this.Mask == null)
            {
                Debug.Log("WHAT1");
            }

            _debug("Initialized");

            StartCreateIsland();
        }
示例#10
0
        //==============================================
        // CONSTRUCTOR

        public GenericTerrain(Vector3 init,
                              Vector3 scale,
                              noiseFunc method,
                              TextureTypes t = TextureTypes.NoTexture,
                              int density    = defDensity)
        {
            this.Method   = method;
            this.Material = MaterialController.GenDefault();

            // set default values
            this.Texture = new TTexture(init, textureResolution, density, t);

            this.Loc   = init;
            this.Scale = new Vector3(
                Mathf.Max(scale.x + GetDimensions(scale.x / sizeFactor), 200),
                Mathf.Max(scale.y + GetDimensions(scale.y / sizeFactor), 200),
                Mathf.Max(scale.z + GetDimensions(scale.z / sizeFactor), 200)
                );

            this.Coloring = randomGradient();

            _debug("Initialized");
        }
 // first 8 are junk and are not used.
 public static BackgroundTextureType GetTextureType(byte[] mimb)
 => mimb == null ? default: TextureTypes.First(x => x.FileSize == mimb.Length);
示例#12
0
 public ImageTexture(string name, TextureSampler sampler, Image image, ColorSpaceTypes colorSpace, TextureTypes textureType = TextureTypes.Default) : base(name, sampler, colorSpace, textureType)
 {
     Image = image;
 }
示例#13
0
 public RenderTexture(string name, TextureSampler sampler, ColorSpaceTypes colorSpace, TextureTypes textureType, int width = 256, int height = 256) : base(name, sampler, colorSpace, textureType)
 {
     Width  = width;
     Height = height;
 }
示例#14
0
 public SolidTexture(string name, TextureSampler sampler, Vector4 color, ColorSpaceTypes colorSpace, TextureTypes textureType) : base(name, sampler, colorSpace, textureType)
 {
     Color = color;
 }
示例#15
0
 public MetallicRoughnessImageTexture(string name, TextureSampler sampler, Image image, float roughnessFactor, ColorSpaceTypes colorSpace, TextureTypes textureType = TextureTypes.Default)
     : base(name, sampler, image, colorSpace, textureType)
 {
     Image           = image;
     RoughnessFactor = roughnessFactor;
 }
示例#16
0
 public static BackgroundTextureType GetTextureType(IReadOnlyCollection <byte> mimBytes)
 => mimBytes == null ? default : TextureTypes.First(x => x.FileSize == mimBytes.Count);