[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Public WebGL] Generic compression formats (and a texImage2D API issue)
- To: Cedric Vivier <firstname.lastname@example.org>
- Subject: Re: [Public WebGL] Generic compression formats (and a texImage2D API issue)
- From: Kenneth Russell <email@example.com>
- Date: Mon, 10 May 2010 16:01:03 -0700
- Cc: public webgl <firstname.lastname@example.org>
- Dkim-signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=google.com; s=beta; t=1273532466; bh=bT7mGvhLRKEFteBpsn9gPORg6oY=; h=MIME-Version:In-Reply-To:References:Date:Message-ID:Subject:From: To:Cc:Content-Type:Content-Transfer-Encoding; b=NKmkdA7Mc1VeU8jpjYHZ6JA7ueFeonCIdib4QPsi9LSxFjkcithR6nbkmWiYBJ33t meawU+NR+XPkj5Ym2sTqQ==
- Domainkey-signature: a=rsa-sha1; s=beta; d=google.com; c=nofws; q=dns; h=mime-version:in-reply-to:references:date:message-id:subject:from:to: cc:content-type:content-transfer-encoding:x-system-of-record; b=CJfjyhJv7VsZ3rB4giVhqU6v6k+GgwiJp96Ma0Fz+gBZSadJL7sLOs8/xrzEz1WA1 HNARhZGq2XvKVpxG8NVeA==
- In-reply-to: <AANLkTikrfWYssNb62vOMCfHh98z9jhqpdA067HzOTx13@mail.gmail.com>
- References: <AANLkTikrfWYssNb62vOMCfHh98z9jhqpdA067HzOTx13@mail.gmail.com>
- Sender: email@example.com
On Mon, May 10, 2010 at 11:31 AM, Cedric Vivier <firstname.lastname@example.org> wrote:
> On the subject of bandwidth and memory savings discussed in the FP16
> thread, I've been wondering for a while if there is
> any plan for a format-independent texture compression hinting
> mechanism (ala ARB_texture_compression) in WebGL ?
> This would bring quite significant performance benefits for a large
> number of use cases since most apps can compress at least a few
> textures, and this would require minimum work for web developers
> (who'd just have to hint which textures are eligible for a given kind
> of compression).
> Using a simplified version of ARB_texture_compression, we could have
> something like :
> gl.texImage2D(gl.TEXTURE_2D, 0, gl.COMPRESSED_RGB, anImage);
> Meaning the image will be stored in a compressed RGB format supported
> by the WebGL implementation and/or driver,
> otherwise an uncompressed internal format is used as usual.
> The mechanism works well within the interoperability constraints of WebGL :
> Generic compressed internal formats are
> not actual image formats, but are instead mapped into one of the specific
> compressed formats provided by the GL (or to an uncompressed base internal
> format if no appropriate compressed format is available). Generic
> compressed internal formats allow applications to use texture compression
> without needing to code to any particular compression algorithm. Generic
> compressed formats allow the use of texture compression across a wide
> range of platforms with differing compression algorithms and also allow
> future GL implementations to substitute improved compression methods
> (excerpt from ARB_texture_compression)
> Most desktop WebGL implementations could use ARB_texture_compression
> as-is; on ES 2.0, where the largest benefits could be felt
> (bandwidth-constrained devices), a WebGL implementation could use
> uncompressed data (as it does now) or compress the data to one of the
> supported specific formats (e.g PVRTC) before the actual GL call as it
> see fits (may be too expensive to do on slower embedded CPUs but
> probably not the case on the current 1ghz+ crop, needs perf data).
The topic of texture compression has been discussed in the working
group. The current Web APIs do not provide an efficient way to
download such compressed texture data. For this reason, we resolved to
defer the introduction of compressed textures to a future, post-1.0,
version of the WebGL specification.
> Regardless texture compression, this made me notice an issue with the
> current texImage2D helper signatures
> (having a HTMLImageElement, HTMLCanvasElement or HTMLVideoElement parameter) :
> they do not have a (internal) format parameter, moreover potential
> usage for compression (and/or extensions), it can be useful to
> have such anyways as it would allow, for instance, to load only the
> alpha channel from a PNG into an alpha mask texture,
> intermediate canvas etc.
This has come up on this mailing list recently and was discussed at
length. Please search the archives for the thread "Retrieving number
of texture channels". At this point this is a request for enhancement.
> You are currently subscribe to email@example.com.
> To unsubscribe, send an email to firstname.lastname@example.org with
> the following command in the body of your email:
You are currently subscribe to email@example.com.
To unsubscribe, send an email to firstname.lastname@example.org with
the following command in the body of your email: