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

Uniform support for other types than textures #59

Open
dom1817 opened this issue Oct 18, 2019 · 0 comments
Open

Uniform support for other types than textures #59

dom1817 opened this issue Oct 18, 2019 · 0 comments

Comments

@dom1817
Copy link

dom1817 commented Oct 18, 2019

I'm using glsl-viewer to develop shaders that are then loaded in a different programming environment. The idea of passing textures using comments is very useful and I think it would be nice to be able to also set float and vec uniforms in comments.

uniform float frequency; // 20.0
uniform vec2 size; // 800.0 600.0 
uniform vec3 color; // 1.0 0.0 1.0

It shouldn't be be too hard to copy the texture function and make it work with other uniforms:

// Match floats
re = /^\s*uniform\s+float\s+(\S+)\s*;\s*\/\/\s*(\S+)\s\s*$/gm;

// Match vec2s
re = /^\s*uniform\s+vec2\s+(\S+)\s*;\s*\/\/\s*(\S+)\s(\S+)\s*$/gm;

// Match vec3s
re = /^\s*uniform\s+vec3\s+(\S+)\s*;\s*\/\/\s*(\S+)\s(\S+)\s(\S+)\s*$/gm;
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant