tmp-demo / tde.js

JS demo engine.
2 stars 0 forks source link

Avoid referring to assets by string names in the generated code. #11

Open nical opened 9 years ago

nical commented 9 years ago

They currently don't get minified. It's easy to replace strings like

"tex_foo"

by

textures.tex_foo

in the export.

wsmind commented 9 years ago

Some of these are referenced from glsl, which makes it a bit harder than just removing the quotes ;)

I had some code on FuckJS though that did just that: another minification pass for both js & glsl, but it's kinda risky/buggy so it's been disabled for the moment.

nical commented 9 years ago

Only uniform names are referenced from glsl. If anything else it's a bug.

nical commented 9 years ago

I took care of textures and geometries, shaders are next.

wsmind commented 9 years ago

Also, didn't we introduce names for hot reload in the editor?

nical commented 9 years ago

It doesn't matter for the editor because names aren't minified, so we can hot releoad assets using string keys if we want.

wsmind commented 9 years ago

I think it did matter, but I can't remember exactly the problem... we should look at the git history ^^

2015-07-08 14:29 GMT+02:00 Nicolas Silva notifications@github.com:

It doesn't matter for the editor because names aren't minified, so we can hot releoad assets using string keys if we want.

— Reply to this email directly or view it on GitHub https://github.com/tmp-demo/tde.js/issues/11#issuecomment-119558585.