View Issue Details [ Jump to Notes ] | [ Issue History ] [ Print ] | ||||||||
ID | Project | Category | View Status | Date Submitted | Last Update | ||||
---|---|---|---|---|---|---|---|---|---|
0006022 | Spring engine | Lua | public | 2018-07-30 02:50 | 2018-07-30 23:36 | ||||
Reporter | lhog | ||||||||
Assigned To | Kloot | ||||||||
Priority | normal | Severity | minor | Reproducibility | always | ||||
Status | resolved | Resolution | fixed | ||||||
Product Version | 104.0 +git | ||||||||
Target Version | Fixed in Version | ||||||||
Summary | 0006022: uniformArray definition in gl.CreateShader doesn't seem to initialize array uniforms | ||||||||
Description | I use something like the following snippet: shObj = gl.CreateShader({ fragment = fragCode, uniform = { something = 0.5, }, uniformInt = { somethingElse = 1, }, uniformArray = { someArray = {0.1, 0.2, 0.3, 0.4, 0.5}, }, }) Every other uniform, except someArray gets initialized. If the same initialization is done somewhere in the drawing code like this, then everything works as expected: local UNIFORM_TYPE_FLOAT = 2 tbl = {0.1, 0.2, 0.3, 0.4, 0.5} gl.UniformArray(someArrayLoc, UNIFORM_TYPE_FLOAT, tbl) I think something might be wrong with uniformArray parsing in gl.CreateShader or am I missing some special syntax? | ||||||||
Additional Information | https://github.com/lhog/spring-luashader-goodies/blob/master/GaussBlur.lua#L150-L156 https://github.com/lhog/spring-luashader-goodies/blob/master/GaussBlur.lua#L181-L182 https://github.com/lhog/spring-luashader-goodies/blob/master/LuaShader.lua#L209-L236 | ||||||||
Tags | No tags attached. | ||||||||
Checked infolog.txt for Errors | |||||||||
Attached Files |
|
![]() |
|
Kloot (developer) 2018-07-30 09:49 |
arrays are automatically handled by CreateShader, just write this: uniformFloat = { something = 0.5, someArray = {0.1, 0.2, 0.3, 0.4, 0.5}, }, "uniformArray" is not a recognized key. |
lhog (reporter) 2018-07-30 14:43 |
I've just tried two variants: uniform = { weights = {0.1, 0.2, 0.3}, offsets = {0.0, 1.0, 2.0}, } and uniformFloat = { weights = {0.1, 0.2, 0.3}, offsets = {0.0, 1.0, 2.0}, } Both cause the following warnings in the infolog.txt: [f=0003874] Warning: [ParseUniformsTable] uniform "weights" from table "uniform" not active in shader [f=0003874] Warning: [ParseUniformsTable] uniform "offsets" from table "uniform" not active in shader As in the previous case gl.UniformArray(someArrayLoc, UNIFORM_TYPE_FLOAT, tbl) works just fine on the same uniforms. As far as uniformArray key, it's suggested on the GLSL wiki: https://springrts.com/wiki/Lua_GLSL_Api I would change this myself, but my IP-address is blocked (apparently collateral damage from some other guy's ban). |
Kloot (developer) 2018-07-30 23:36 |
Fix cd9b5e3c2c59554e7fc6ec7fca45fa9db5a216b2 committed to develop branch: fix 0006022, repo: spring changeset id: 10413 |
![]() |
|||
Date Modified | Username | Field | Change |
---|---|---|---|
2018-07-30 02:50 | lhog | New Issue | |
2018-07-30 09:49 | Kloot | Note Added: 0019267 | |
2018-07-30 09:49 | Kloot | Status | new => closed |
2018-07-30 09:49 | Kloot | Resolution | open => no change required |
2018-07-30 14:43 | lhog | Status | closed => feedback |
2018-07-30 14:43 | lhog | Resolution | no change required => reopened |
2018-07-30 14:43 | lhog | Note Added: 0019268 | |
2018-07-30 16:36 | Kloot | Assigned To | => Kloot |
2018-07-30 16:36 | Kloot | Status | feedback => assigned |
2018-07-30 23:36 | Kloot | Changeset attached | => spring develop cd9b5e3c |
2018-07-30 23:36 | Kloot | Note Added: 0019270 | |
2018-07-30 23:36 | Kloot | Status | assigned => resolved |
2018-07-30 23:36 | Kloot | Resolution | reopened => fixed |