Hacker News new | past | comments | ask | show | jobs | submit login

I thank you from the bottom of my heart. This drove me crazy when playing around with WebGL and shaders, because for various reasons I didn't want to put those in separate files.



Why aren't you just doing this, for example?

        <script id="fragment" type="x-shader">
	precision highp float;
	uniform vec3 glyphColor;
	void main() {
	        gl_FragColor = vec4(glyphColor, 1.0);
	}
	</script>


Because you can't do that from within javascript, and my HTML was really just a stub to load all the javascript I didn't want to have to otherwise deal with.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: