2024-04-24 20:33 CEST

View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
0006004Spring engineLuapublic2018-10-12 01:23
ReporterSanguinario_Joe 
Assigned To 
PrioritynormalSeveritymajorReproducibilityalways
StatusclosedResolutionfixed 
Product Version104.0 +git 
Target VersionFixed in Version104.0 +git 
Summary0006004: Missing Uniforms in LUA map shaders
DescriptionWhen SetMapShader is used, spring is only setting 'texSquare' uniform variable. Indeed, the rest of uniforms and flags shall be set by the user. Unfortunately, several of them are hard, or even impossible, to set, like 'clipPlane'.

That's in fact blocking this awesome feature, right?

Probably, the easiest (but super-risky) solution is setting all the flags and uniforms, even in case of Lua Shaders
Additional InformationOfficially tested in Spring 104.0.1-966-g78324c9 develop, but probably is affecting every single version
Tagsgraphics, ground, luaui, map
Checked infolog.txt for Errors
Attached Files

-Relationships
+Relationships

-Notes

~0019211

gajop (developer)

Last edited: 2018-06-12 15:36

View 2 revisions

But, the whole point of Lua map shaders is that you could have custom shaders. Setting the same uniforms and flags that the engine shaders would limit them considerably.

We do need a map shader framework, something to hope for 105

~0019266

lhog (reporter)

I agree @Sanguinario_Joe. Engine should set standard uniforms regardless of whether the shaders are standard or custom, otherwise SetMapShader is PITA to use.

@gajop, you can always define your own uniforms or choose not to use the standard ones.

~0019388

gajop (developer)

Thanks to the @Sanguinario_Joe 's contribution this can now be done using the following code: https://github.com/sanguinariojoe/spring1944/blob/customMapShader/LuaUI/Widgets/gfx_customMapShader.lua
Please reopen if you think any other actions are necessary.

~0019389

gajop (developer)

Fixed with https://github.com/spring/spring/pull/402
+Notes

-Issue History
Date Modified Username Field Change
2018-06-12 10:48 Sanguinario_Joe New Issue
2018-06-12 10:48 Sanguinario_Joe Tag Attached: graphics
2018-06-12 10:48 Sanguinario_Joe Tag Attached: ground
2018-06-12 10:48 Sanguinario_Joe Tag Attached: luaui
2018-06-12 10:48 Sanguinario_Joe Tag Attached: map
2018-06-12 15:35 gajop Note Added: 0019211
2018-06-12 15:36 gajop Note Edited: 0019211 View Revisions
2018-07-30 02:38 lhog Note Added: 0019266
2018-10-12 01:22 gajop Note Added: 0019388
2018-10-12 01:23 gajop Status new => closed
2018-10-12 01:23 gajop Resolution open => fixed
2018-10-12 01:23 gajop Fixed in Version => 104.0 +git
2018-10-12 01:23 gajop Note Added: 0019389
+Issue History