View Issue Details [ Jump to Notes ] | [ Issue History ] [ Print ] | ||||||||
ID | Project | Category | View Status | Date Submitted | Last Update | ||||
---|---|---|---|---|---|---|---|---|---|
0005158 | Spring engine | General | public | 2016-03-10 09:36 | 2016-03-13 01:12 | ||||
Reporter | Beherith | ||||||||
Assigned To | Kloot | ||||||||
Priority | normal | Severity | minor | Reproducibility | always | ||||
Status | closed | Resolution | no change required | ||||||
Product Version | 101.0+git | ||||||||
Target Version | Fixed in Version | ||||||||
Summary | 0005158: Toggling customunitshader off and on (or a /luarules reload) breaks unit self shadowing. | ||||||||
Description | Unit self shadows seem wildly offset based on camera position if CUS is toggled. | ||||||||
Steps To Reproduce | BAR /give all, /luarules reload, have a look at the self-shadows. | ||||||||
Tags | No tags attached. | ||||||||
Checked infolog.txt for Errors | |||||||||
Attached Files |
|
![]() |
|
Beherith (reporter) 2016-03-10 10:20 |
It seems like the angle the shadows are rendered from is not updated with normal camera, and the shadows are 'offset'. See the screenshot. |
Kloot (developer) 2016-03-10 13:03 |
caused by the "#define use_perspective_correct_shadows" material definition in 1_normalmapping.lua |
Beherith (reporter) 2016-03-12 12:44 Last edited: 2016-03-12 13:00 |
I removed the "#define use_perspective_correct_shadows", and cleaned up the shader code to make it as close to engine code as possible. Now the unit self shadowing (and recieving shadows from terrain) doesnt even work from the start. If I /luarules reload, then the shadows are correct until I move the camera. The best unit to test this is corlab, as it has a large overhanging box above its yard. EDIT: It is probably an error on my side, as the shadows on trees are correct before the game starts, even if I move the camera around. After game start they are gone though. Try a map like folsomdamdeluxe which has plenty of trees. |
Kloot (developer) 2016-03-13 01:11 |
You need to remove the "#if (deferred_mode == 0) ... #endif" guard around "outColor.rgb = outColor.rgb * reflection + specular;", otherwise the shader compiler will generate wrong code. See the attached diff. Also note the other changes. |
![]() |
|||
Date Modified | Username | Field | Change |
---|---|---|---|
2016-03-10 09:36 | Beherith | New Issue | |
2016-03-10 10:19 | Beherith | File Added: screen00156.jpg | |
2016-03-10 10:20 | Beherith | Note Added: 0016038 | |
2016-03-10 13:03 | Kloot | Note Added: 0016041 | |
2016-03-10 13:03 | Kloot | Status | new => closed |
2016-03-10 13:03 | Kloot | Assigned To | => Kloot |
2016-03-10 13:03 | Kloot | Resolution | open => no change required |
2016-03-12 12:44 | Beherith | Note Added: 0016048 | |
2016-03-12 12:44 | Beherith | Status | closed => feedback |
2016-03-12 12:44 | Beherith | Resolution | no change required => reopened |
2016-03-12 13:00 | Beherith | Note Edited: 0016048 | View Revisions |
2016-03-12 13:33 | Kloot | Status | feedback => closed |
2016-03-12 13:33 | Kloot | Resolution | reopened => no change required |
2016-03-12 13:35 | Kloot | Status | closed => feedback |
2016-03-12 13:35 | Kloot | Resolution | no change required => reopened |
2016-03-13 01:11 | Kloot | Note Added: 0016056 | |
2016-03-13 01:12 | Kloot | File Added: mantis5158.diff | |
2016-03-13 01:12 | Kloot | Status | feedback => closed |
2016-03-13 01:12 | Kloot | Resolution | reopened => no change required |