New Feature: Add support for shader imports
See original GitHub issueHi 👋
Apologies if this is already supported and I missed it!
Do you think it would be worth adding support for shader code imports?
I’m happy to do it with some support on getting it with the right structure.
In my project I:
Created a folder in src/glsl
for the shaders.
Currently each effect is a subfolder and includes the vertex and fragment shaders if necessary (e.g. src/glsl/effect/vertex.glsl
).
Added this to the webpack.common.js
config:
{
test: /\.(glsl|vs|fs)$/,
loader: 'ts-shader-loader',
exclude: /node_modules/,
},
Still had to add the glsl.d.ts
file to the src/glsl
folder, containing:
declare module '*.glsl' {
const value: string;
export default value;
}
Let me know what you think
Issue Analytics
- State:
- Created a year ago
- Comments:8 (8 by maintainers)
Top Results From Across the Web
Add support for sharing and preprocessing shader code ...
Everytime I add a new kind of shader, or a variation of one (with less uniforms for example, or a different usage), I...
Read more >Compute shader multi_compile support - Unity Forum
This new feature brings the keyword based variant management, used in regular shaders, to the compute shaders too. New shader syntax
Read more >Manual: Targeting shader models and GPU features in HLSL
If your shader defines certain shader stages, Unity automatically adds items to the list of requirements. If a shader defines a geometry stage...
Read more >Excellent Shader Editor Free & Open Source - YouTube
The new plugins include a new Godot shader language support as well as a tool for importing ShaderToy shaders easily.
Read more >Introduction to Shaders: First steps (Basic Geometry)
Now we import the PyOpenGL functionality we'll be using. ... part of Core OpenGL, but some drivers will not support the "core" versions...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I thank you for letting me contribute 😅 glad it was ok
Thanks again 😃