Exemplo n.º 1
0
        public Texture loadTexture(string url, Three.UVMapping mapping = null)
        {
            image   = null;
            texture = new Texture(image, mapping);

            load(ref image, url);

            if (OnLoad != null)
            {
                OnLoad(this, EventArgs.Empty);
            }
            texture.sourceFile = url;

            return(texture);
        }
Exemplo n.º 2
0
        public Texture(Image image             = null,
                       Three.UVMapping mapping = null,
                       int wrapS      = Three.ClampToEdgeWrapping,
                       int wrapT      = Three.ClampToEdgeWrapping,
                       int magFilter  = Three.LinearFilter,
                       int minFilter  = Three.LinearMipMapLinearFilter,
                       int format     = Three.RGBAFormat,
                       int type       = Three.UnsignedByteType,
                       int anisotropy = 1)
        {
            this.id = TextureIdCount++;

            this.name = "";

            this.image   = image;
            this.mipmaps = new List <int>();

            this.mapping = (mapping != null?mapping:new Three.UVMapping());

            this.wrapS = wrapS;
            this.wrapT = wrapT;

            this.magFilter = magFilter;
            this.minFilter = minFilter;

            this.anisotropy = anisotropy;

            this.format = format;
            this.type   = type;

            this.offset = new Vector2(0, 0);
            this.repeat = new Vector2(1, 1);

            this.generateMipmaps  = true;
            this.premultiplyAlpha = false;
            this.flipY            = true;
            this.unpackAlignment  = 4;            // valid values: 1, 2, 4, 8 (see http://www.khronos.org/opengles/sdk/docs/man/xhtml/glPixelStorei.xml)

            this.needsUpdate = false;
            this.onUpdate    = null;
        }