Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only 4 additional uniforms possible?? #31

Open
GabZach opened this issue Jun 9, 2021 · 1 comment
Open

Only 4 additional uniforms possible?? #31

GabZach opened this issue Jun 9, 2021 · 1 comment

Comments

@GabZach
Copy link

GabZach commented Jun 9, 2021

I have written a simple shader to render simple bricks.
It works, but ...

It seems to me that shaderFrog has a limit on the number of uniforms (besides the predefined ones),
and that limit seems to be 4!
Is that true?

You can find my shader here: https://shaderfrog.com/app/view/5292

It works only because I am hard-coding some of the values of the uniforms at the beginning of main.
But no matter how I order the uniforms at the beginning of the source, I only ever see 4 uniforms in the uniform editor below the source!

Is that ShaderFrog or am I making a mistake?

@AndrewRayCode
Copy link
Owner

(Long delayed response, I haven't checked this repo in a long time)

This looks like a bug with the core parser, where it doesn't correctly find the names of uniforms if multiple uniforms are declared on the same line, eg

uniform vec3 BrickColor,
             MortarColor;

The parser will incorrectly detect one uniform here. A quick fix around this bug is breaking them out into individual lines:

uniform vec3 BrickColor,
uniform vec3 MortarColor;

I have written an entirely new GLSL compiler and I'm working on a new Shaderfrog prototype. You can follow my progress if you want. The current ShaderFrog engine is basically deprecated, lots of bugs and not built on solid tech.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants