jshrake / grimoire-legacy Goto Github PK
View Code? Open in Web Editor NEWA cross-platform live-coding tool for creative coding with GLSL shaders
License: Apache License 2.0
A cross-platform live-coding tool for creative coding with GLSL shaders
License: Apache License 2.0
Specifying a relative filesystem path for audio & video resources is broken on windows
Resources:
If my understanding of the technique is correct, the only features we need to implement in order to support this feature are:
I keep manually commenting and uncommenting glEnable(GL_FRAMEBUFFER_SRGB)
to match various source material. Make it a configurable option, either at the command-line or in grim.toml. Of note, I believe at one point I disabled it to match source material on shadertoy, and then enabled it to match source imagery from http://jcgt.org/published/0002/02/09/paper.pdf while working on https://github.com/jshrake/grimoire/issues/34. I'm once again disabling it while working on #21
I've landed several new features that need documentation:
I would like to have a IMGUI-like interface for updating generative parameters (uniform values). This interface does not have to be rendered in the same application and instead could be a web page that communicates with the application over [insert technology here].
currently shaders can be copy-and-pasted from the grimoire environment right into ShaderToy (yay!) with the minor modification of removing the statements defining fragColor and main() which appear at the bottom. eg the 'new' example.
however, if Grimoire injected something like #define GRIMOIRE
before sending the shader code off for compilation, then that minor step of removing those lines could be eliminated.
ie the code would become
#ifdef GRIMOIRE
out vec4 fragColor;
void main() { mainImage(fragColor, gl_FragCoord.xy); }
#endif
i'm note sure what the actual best symbol would be, eg if there's already precedent for something like ENVIRONMENT_GRIMOIRE etc, nor the best way of injecting such a symbol. 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.
an alternative approach might be to implement something similar to Shadertoy's common tab, but only functional in grimoire. eg grim_common.glsl. 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.
This already works, just needs documenting in the appropriate place!
F1: Toggles play/pause
F2: Steps back one frame
F3: Steps forward one frame
F4: Restarts playback (iTime -> 0)
Note that toggling play/pause and restarting playback (F1 and F4) work correctly with audio/video resources. However, F2 and F3 (frame stepping) do not work as expected with audio/video resources.
i think the ability to 'download all shaders' is something new at shadertoy. it gives you a JSON file of all your shaders. it would be neat if a single entry in those could be read. hm, actually perhaps that's less of a feature for grimoire itself and more like a companion tool.
As suggested in #9
Reproduce by running https://github.com/jshrake/grimoire-examples/blob/master/multi-pass-feedback.glsl and resizing the window. You can resolve the issue by restarting shader playback (press F4) after resizing.
My immediate use case is to generate surface normals in the geometry shader when doing procedural modeling in the vertex shader. ATM, I'm generating the surface normals in the vertex shader which is awkward and likely bad for performance as the triangle count scales.
Running the microphone, audio, or tuner examples side-by-side with the shadertoy equivalents produces slightly different results. This is likely due to my own misunderstanding of audio and inexperience with the gstreamer API. The high-level goal is to produce the same values from the AnalyserNode Web API with gstreamer and the spectrum plugin.
A few notes:
Users would no longer be required to install the gstreamer dependencies if they do not intend to use video, audio, microphone, webcam, or pipeline resources.
Currently users can specify the width and height in pixels of a framebuffer resource. It would be nice if they could instead specify a scale parameter relative to the window size.
Currently, the buffer format is hardcoded to RGBA. User should be able to specify 1, 2, 3, or 4 components. RGBA (4 components) by default is fine.
not sure where the bug got introduced,
but in version 0.2.1, hash 7a91982,
on macOS, the --fps option seems to have no effect.
at least, low values such as --fps 2
are rendering way faster than 2 fps.
eg "gravity" or something simpler like Position.
this would help me a lot when quitting and restarting Grimoire frequently.
when saving changes to source,
it's sometimes nice to see positive confirmation that compilation succeeded.
Is it possible to get below 1 MB? 64k? 4k? Without gstreamer, file watching? No std? A man can dream!
We should be able to draw a pass multiple times in a row (w/ feedback) by specifying something like loop = N
in the config.
autovideosrc is not an element on windows. The webcam on window uses the ksvideosrc element.
Consider adding a --record
command-line flag that captures each frame as an image (png?) to a timestamped directory.
gleam is intended for internal use by servo. Instead, consider depending on https://github.com/brendanzab/gl-rs
need to think through this some more
Just got one of these https://developer.nvidia.com/embedded/buy/jetson-nano-devkit in the mail! weeeee!
See rust-lang-deprecated/failure#287 for a discussion on the future of the failure crate.
I type sound every time and it never works. I think it's a sign.
Currently, we can clear the color buffer, or the color buffer and the depth buffer, but not just the depth buffer. Make it so!
winit is a window handling library in pure Rust. Ideally grimoire would only depend on pure rust crates. Note that ggez is making a similar migration ggez/ggez#391
I would like to understand how this would impact the ability to get grimoire running on mobile (iOS, Android), web (emscripten), and various VR/AR platforms.
thread 'main' panicked at 'Could not canonicalize file name: Os { code: 123, kind: Other, message: "The filename, directory name, or volume label syntax is incorrect." }', src\libcore\result.rs:1165:5
Port https://github.com/jshrake/grimoire-examples/blob/master/kinect2-depth.glsl and make sure it still works
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.