patriciogonzalezvivo / thebookofshaders

Step-by-step guide through the abstract and complex universe of Fragment Shaders.
http://TheBookOfShaders.com
Other
5.97k stars 680 forks source link

OSX: book export is broken #334

Closed xeonarno closed 2 years ago

xeonarno commented 3 years ago

On osx, when I follow the tutorial to generate book (pdf...), It failed :

`$ make

rm -rf */tmp.md
rm -rf */tmp*.png
rm -rf book.*
python2.7 src/parseBook.py  -f tex -f pdf -f epub
glslViewer ./02/hello_world.frag --s 0.5 --headless -o ./02/tmp-hello_world.png
Error watching for file 0.5
Error watching for file ./02/tmp-hello_world.png

Also python 2.7 is dead on homebrew :(

System info : MacBook Pro (13-inch, 2018, Four Thunderbolt 3 Ports) 10.15.7

NSLog0 commented 3 years ago

I'm facing this too. Did you solve it?

xeonarno commented 3 years ago

No, It require to rewrite and build with Python 3.9 :(

hatkidchan commented 3 years ago

Issue persists on Linux too, but I managed to fix it somehow: In file src/parseBook.py change line 46 to "--headless -E screenshot," + shaderImage In file Makefile replace all python2.7 with python3 (works for now). Maybe I should make PR with that fixes? :thinking:

blablaalb commented 3 years ago

I faced the same error and managed to resolve it. Since all the needed images are already included in the repository we no longer need glslViewer to render them. In fact even after installing the glslViewer it won't render those shaders to image files, I don't know why. I managed to compile the book by commenting out lines in the parseBook.py from line 44 to line 49. If you face error [WARNING] Could not fetch resource './04/glslEditor-01-0.png': replacing image with description make sure you have installed imagemagick package. On Ubuntu I installed it with sudo apt install imagemagick-6.q16.