[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Public WebGL] Adding internalformat param to all texImage2d variants
On May 18, 2010, at 10:36 AM, Cedric Vivier wrote:
> On Tue, May 18, 2010 at 15:10, Mark Callow <firstname.lastname@example.org> wrote:
>> On 2010/05/17 16:10, Cedric Vivier wrote:
>>> On Mon, May 17, 2010 at 20:55, Mark Callow <email@example.com> wrote:
>> The parameter you are specifying is the internal format so gl.NONE
>> doesn't make logical sense to me. If people really don't want to create
>> a new token, gl.DONT_CARE makes more logical sense as a way of telling
>> the implementation to select the most appropriate format. However a new
>> token gl.SOURCE_FORMAT_WEBGL is much more clear and has the added
>> advantage of making it clear that this parameter value cannot be used in
>> standard GL.
> "NONE internal format is specified." vs "DONT_CARE internal format is
> specified." vs "internal format is NONE." vs "internal format is
> I don't think one is significantly more legible than the other without
> more context.
> The context lies in the spec/documentation, something like "If no
> internal format is specified (0 or NONE), the implementation will
> choose the most compact internal format to represent passed DOM
> element without loss of information, according to table X." would be
> simple enough I think.
> Both DONT_CARE and SOURCE_FORMAT_WEBGL have the disadvantage of being
> more verbose and not equal to 0 (a common default in APIs).
> Convenience and terseness are important here imo because the more
> verbose the less likely that web developers will use this default
> instead of just hard-coding say RGB or RGBA, this could make WebGL
> content less efficient in general .
I don't think we should make the numeric value of the enum an issue. None of the numeric values chosen for the OpenGL enums have any significance, other than some of them being sequential for convenience. We should do as Mark suggests, reserve a range with the ARB and define an enum for our uses. I'm not very particular about what we actually call it.
> Making clear that default value is not usable in standard GL is a good
> idea but not really relevant here since discussed texImage2D DOM
> helpers are obviously WebGL-specific anyways.
> I agree with Chris that WebGL should not handle conversion  on the
> standard texImage2D signature, developers using this
> 'advanced'/compatibility signature somehow loaded raw pixel data in
> directly from whatever non-DOM source it gets the raw data from (e.g
> pre-computed JSON).
This makes me think that maybe we don't want to reuse "internalformat" or any of its enums at all. Perhaps we should instead call the param "convertTo" or something like that and have a unique set of enums (including NO_CONVERSION) to better distinguish the operation from simply describing the internalformat, as is done in the raw form of texImage2D.
You are currently subscribe to firstname.lastname@example.org.
To unsubscribe, send an email to email@example.com with
the following command in the body of your email: