Loading in WebGL Shaders

InstructorKeith Peters

Share this video with your friends

Send Tweet

In this lesson we look at a better way of writing WebGL shaders - loading them in from script tags rather than concatenating JavaScript strings.

~ 4 years ago

Hi, why are script tags better? Is there a way to just have the shaders in a separate file, like *.shader or something? if you use ` (backtick) then you can write an entire code-block and don't need to concatenate strings line-by-line. Are script tags still better than that?

It still works, but the code you reference from the WebGL docs doesn't seem to be in those docs anymore. Is it okay to progress without using HTML script tags?