javascript - How to console.log in webgl shaders? -
i'm trying understand how simulate console.log in webgl shaders written in glsl. it's easy error messages can't how print custom messages.
basically want print stuff in browser's console:
<script id="shader-fs1" type="x-shader/x-fragment"> void main(void) { //console.log doesn't work here since it's glsl not javascript gl_fragcolor = vec4(0.0, 0.0, 0.0, 1.0); } </script>
any suggestions?
not sure if possible, may want check out the webgl inspector library debugging purposes.
Comments
Post a Comment