bbc / VideoContext

An experimental HTML5 & WebGL video composition and rendering API.
http://bbc.github.io/VideoContext/
Apache License 2.0
1.33k stars 157 forks source link

Effect definitions scruture refactor #105

Closed germain-gg closed 5 years ago

germain-gg commented 6 years ago

Hi,

Sorry this is a pretty hefty PR, however it is mostly copy and pasted code.

I had quite a lot of problems to read the different shaders because they were embedded in a JavaScript string.

This PR create a private module for every effect and externalise the fragments and the vertices to external files (yay syntax highlighting!)

It also uses a webpack raw-loader to be able to load those files, and uses a mock JavaScript module when running the unit tests https://jestjs.io/docs/en/webpack

I'll probably do a bit more testing but I'd like to hear your thoughts on this.

Thank you,

PTaylour commented 6 years ago

Very cool! What sort of testing were you thinking of?

germain-gg commented 6 years ago

Since this was mainly a manual process I just want to double check that I haven't forgotten or miscopied anything.

Besides that I would say that those changes are pretty safe as everything is meant to work exactly the same

On Fri, 14 Sep 2018, 17:52 Pete Taylour, notifications@github.com wrote:

Very cool! What sort of testing were you thinking of?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/bbc/VideoContext/pull/105#issuecomment-421419252, or mute the thread https://github.com/notifications/unsubscribe-auth/AAu_T7TZai-KBbFmz6U6Jkf79OdeHy1Oks5ua964gaJpZM4Wpl4n .

PTaylour commented 5 years ago

Are you happy with this being merged now? All the current tests are happy

germain-gg commented 5 years ago

Yup, I believe it is all good to go! Thank you for taking the time to get those ready