unconed / MathBox.js

MathBox is a (work in progress) library for making presentation-quality math diagrams in WebGL.
MIT License
1.94k stars 127 forks source link

Shaders broken on chromium #29

Closed flying-sheep closed 10 years ago

flying-sheep commented 10 years ago

With chromium 34, firefox works, but chromium looks ugly and flickers:

Firefox:

mathbox-ff

Chromium (the flicker is of course seizure-inducingly fast in reality):

② WebGL: INVALID_OPERATION: getAttribLocation: program not linked  (index):1
⑧ WebGL: INVALID_OPERATION: getUniformLocation: program not linked   (index):1

mathbox-chrome

unconed commented 10 years ago

This is a z-sorting issue. Apply z indices to lock the drawing order.

flying-sheep commented 10 years ago

Eh, shouldn't they be sorted by camera distance?

And if they shouldn't by default, how to enable that?

unconed commented 10 years ago

Transparent surfaces are drawn in the order they are defined, MathBox doesn't sort them for you (as that would be slow and require JS-side transformations). I'm exploring order-independent transparency for MB2, but it's not a trivial issue.

jasongrout commented 10 years ago

Order-independent transparency? I've been struggling with that in three.js lately in our pythreejs project. If you have a minute, I'd love to hear your general approach or thoughts on the matter.

unconed commented 10 years ago

This seems interesting: http://jcgt.org/published/0002/02/09/