[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Public WebGL] Behavior of WebGL canvas when it can't make a backbuffer of the requested size?
- To: Chris Marrin <firstname.lastname@example.org>
- Subject: Re: [Public WebGL] Behavior of WebGL canvas when it can't make a backbuffer of the requested size?
- From: Kenneth Russell <email@example.com>
- Date: Fri, 5 Nov 2010 11:33:22 -0700
- Cc: "Gregg Tavares (wrk)" <firstname.lastname@example.org>, Cedric Vivier <email@example.com>, Steve Baker <firstname.lastname@example.org>, Vladimir Vukicevic <email@example.com>, public webgl <firstname.lastname@example.org>
- Dkim-signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=google.com; s=beta; t=1288982005; bh=xWuUg+Te/t3w/YhWYlM0PY9VvCs=; h=MIME-Version:In-Reply-To:References:Date:Message-ID:Subject:From: To:Cc:Content-Type:Content-Transfer-Encoding; b=Fe8UqMWfnIQBxgX4c9/ZJQDX504ik9St2fOzLK7IfkYLUm9Mto7gRq6PQtGiqMHgq VzKv5AagJ6eaQcnmfsQpw==
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=beta; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=oVLnVEGS6FMa1qOz3RjCJoF8tXyxVEADSpFuCCXb0A8=; b=v6WkK6/hmK26Gxy17x8XmwFIqdL1RTHvI8gp1VVE8NqzISlgC3/I/dQh5BR6IrEtco 1u2Uiwcly05J7kbaSW9Q==
- Domainkey-signature: a=rsa-sha1; c=nofws; d=google.com; s=beta; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=xpIvPJObhzZ5XJI+uTgx+SX2la7+hjJjVp1LIGalFUpms+WDiCoadErd/TdQpZG2Vn j/2JZTo303n1mCR1op0w==
- In-reply-to: <61DA5A47-6A72-48CF-B4F5-D3277BE22D79@apple.com>
- References: <AANLkTi=rKRNuWGwfD39h5d6Ttu55paWSq9qTNQ19xfC5@mail.gmail.com> <1561074246.1142.1285141436615.JavaMail.email@example.com> <AANLkTin2iu-V1LckEs_YJCUFgwRWX4rPvy+Z8MnaGy5c@mail.gmail.com> <27872E4C-B753-4DAC-8353-BFC3D74739D2@apple.com> <AANLkTim-i8j4LrzDrWyi_djdSxpg0-j5igvRhK9DNSMj@mail.gmail.com> <4C9D395A.firstname.lastname@example.org> <7ED78BBF-6DD3-45B1-978E-0FFDA5856695@apple.com> <AANLkTi=rFt3apXrfwfxtcF47nZS+fKDRCXMmPRUfd0Ja@mail.gmail.com> <29C16266-C657-4CB6-9B01-CFD9B2DD8A61@apple.com> <AANLkTimutLit_273e5pg1e3fg7n-uQyPK1ZxoZenBj59@mail.gmail.com> <AFA5AA20-36D7-4B85-95CA-2BB520C59DEC@apple.com> <AANLkTimi-Zgq62B7GEnYR72qR+kkMgFzagbX=4PWM0Rt@mail.gmail.com> <34C909B2-D7A1-4983-A79F-99D322F2AC17@apple.com> <AANLkTikr5ZDtydmyTn+OLqbuut6uquVW6PW+2tM_btmR@mail.gmail.com> <4CA50820.email@example.com> <AANLkTinPNy0UKgGffNF67xM_8qn9vvq_5M4wUbP3hBmg@mail.gmail.com> <AANLkTimN5UQY3+dFFQ_=NYr-bJbWUvaRZmiEssGN8y9P@mail.gmail.com> <AANLkTimw53MNKMSH=a=+Vu8ju+R-TiNb0Yij++c8qadA@mail.gmail.com> <61DA5A47-6A72-48CF-B4F5-D3277BE22D79@apple.com>
- Sender: firstname.lastname@example.org
On Fri, Nov 5, 2010 at 9:28 AM, Chris Marrin <email@example.com> wrote:
> On Nov 4, 2010, at 5:13 PM, Kenneth Russell wrote:
>>> If I have a 9 monitor setup and I stretch the window across all 9 1280x1024
>>> monitors and my max back buffer is 2048 then I get a 2048x128 backbuffer?
>>> That doesn't seem like the result I want. Most of the time I want the
>>> largest resolution I can get.
>>> If your app needs a 1.0 scale ratio then query the max backbuffer size and
>>> then set the size of the canvas appropriately. Only about 4 of the last 60
>>> 3d apps I've written would have needed this. Most of my apps in WebGL pick a
>>> fixed backbuffer size and let the canvas scale automatically.
>>> It seems like it's better to do the best thing for the majority of apps.
>>> Those few apps that need a 1.0 scale ratio can do what they need to force
>> I agree. The majority of the 3D applications and demos I've written
>> handled resizing the window to arbitrary sizes, and adjusted the
>> projection matrix as necessary.
> So you're saying you'd have to rewrite every one of those apps using getDrawingBufferScale() to get the correct results, right?
Actually, no -- for these apps I'd only need to use canvas.clientWidth
/ clientHeight. Non-square pixels wouldn't affect the behavior of the
> I still have not seen a proposal expressed in a clear and concise way. I think we all agree that we can't do this in a way that is completely transparent to the user. Does that mean we want to give the author no automatic behavior? I think giving the author partial help (e.g., "fixing" glViewport params) is worse than giving no help at all. And if we are to do non-square aspect ration changes to the drawing buffer, the we can't have a getDrawingBufferScale() call.
> So I'll make a simple proposal that upon creation of the drawing buffer we automatically resize dimensions that are too large to the maximum allowable width and height. For instance, a request for a 10,000 x 500 canvas on a machine that has a 2048 pixel dimension limit, we resize to 2048x500. I also propose that we don't change the viewport() call or any other call, we simply provide getCurrentWidth() and getCurrentHeight() calls, or the equivalent.
Agreed on all counts.
> The last question is whether or not there is a call that will tell the author the maximum dimensions of the drawing buffer. There is MAX_VIEWPORT_DIMS which will probably give the right answer. But I don't think there is any guarantee that the window system maximums are reflected in MAX_VIEWPORT_DIMS. So we should either clarify that this value will always give the right answer or create a new call to give the max dimensions.
I don't think this is feasible. In certain low memory situations I
could imagine that a WebGL implementation might not be able to
allocate a backing store texture of the maximum dimensions, or in fact
even know what the largest allocatable texture is at the moment
without actually trying the allocation since OpenGL ES doesn't have
Instead I think the spec should simply state that the dimensions of
the back buffer may be clamped to implementation dependent maximums.
The getDrawingBufferSize() API may be used to query the allocated size
of the drawing buffer.
> I think the above is sufficient. Most modern graphics cards have a 2k x 2k limit and it will not be very common that a browser user will size their window that big. When they do, the displayed image will not fill the canvas. But that's not a fatal problem.
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: