Coder Social home page Coder Social logo

jshrake / grimoire-legacy Goto Github PK

View Code? Open in Web Editor NEW
123.0 6.0 7.0 8.98 MB

A cross-platform live-coding tool for creative coding with GLSL shaders

License: Apache License 2.0

Rust 99.80% GLSL 0.15% Shell 0.05%
shadertoy glsl rust graphics creative-coding opengl demoscene live-coding windows macos

grimoire-legacy's People

Contributors

bors[bot] avatar elenzil avatar jshrake avatar sdroege avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

grimoire-legacy's Issues

Add support for Weighted, Blended Order-Independent Transparency

Resources:

If my understanding of the technique is correct, the only features we need to implement in order to support this feature are:

  • Allow clearing individual color attachments
  • Allow users to configure the blend state for each color attachment
  • Add a flag to disable depth writes (glDepthMask?)

Make SRGB framebuffer configurable

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

Document latest features

I've landed several new features that need documentation:

  • restart-on-save
  • pass loop (draw a single pass multiple times per frame -- really useful for reaction-diffusion sims!)
  • geometry shaders
  • separable blend states
  • --record

Make interface for live updating uniform values

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].

add boolean preprocessor symbol GRIMOIRE or similar

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.

Document using the F{1,2,3,4} keys for playing, pausing, stepping, and restarting playback

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.

consider reading JSON from shadertoy shader 'download'.

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.

Consider adding support for geometry shaders

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.

Audio resources don't match Shadertoy

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:

  • Shadertoy seems to be using the default properties of the AnalyserNode (-100 max dB, -30 min dB, 2048 for the fftSize (and the frequencyBinCount is half that, so 1024. However the resulting texture described by shadertoy documentation has only 512 width! confusion!)
  • The spectrum plugin only produces the frequency data. The wave data has to be acquired through a different code path. (See audio.rs for more details).
  • The spectrum plugin does not do any smoothing.

--fps option has no effect

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.

Support image recording

Consider adding a --record command-line flag that captures each frame as an image (png?) to a timestamped directory.

Update README with fresh examples

  • Existing example gifs link to outdated content
  • Add some cool multi-pass examples
  • Add more vertex shader examples
  • Add an example using the kinect
  • Add a few of my instagram posts as examples
  • Add gifs for all of these that link to the code

Consider migrating from SDL2 to winit

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.

video example no longer runs

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.