Open danielchasehooper opened 12 months ago
hi @danielchasehooper! For context we use .frag
or .fs
to distinguish fragment shaders from vertex shader (.vert
or .vs
). Files with .glsl
extensions are a bit ambiguous, that's why usually you see them when they are part of libraries like on https://lygia.xyz.
Solution, you could create file pairs that include the .glsl
counter part. For example:
shader.glsl
uniform vec2 u_resolution;
uniform float u_time;
void main() {
vec4 color = vec4(0.0,0.0,0.0,1.0);
vec2 uv = gl_FragCoord.xy/u_resolution;
...
gl_FragColor = color;
}
shader.frag
#include "shader.glsl"
This way:
.glsl
file.frag
pairs can be easily generated programaticallywe don't use the glsl
extension, #include
doesn't seem to work if the file doesn't have a glsl extension
It'd be useful if glslviewer had something like a --frag
param so that you can launch it like so:
glslviewer --frag shaderFileName
and it works with any extension.
we have some existing shaders in our repo that don't have the
.frag
extension that we would like to view in glslviewer, is there a way to launch it from the command line withoutcp
ing to a tmp file with the .frag extension? When you do this you don't get hot reloading for the original file