question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

New Feature: Add support for shader imports

See original GitHub issue

Hi 👋

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:closed
  • Created a year ago
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
DiogoNevescommented, Sep 20, 2022

I thank you for letting me contribute 😅 glad it was ok

1reaction
RaananWcommented, Sep 20, 2022

Thanks again 😃

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found