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

Re: [Public WebGL] Premultiplied alpha blending and issues with color accuracy




On 5/11/2012 10:46 AM, Florian Bösch wrote:
On Fri, May 11, 2012 at 10:39 AM, Thor Harald Johansen <thj@thj.no
<mailto:thj@thj.no>> wrote:

    Simultaneously? In a single shader? AFAIK, WebGL only allows one active
    texture per drawing operation.

You can only write to one texture at a time. You can read from many
textures. If you look at http://webglstats.com/ you can see that most
desktops (99.9%) can read from 16 textures, and most mobiles (100%) can
read from 8.

Thanks for that link. Didn't know about that website!

And okay, from your and Ben's comments, it seems I'm going to have to look more carefully at how multi-texturing actually works. All the examples I found were doing things like switching textures for each side of a cube, etc. None demonstrated blending of multiple textures. I find API references to be really hard to learn from. :/

So okay, texture ping-pong and multi-texturing are both promising avenues. I might write a shader that takes 8 texture units and blends them together to the main frame buffer, and enforce a limit of 8 layers in the user interface. From practical experience, people rarely use more than perhaps 5 layers anyway.

Thor

-----------------------------------------------------------
You are currently subscribed to public_webgl@khronos.org.
To unsubscribe, send an email to majordomo@khronos.org with
the following command in the body of your email:
unsubscribe public_webgl
-----------------------------------------------------------