Setting Up WebGL

Share this video with your friends

Send Tweet

In this lesson we cover setting up WebGL for use, including creating a canvas, getting the WebGL rendering context and clearing the canvas to a particular color.

Kristian Mørch
Kristian Mørch
~ 8 years ago

For some reason, a lot of GPUs is blacklisted in latest chrome, so you may need to go to chrome://flags/ and enable #ignore-gpu-blacklist

Harpreet Singh
Harpreet Singh
~ 6 years ago

Hello,

Enjoying so far! Thank you for creating this course.

I have a question about the rgba. My question is if webgl use 0 - 1 for each color then how do we figure out say what is 255 converted to 0 - 1? Or say 155 converted to 0 - 1? How do we find this out?

Thank you.

~ 5 years ago

I have a question about the rgba. My question is if webgl use 0 - 1 for each color then how do we figure out say what is 255 converted to 0 - 1? Or say 155 converted to 0 - 1? How do we find this out?

Hi. Let's say you found a colour which was 189 red. You can just use division to get it in fraction form. 189/255=0.74

But there are also lots of converters online for RGB to RGB255 to Hex etc