Comments (6)
sweet! .. but causes an "unknown error" on shadertoy, even bracketed by #if 0.
#include <any_file.glsl>
also works in grimoire and also works in shadertoy when bracketed by #if 0.
from grimoire-legacy.
This is a good feature request!
if i were doing it, i'd probably just literally prepend the line #define GRIMOIRE to the front of each shader file, but that seems hackish.
I think that's fine as it produces something fairly simple that's easy to document. I like it.
an alternative approach might be to implement something similar to Shadertoy's common tab, but only functional in grimoire. eg grim_common.glsl.
You can currently #include "any_file_you_want.glsl"
, but you would need to take into account how this would impact your ability to port the code over to shadertoy :) The path is relative to the grim.toml
file.
then one could add whatever #defines one pleased in there. however with a view to establishing a consistent way stuff is done, i'd probably opt for the other approach first.
One feature I've considered is allowing users to specify a set of preprocessor symbols in the pass configuration. This could be useful for reusing the same shader in different ways across multiple passes.
from grimoire-legacy.
I think that's fine
cool!
#include "any_file.glsl"
sweet! .. but causes an "unknown error" on shadertoy,
even bracketed by#if 0
. example
allowing users to specify a set of preprocessor symbols in the pass configuration
yeah, that could definitely be useful.
i think i'd still consider forcing something for grimoire in there,
just to get folks on the same page w/r/t the symbol, versus making up our own "using_grimoire" "env_grimoire", etc.
from grimoire-legacy.
so it does, great!
from grimoire-legacy.
Closed by #62. @elenzil, you should now be able to use #ifdef GRIMOIRE
in your shader code on HEAD of master.
One feature I've considered is allowing users to specify a set of preprocessor symbols in the pass configuration. This could be useful for reusing the same shader in different ways across multiple passes.
I'm tracking this in #64
from grimoire-legacy.
woohoo, this is great!
from grimoire-legacy.
Related Issues (20)
- add command-line option to position window HOT 3
- consider adding [an option to] print a message at the start of each recompile. HOT 4
- Consider renaming the "audio" resource to "sound" HOT 2
- Consider adding support for geometry shaders
- Document using the F{1,2,3,4} keys for playing, pausing, stepping, and restarting playback
- Make SRGB framebuffer configurable
- Support clearing only the depth buffer
- Support drawing a pass multiple times HOT 1
- --fps option has no effect HOT 3
- Document latest features HOT 1
- Support specifying preprocessor #defines in the pass configuration
- Build and run on the NVIDIA Jetson Nano
- Consider writing a rendy or wgpu-rs backend
- Support image recording
- consider reading JSON from shadertoy shader 'download'. HOT 1
- Add support for instanced rendering OBJ models HOT 1
- Add support for compute shaders
- video example no longer runs
- shadertoy-microphone example looks wrong
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 grimoire-legacy.