View Issue Details

IDProjectCategoryView StatusLast Update
0006098Spring engineGeneralpublic2018-12-15 13:54
Reporterlhog Assigned ToKloot  
PrioritynormalSeveritytweakReproducibilityalways
Status resolvedResolutionfixed 
Product Version104.0 +git 
Summary0006098: Shadow Texture sampling doesn't work in custom map shader
DescriptionFrom chat with hokomoko:

I think I know what is wrong with shadows:
1) Lua Shaders cause this return: https://github.com/spring/spring/blob/maintenance/rts/Map/SMF/SMFRenderState.cpp#L484-L490
2) This is not executed: https://github.com/spring/spring/blob/maintenance/rts/Map/SMF/SMFRenderState.cpp#L512
3) Therefore these params are not set for texture: https://github.com/spring/spring/blob/16a88b7ee2f1c5f6e66bc7d07becd549573f1d17/rts/Rendering/ShadowHandler.cpp#L580-L587

Therefore I need to do something like this to render shadows:
https://github.com/lhog/spring-map-pbr/commit/3301ae93c10c5d94e7d302cb0333b366e922d64b

As a result shadows look a bit more jaggier, because textureProj(sampler2DShadow, coords)does PCF internally.

Is there anything I can do from lua side to force GL_TEXTURE_COMPARE_MODE and the rest here https://github.com/spring/spring/blob/16a88b7ee2f1c5f6e66bc7d07becd549573f1d17/rts/Rendering/ShadowHandler.cpp#L580-L587 ?
Steps To ReproduceDo custom map shader framework (or grab mine), that would set Flags and Uniforms
1) Copy standard SMF Map shader and load it as custom.
2) Observe correct rendering of everything except shadows.
TagsNo tags attached.
Checked infolog.txt for Errors

Activities

Kloot

2018-12-15 13:54

developer   ~0019608

Fix 858b876e70244ebda54dac02dc0633220ce22598 committed to develop branch: fix 0006098, repo: spring changeset id: 11202

Kloot

2018-12-15 13:54

developer   ~0019609

Fix 286be00f9262fa5d63b3be70cf823ec0ec2122f1 committed to maintenance branch: fix 0006098, repo: spring changeset id: 11203

Issue History

Date Modified Username Field Change
2018-12-15 11:17 lhog New Issue
2018-12-15 13:54 Kloot Changeset attached => spring develop 858b876e
2018-12-15 13:54 Kloot Note Added: 0019608
2018-12-15 13:54 Kloot Assigned To => Kloot
2018-12-15 13:54 Kloot Status new => resolved
2018-12-15 13:54 Kloot Resolution open => fixed
2018-12-15 13:54 Kloot Changeset attached => spring maintenance 286be00f
2018-12-15 13:54 Kloot Note Added: 0019609