hi,guy.
There is a problem with pixel shaders.
I code extern number time,
I called the function shader: send (“time”,x) to send the value.
error:
a common error is not define but not use the variable.
why?
A Shader Que.
Re: A Shader Que.
You never used the variable in the code so it got pruned away during shader compilation. After that, you're trying to use it but it doesn't exist.
Re: A Shader Que.
You have to actually use the variable in the shader. Not just declare it. It has to be referenced somewhere in the shader code, or else the shader compiler will remove it.
Please use the Support subforum for future help requests.
Please use the Support subforum for future help requests.
Re: A Shader Que.
error:
assign:I-value required “time”(can’t modfiy a unifrom )
Re: A Shader Que.
Just add this at the beginning of your code:
This should be the default behaviour, but the LÖVE developers don't seem to agree.
Code: Select all
do
local mt = debug.getregistry().Shader
local old_send = mt.send
mt.send = function (shader, variable, ...)
pcall(old_send, shader, variable, ...)
end
end
Re: A Shader Que.
Thank you, the API manual doesn't say anything about itpgimeno wrote: ↑Thu May 16, 2019 2:47 pm Just add this at the beginning of your code:This should be the default behaviour, but the LÖVE developers don't seem to agree.Code: Select all
do local mt = debug.getregistry().Shader local old_send = mt.send mt.send = function (shader, variable, ...) pcall(old_send, shader, variable, ...) end end
Re: A Shader Que.
All errors should be explicit. The game may choose to ignore errors, but the engine shall never fail silently.
Re: A Shader Que.
Normally I would agree, but this is why I disagree in this case: viewtopic.php?p=222744#p222744
Full previous discussion with Slime starts here: viewtopic.php?p=207865#p207865
The OpenGL wiki recommends ignoring the error, keeping in mind the possibility of a misspelled name: https://www.khronos.org/opengl/wiki/GLS ... iveUniform
Full previous discussion with Slime starts here: viewtopic.php?p=207865#p207865
The OpenGL wiki recommends ignoring the error, keeping in mind the possibility of a misspelled name: https://www.khronos.org/opengl/wiki/GLS ... iveUniform
Who is online
Users browsing this forum: No registered users and 0 guests