-
-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Shader API #34
Comments
Hey, @STREGA. Awesome project! Quick question... I'm very interested in GateEngine, but I'm only targeting Apple Silicon Macs. While GateEngine's shader API looks really useful for cross-platform projects, I'd naturally prefer to use platform-specific shaders (basically, Metal) for my usecase. Is that possible, and if so, how readily could I integrate my shaders into the rest of the engine? Edit: I'm not looking to replace the renderer wholesale, but might, for example, want to apply a custom filter to the engine's output. In which case, I'd need some way to tell the engine to render to a buffer I can use with the Metal API (instead of sending it to the display). That kind of thing. This is not a dealbreaker, but I'd be interested to know a bit more about it. |
@7ombie Hi 🙂 No, it's not possible to use your existing shaders. All shaders must be built with the GateEngine shader API. On macOS, if Metal is available, Metal is used for rendering and the shader API will generate Metal shaders. So everything is native if that's your concern. GateEngine does support render targets and you can use them as a texture and draw them with any shader you want. So you can create the effects you're talking about. Post processing will eventually get its own features in the renderer but it's just not a high priority at this phase of development. |
Hi, @STREGA. Thanks for taking the time. Much appreciated.
I was mainly concerned that the GateEngine API will always be more limited than Metal, so there's questionable benefit (in my case) to wrapping Metal with it. On the other hand, if the API's adequate for making games, and it all gets compiled to the same thing in the end, not having Metal is not the end of the World. I might even prefer the pure-Swift approach. To be honest, I've been learning Metal recently, so I just kinda wanted to use it. The technical concern was more of a rationalization after the fact. Being able to use Swift is much more important to me. I think I just need to make a little game with GateEngine, and see how it goes. Thanks again, @STREGA. |
Rework Shader API for public consumption.
Use a result builder for shader constructionMutableXXXXXShader
type variant as these won't be cacheable.The text was updated successfully, but these errors were encountered: