play-co / webgl-2d

Canvas2D API in WebGL
http://weare.buildingsky.net
MIT License
519 stars 116 forks source link

Resolve rendering issue where screen turns white after first frame #29

Open sinisterchipmunk opened 12 years ago

sinisterchipmunk commented 12 years ago

I don't know how common or widespread this issue is; I found out about it via a SO question. But, it can be duplicated on my own hardware, so I fixed it.

The color mask (1, 1, 1, 0) seems to be the source of the issue, but I don't particularly understand why. Simply removing the color mask seems to have no ill effect, so that's all this pull request does.

This pull request also includes an example file which reproduces the effect, and which works properly after applying the change.

jamesamcl commented 12 years ago

Thanks, this fixed the white screen issue for me. I've merged it into my own fork (along with the other pull requests) since this has been inactive for a year now.

x3ro commented 12 years ago

@udp You also seem to have deleted your fork afterwards ò.O

jamesamcl commented 12 years ago

Sorry about that. My original plan was to fork and maintain this so we could use it for our project, but my team decided not to use webgl-2d in the end.

appsforartists commented 11 years ago

I just tried webgl-2d in an app I've been working on using 2D canvas. I was also getting a white canvas, and @sinisterchipmunk's version fixed it for me. Considering the date of the last commit to this library, I think your version may now be the canonical one.

The homepage link to in the README isn't even online anymore.

kangax commented 11 years ago

@appsforartists Yeah, it's a shame. Such nice idea and dead.

One of the creators confirmed — https://twitter.com/kangax/status/281834824229089280

Wish someone continued the effort.

lekzd commented 8 years ago

It is so stupid idea to remove one string code and don't check all tests

gl.colorMask(1, 1, 1, 0); - works good for colored primitives with alpha channel and removes images gl.colorMask(1, 1, 1, 1); - works good for images and broken alpha channel for primitives