2025-07-30 08:57 CEST

View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
0006246Spring engineGeneralpublic2019-07-15 20:09
Reporterlhog 
Assigned To 
PrioritynormalSeverityminorReproducibilityalways
StatusresolvedResolutionfixed 
Product Version104.0 +git 
Target VersionFixed in Version104.0 +git 
Summary0006246: "shadow" lua materials
DescriptionI'm playing with CUS capabilities to supply custom "shadow" materials/shaders.

In particular the use of the GL.FRONT culling (during shadow pass) is looking good. With that kind of culling I was able to get rid of any z-biases (positive during the shadow pass or/and negative during the shadow mapping) and get excellent visual results without any shadow acne.

Apparently the engine expects GL_BACK culling to be there during the whole shadow pass: https://github.com/spring/spring/blob/maintenance/rts/Rendering/ShadowHandler.cpp#L381

With that two questions:
1. Is GL_BACK culling really good idea? For units and features GL.FRONT works just great
2. Is there a way to restore expected GL_BACK after I have completed shadow pass for custom "shadow" materials. (Clearly I don't want to do that individually after in post-DisplayList).

Because GL_BACK culling is not restored I get the terrain shadow artifacts like the one attached.
TagsNo tags attached.
Checked infolog.txt for ErrorsIrrelevant
Attached Files

-Relationships
+Relationships

-Notes

~0020029

Kloot (developer)

1) culling front faces was tried before (a decade ago, https://github.com/spring/spring/commit/5abd30e1a56737683d27396a5da50ecbf3697d34) but didn't / doesn't work for all model geometries, details lost to time

2) no, but fixing that should be a one-liner
+Notes

-Issue History
Date Modified Username Field Change
2019-07-14 18:51 lhog New Issue
2019-07-14 18:51 lhog File Added: Spring Screenshot 2019.07.14 - 19.21.57.82.jpg
2019-07-14 21:51 Kloot Note Added: 0020029
2019-07-15 20:09 Kloot Status new => resolved
2019-07-15 20:09 Kloot Resolution open => fixed
2019-07-15 20:09 Kloot Fixed in Version => 104.0 +git
+Issue History