WebGL JS extension

I made some WebGL extension blocks since it seemed like an interesting project. I have basic GL functions, enough to make a demo of a spinning textured quad with a shader-based whirl effect. It uses codification to create shader code.
Snap! gltest1 (berkeley.edu)

I could make it a cube but I'm too lazy to write out all the mesh data for it. As always.

There are also several matrix helper blocks. The matrix multiplication and invert blocks are written in JavaScript, but every other matrix block isn't.

I'm not sure if this belongs in share your projects. Should i put this in advanced topics > mods & extensions?

Project doesn't work for me

Oh. Turn on retina display support in settings. I had to use some hacks so that Snap! wouldn't crash whenever I set the canvas size with a retina display.

How do I?

Shift-click the settings button. Probably should have clarified that earlier...

I still can't see it. Either I'm blind or it's not an option.

Maybe it doesn't show up for users who don't need it. If this doesn't work I guess I'll have to make support non-retina screens sooner.

Yep -I don't have Retina display support option showing

Retina Display Support? Question mar-

Oh :(


Ok I'll try updating it to support non-retina displays. I don't think it'll be too hard probably all I gotta do is not use the hack.

I updated it. I don't know how to test it without retina support so I'm just gonna hope it works for you.

Nice. Although I read your message as saying that only two blocks use JS, but you meant only two matrix blocks do.

By the way, there's an official right way to make an identity matrix:

PS Does using WebGL mean that it's running on my graphics processor?

Now that I realize that, I should make my message more clearer.

Neat. I'll update the block to that the next time I update this project. I remember I made 2 other different ways of creating an identity matrix because I would always forget. For a 4x4 matrix, one was creating a 5-item list with the first item 1 and the rest as 0, except I did that by using map and checking if index = 1, then converting the boolean result to a number. Another one was in my celestial bodies project, where it creating a 4x4 matrix filled with zeros, and using a for loop to set items [1][1], [2][2], [3][3], and [4][4] to 1.

Running WebGL does indeed mean code is being ran on your graphics processor.

Set window scale != 100% then the "Retina ..." switch appears.
With "glCanvas._bak" checks it now works even without switch.

Works fine now for me :slight_smile: