unconed / mathbox

Presentation-quality WebGL math graphing
MIT License
1.33k stars 109 forks source link

Cc/fix dark surfaces #26

Closed ChristopherChudzicki closed 2 years ago

ChristopherChudzicki commented 2 years ago

What are the relevant tickets? #25

Note that #25 mentions two issues: dark surfaces and black gridlines. This addresses the dark surfaces, NOT the gridlines. I believe I understand how to fix that, too, but want to write some js tests for it.

What does this PR do?

This PR replaces existing usage of gl_FrontFacing with a cross-product workaround; gl_FrontFacing seems not to be behaving how mathbox expected.

How should this be manually tested

  1. On this branch, npm run build
  2. Open examples/test/surface.html. Change the mathbox line to <script type="text/javascript" src="../../build/bundle/mathbox.js"></script> to use local build
  3. Optionally, comment out the lineX and lineY bits at end of surface.html. The affect is more proncounced without the gridlines

Master / This branch Screen Shot 2022-04-10 at 10 40 46 PM / Screen Shot 2022-04-10 at 10 40 17 PM

sritchie commented 2 years ago

Just a couple of comments. Excellent work!