[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Public WebGL] Few questions/comments about context creation attributes
On May 24, 2010, at 3:59 PM, Kenneth Russell wrote:
>> ...On a different but related note, shouldn't WebGL be more conservative
>> with context creation by default ? What was the rationale for
>> providing a depth and stencil buffer by default ? Convenience ?
>> While I can understand for depth, I'm not sure to understand why every
>> WebGL context should be created with a stencil buffer by default. The
>> feature being not that commonly used (is there even one WebGL demo
>> enabling STENCIL_TEST currently?), most WebGL contexts - created with
>> default attributes - will pay for a feature they do not use,
>> potentially impacting performance a bit but at least for sure reducing
>> the amount of video memory available for textures and buffers.
>> For both depth and stencil, while any developer who needs these
>> feature will enable them at context creation (one already has to
>> enable DEPTH_TEST and/or STENCIL_TEST anyways!), it is likely that
>> very few developers will think/remember disabling them when they don't
>> need one or both, making WebGL content in general use more memory and
>> less efficient than it could be.
> Chris Marrin can probably comment on the decision to enable the
> stencil buffer by default. Note that multisampling is also enabled by
> default. These are probably the most unsurprising defaults for web
> developers, and those who care about memory consumption can turn one
> or the other feature off.
I have no recollection of ever being an advocate for this, and certainly not a vocal one. I guess I can see pros and cons of doing it both ways. But it seems like it would be better for it to be off by default. That way, even if you're allocating a 24 bit z buffer that takes up 32 bits of space (which is common), turning on stencil would just use those 8 bits instead of wasting them. So I don't see a reason to have it on by default.
You are currently subscribed to firstname.lastname@example.org.
To unsubscribe, send an email to email@example.com with
the following command in the body of your email: