[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [Public WebGL] ATC texture size computation



Sounds good to me

 

From: Benoit Jacob [mailto:bjacob@mozilla.com]
Sent: Tuesday, September 11, 2012 1:07 PM
To: public_webgl@khronos.org; Wilson, Diego
Subject: Re: [Public WebGL] ATC texture size computation

 

Hi Diego,

Today while writing the WebGL extension proposal, it occured to me that the buffer size formulas could be made a little bit more explicit by writing floor(x/y) rather than just (x/y), to make it clear that we define integer division as rounding down.

So the formulas become:

floor((width_in_texels+3)/4) * floor((height_in_texels+3)/4) * 8

And * 16 for the RGBA case.

Of course, I hope that I was correct in assuming rounding down in integer division ;-)

Cheers,
Benoit

On 12-09-07 12:15 PM, Wilson, Diego wrote:

Hello,

 

The AMD_compressed_ATC_texture format is documented here:

 

http://www.khronos.org/registry/gles/extensions/AMD/AMD_compressed_ATC_texture.txt

 

It was brought to my attention that this compressed texture format is a good candidate for exposing as a WebGL extension. And that it is only missing one piece of information: the buffer size computation. Below is that information that has been verified both with experts in the format and empirically.

 

Compressed texture images stored using the ATC compressed image formats are represented as a collection of 4x4 texel blocks.

 

The size in bytes of a compressed ATC_RGB_AMD image is:

 

   ((width_in_texels+3)/4) * ((height_in_texels+3)/4) * 8

 

The size in bytes of a compressed ATC_RGBA_EXPLICIT_ALPHA_AMD or ATC_RGBA_INTERPOLATED_ALPHA_AMD image is:

 

   ((width_in_texels+3)/4) * ((height_in_texels+3)/4) * 16

 

I’m currently working to include this in public documentation as well.

 

Regards,

 

_________________

Diego Wilson