Giter Site home page Giter Site logo

Comments (6)

jshrake avatar jshrake commented on June 1, 2024 1

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.

jshrake avatar jshrake commented on June 1, 2024

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.

elenzil avatar elenzil commented on June 1, 2024

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.

elenzil avatar elenzil commented on June 1, 2024

so it does, great!

from grimoire-legacy.

jshrake avatar jshrake commented on June 1, 2024

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.

elenzil avatar elenzil commented on June 1, 2024

woohoo, this is great!

from grimoire-legacy.

Related Issues (20)

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.