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

Re: [Public WebGL] Moving float color buffer proposals to draft (was Re: Fixing the OES_texture_float mess)

On 2012/11/16 19:23, Florian Bösch wrote:
The OpenGL specification (4.2 core) states in section 8.5 

format, type, and data specify the format of the image data
and it also states that

Textures with integer internal formats (see table 8.12) require integer data.
An INVALID_OPERATION error is generated if the internal format is integer
and format is not one of the integer formats listed in table 8.3, or if the internal
format is not integer and format is an integer format


For OpenGL, the type parameter is superfluous because it *has* to match the internal formats type and the data buffer *has* to match the type.
The <type> parameter is not superfluous. It is the only way the OpenGL implementation knows what type of data the application is providing. For the integer case you cited, there are several integer formats that could be used to supply that data. They are not disambiguated by <format>.
For OpenGL ES the type parameter is the only way to "specify" an internal format completely, and the data equally (presumably) *has* to match the type.
For ES 2.0, unfortunately, <format> and <type> do not specify the internal format completely. The implementation has freedom to choose the number of bits at which it stores each component.

The data absolutely has the match the type. If it does not, the application is likely to crash. If it does not crash, the texture will be nonsense.

Therefore, since WebGL is modelled after OpenGL ES:
1) It should not be possible to create a floating point texture by passing an unsigned byte array (which by extension means <img> objects)
2) The only way you can specify a floating point texture is with the second flavor call that accepts a type.
As I said when I started this thread (and again above), if you try that in native ES the app will most likely crash. The app has to first convert the data from unsigned byte array to FLOAT.
3) WebGLs current interpretation of the ES spec is correct.
4) WebGLs OES_texture_float is correct
5) GL_RGBA32F or the like are Desktop OpenGL specific terminology that do not apply to OpenGL ES, and introducing new internal format types is not supported by the ES spec nor any extension.



注意:この電子メールには、株式会社エイチアイの機密情報が含まれている場合が有ります。正式なメール受信者では無い場合はメール複製、 再配信または情報の使用を固く禁じております。エラー、手違いでこのメールを受け取られましたら削除を行い配信者にご連絡をお願いいたし ます.

NOTE: This electronic mail message may contain confidential and privileged information from HI Corporation. If you are not the intended recipient, any disclosure, photocopying, distribution or use of the contents of the received information is prohibited. If you have received this e-mail in error, please notify the sender immediately and permanently delete this message and all related copies.