Shader parsing error ? Future improvment ?
Shri

Gio,

To write more complex shaders, a lot of the examples I see on the web use function inside the shader. For example:

/* shader code */

float offset(float p) {
    return p 10.0;
}

// rest of shader code here

It seems like this would be acceptable since in wade you are just passing a sting. Howerver, when I try it, I get the following error:

An error occurred compiling a pixel shader: ERROR: 0:8: '{' : syntax error

I didn't look at the source code to see how it is doing the parsing, and I am still using wade 3.0, so I don't know if this change has already been made. But it seems like you should have the ability to define functions in you shader strings.

cheers,

Shri

1 Comment
foxcode

Hi Shri.

I asked about this myself and funcitons are not supported, though I can't give you a good reason why. If you are desperate you could try the none wade solution and get the context for whatever it is you are drawing and try to add a shader with pure webgl. I'm not sure how this would work. Will try to find out from the boss man if functions will ever be supported in the future

Post a reply
Add Attachment
Submit Reply
Login to Reply