Skip to content
This repository has been archived by the owner on Nov 28, 2024. It is now read-only.

User Level Shaders #183

Open
Bombfuse opened this issue Aug 10, 2022 · 3 comments
Open

User Level Shaders #183

Bombfuse opened this issue Aug 10, 2022 · 3 comments
Labels
enhancement New feature or request portability A key bug/enhancement for porting to a platform

Comments

@Bombfuse
Copy link
Owner

After discussion on the rust gamedev discord, it sounds like WGSL is the best user-facing shader language to use.

I think we should use naga as middleware to convert the users WGSL to Emerald's current shader langauge (GLSL).

@Bombfuse Bombfuse added enhancement New feature or request portability A key bug/enhancement for porting to a platform labels Aug 10, 2022
@ThatOneBro
Copy link

ThatOneBro commented Aug 13, 2022

From a pure design perspective I think WGSL is nice. It feels almost Rust-like, which is cool.

However I was hesitant to say whether WGSL would be the best choice or not, given many publicly available shaders have already been written in GLSL and HLSL and WGSL being so new... But considering the Rust gamedev community being pioneered by Bevy and their using WebGPU, I think WGSL may be a good choice, especially given the work naga has done to make sure there is a translation between the 3 and SPIR-V. WebGPU will (hopefully) be a powerful cross-platform standard soon, so if WebGPU ever becomes widely available, it should be less work for projects using emerald to upgrade to the theoretical wgpu version of emerald if we adopt WGSL now.

Overall I think WGSL is probably the way to go.

@Bombfuse
Copy link
Owner Author

Yah I agree, I think WGSL is the way to go as well. I need to start working on prototyping it for user level shaders. Also need to consider how shaders are used by the user.

Do we add a shader to a sprite? Do we let the user run a shader on the final screen texture? I think those 2 should be enough for most shader use cases

@ThatOneBro
Copy link

Yeah I think both of those cases should cover most things in 2D. I was thinking about a bunch of other stuff but it really only applies to 3D. I haven't done much complex shader work in 2D, so from my limited perspective those 2 things should be a good baseline.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request portability A key bug/enhancement for porting to a platform
Projects
None yet
Development

No branches or pull requests

2 participants