Comments (7)
Another option is using TemplateHaskell to read in the shaders as bytestrings at compile time - I've tried that before and it's not as friendly to updating as the other two methods.
from diagrams-opengl.
I've been meaning to switch over to TH, as I do in https://github.com/bergey/haskell-OpenGL-examples/blob/master/wikibook/tutorial-05-3D/TH.hs I figured that would make the shaders more pleasant to read & edit, but you're right that they shouldn't change often. Can you say more about to downsides to the TH method?
from diagrams-opengl.
This may be due to my noobness but what I found was that when I edited a shader the changes would not be integrated into the compiled project unless I deleted the intermediate file that ghc (or cabal, I'm not sure) produces containing the spliced TH code. Making edits to the shaders was therefore always a two step process. Since my motivation for separating the shaders from Haskell was just for syntax coloring I switched back.
from diagrams-opengl.
Though if the shaders are static then TH would be great.
from diagrams-opengl.
We agree that we should inline the shaders, either using TH or directly. The intermediate file issue you describe sounds really annoying, but I can't reproduce it. Could you try out the shader-th
branch I just pushed?
I tested like this, and the shader change was picked up:
cabal install
ghcsandbox examples/curves # alias for sandbox-aware ghc
./examples/curves
# edit shader, make all fragments red
cabal install
ghcsandbox examples/curves
./examples/curves
from diagrams-opengl.
Confirmed working - I also couldn't recreate what I was talking about. It must have been something special in my build process. 👍
from diagrams-opengl.
Great. Thank you.
from diagrams-opengl.
Related Issues (13)
- crashes on large input
- Integrate with larger GUI programs HOT 1
- Update to use RTree instead of list of Prims
- Build failure on Fedora 20 HOT 6
- Update to work HOT 2
- layering of overlapping trails HOT 1
- Edge cases of clipping HOT 1
- Text rendering
- install instructions HOT 1
- camera position
- NURBS sphere
- Translate 2D backend for new open / closed Paths / Trails
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from diagrams-opengl.