View Issue Details

IDProjectCategoryView StatusLast Update
0004634The Dark ModGraphicspublic05.12.2020 12:35
Reporterstgatilov Assigned Tostgatilov  
Status assignedResolutionopen 
Product VersionTDM 2.05 
Target VersionTDM 2.10 
Summary0004634: Inn Business: ambient light on a rug in tavern is not smooth
DescriptionThe rug look bad: its color (brightness) changes hardly from light to dark at a screen-horizontal line.
See screenshot.
Steps To Reproduce1. Start Inn Business map.
2. Run "notarget" command in console.
3. Enter the tavern through the main entrance.
4. Go to the place behind the bar/table.

At some moment you'll notice that the rug (behind the bar) is hardly split by a horizontal line into two parts with different brightness.
See screenshot.
TagsNo tags attached.


related to 0004079 resolvedSteveL Decals drawing over stuff in front 




14.10.2017 07:48


broken_ambient_1.jpg (73,684 bytes)   
broken_ambient_1.jpg (73,684 bytes)   


14.10.2017 07:48


broken_ambient_2.jpg (132,494 bytes)   
broken_ambient_2.jpg (132,494 bytes)   


14.10.2017 07:50

administrator   ~0009466

Note: this has nothing to do with interactions, it is present even with r_skipInteractions.
It happens both with simple and enhanced ambient rendering method. Settings like GLSL/FBO have no effect on the problem.

I suspect it is a bad texture, since other objects do not have the issue.


14.10.2017 12:13

developer   ~0009468

Last edited: 14.10.2017 12:14

View 2 revisions

I can't see the problem, neither on the screenshots or in game.
Here's my screenshot.
I used r_singleLight and r_lightscale to have the ambient light only.



14.10.2017 12:16


Untitled.jpg (274,510 bytes)


14.10.2017 12:32

administrator   ~0009469

When I try to see your screenshot, I see mantis error:

Issue 0 not found.
SYSTEM WARNING: 'extract() expects parameter 1 to be array, boolean given' in '/usr/local/www/mantis-1.2.19_1/file_download.php' line 81

Do you mean you cannot notice the problem even on my screenshots?


14.10.2017 12:33

administrator   ~0009470

Try increasing gamma to make ambient colors bright enough. With low gamma this thing can be hard to notice.


14.10.2017 12:34

developer   ~0009471

Last edited: 14.10.2017 12:36

View 3 revisions

Try to refresh the webpage because I re-uploaded the picture.
Otherwise here it is



14.10.2017 12:35

administrator   ~0009472

As for Untitled.jpg which is the third attachment in this issue, you are too close to this rug to see the effect.
Try to reproduce exactly the same camera position as on my screenshots.


14.10.2017 12:36

developer   ~0009473

How did you turn the ceiling light off?


14.10.2017 12:39

administrator   ~0009474

Speaking on my first screenshot, it has two red marks like ">" and "<" signs inside red circle. Inspect closely the horizontal line between them. It splits the rug into two parts: the lower one is significantly brighter than the upper one.

When you move slightly from that position, the splitting line moves up and down with you, which catches your eye quickly (unless you have low gamma, in which case you do not see ambient well anyway).


14.10.2017 12:40

administrator   ~0009475

I used water arrow to disable ceiling light =)


15.10.2017 10:16

developer   ~0009480

Last edited: 15.10.2017 10:40

View 5 revisions

Can see it now.
I think it's simple depth-buffer fighting.
Could it be some kind of polygon offset mapper's attempt that went wrong?
Somebody fluent with DR should take a look.

Or maybe it's just the scattered_dirt getting on top of the carpet because of insufficient depth buffer precision. Explains why r_skipAmbient 1 fixes it.



15.10.2017 15:23

developer   ~0009481

Last edited: 15.10.2017 15:25

View 2 revisions

It turns out there are *two* func_static scattered_dirt02 patches, coplanar with each other and with the top of the floor brush. It doesn't look as though the mapper tried to offset anything (though scattered_dirt02 has DECAL_MACRO, implying sort decal and polygonOffset 1 on both patches).



15.10.2017 16:27

administrator   ~0009482

Ok, it looks like a map issue.
This is very likely because most of the rugs around do not behave wrong.
Sorry, false alarm then =)

BTW, is it hard to check that if duplicate dirt is removed, the issue is gone?

P.S. Should it be resolved as "won't fix" or changed to "mapping" category?


15.10.2017 16:40

developer   ~0009483

I would vote for moving to the "mapping" category


15.10.2017 17:30

developer   ~0009484

Last edited: 15.10.2017 17:43

View 2 revisions

I'm not sure it is a map issue: the decal patches are below the rug. In fact they're as far below the rug as they could be. And using more than one blended decal (they use blend filter) is something a mapper might legitimately do.

Edit: I just tried and failed to see any glitches on my 2.05 installation.

If you want to test with one of the decal patches removed, setting "hide" "1" on func_static_199 should work non-destructively.



11.11.2017 15:35




11.11.2017 15:37

administrator   ~0009569

Added a screenshot from "Patently Dangerous" mission.
The same (or almost the same) rug produces the same issue.
You can see it very close to the mission start: just mantle over the fence and it will be there.


11.11.2017 18:52

developer   ~0009578

Related to 0001201?


12.11.2017 21:46

developer   ~0009587

Or this?


14.11.2017 16:59

administrator   ~0009614

I have also noticed the same issue on one of the larger rugs in Saint Lucia. Have not taken a screenshot...


14.11.2017 19:43

developer   ~0009619

Last edited: 14.11.2017 19:48

View 4 revisions

>> the decal patches are below the rug.
Yes they are, but the engine lifts all decals automatically (see cvars r_offsetXXX).
Set the cvars to 0 and the carpet is OK but now the stain on the bar stand is broken.
You can play with cvars and try to find values that work for this particular location.
The radical solution would be to disable the hardware depth test and discard pixels in fragment shader which would bring some other glitches.
We can also use a 32-bit depth precision in an FBO.



31.12.2017 07:41

administrator   ~0009947

Last edited: 31.12.2017 07:42

View 2 revisions

I have linked a related issue, maybe interesting to read.

It looks like the only proper way to fix it is to review all the offsets (depth and 3D) and create some plan which would get everything right. Adjusting offset for one particular scenario without checking all the other cases will most likely break some other cases =(

When I set r_offsetFactor to -1 instead of -2, the issue starts happening at much smaller looking angle. With -0.6, I have to go very far to see the issue (Patently Dangerous is a great map to test it).
According to my experience, such dependence on angle must not happen when polygonOffsetFactor is used (it is divided on the minimum looking angle over the polygon).
Which leads me to conclusion that there is a plain 3D offset somewher (i.e. offset hardcoded in world coordinates). Perhaps if we remove this 3D offset, everything would work properly?


28.03.2018 08:37


This old decal issue thats been around for a while now, have you guys got an idea on how to fix it..?


28.03.2018 09:31

developer   ~0010196

Last edited: 28.03.2018 09:32

View 2 revisions

In this particular case IMHO it would make sense to make the dirt decal to include the carpet as well. (Do they only walk with their dirty boots on the woodboard?)

If we want to make an impression of carpet to cover the dirt then we need to somehow make the dirt part of the woodboard material.

Issue History

Date Modified Username Field Change
14.10.2017 07:46 stgatilov New Issue
14.10.2017 07:48 stgatilov File Added: broken_ambient_1.jpg
14.10.2017 07:48 stgatilov File Added: broken_ambient_2.jpg
14.10.2017 07:50 stgatilov Note Added: 0009466
14.10.2017 12:13 duzenko Note Added: 0009468
14.10.2017 12:13 duzenko File Added: Untitled.jpg
14.10.2017 12:14 duzenko Note Edited: 0009468 View Revisions
14.10.2017 12:15 duzenko File Deleted: Untitled.jpg
14.10.2017 12:16 duzenko File Added: Untitled.jpg
14.10.2017 12:32 stgatilov Note Added: 0009469
14.10.2017 12:33 stgatilov Note Added: 0009470
14.10.2017 12:34 duzenko Note Added: 0009471
14.10.2017 12:35 duzenko Note Edited: 0009471 View Revisions
14.10.2017 12:35 stgatilov Note Added: 0009472
14.10.2017 12:36 duzenko Note Edited: 0009471 View Revisions
14.10.2017 12:36 duzenko Note Added: 0009473
14.10.2017 12:39 stgatilov Note Added: 0009474
14.10.2017 12:40 stgatilov Note Added: 0009475
15.10.2017 10:16 duzenko Note Added: 0009480
15.10.2017 10:17 duzenko Note Edited: 0009480 View Revisions
15.10.2017 10:29 duzenko Note Edited: 0009480 View Revisions
15.10.2017 10:38 duzenko Note Edited: 0009480 View Revisions
15.10.2017 10:40 duzenko Note Edited: 0009480 View Revisions
15.10.2017 15:23 VanishedOne Note Added: 0009481
15.10.2017 15:25 VanishedOne Note Edited: 0009481 View Revisions
15.10.2017 16:27 stgatilov Note Added: 0009482
15.10.2017 16:40 duzenko Note Added: 0009483
15.10.2017 17:30 VanishedOne Note Added: 0009484
15.10.2017 17:43 VanishedOne Note Edited: 0009484 View Revisions
11.11.2017 15:35 stgatilov File Added: PatentlyDangerous_BrightnessIssue.jpg
11.11.2017 15:37 stgatilov Note Added: 0009569
11.11.2017 18:52 duzenko Note Added: 0009578
12.11.2017 21:46 VanishedOne Note Added: 0009587
14.11.2017 16:59 stgatilov Note Added: 0009614
14.11.2017 19:43 duzenko Note Added: 0009619
14.11.2017 19:43 duzenko Note Edited: 0009619 View Revisions
14.11.2017 19:46 duzenko Note Edited: 0009619 View Revisions
14.11.2017 19:48 duzenko Note Edited: 0009619 View Revisions
31.12.2017 07:24 stgatilov Relationship added related to 0004079
31.12.2017 07:41 stgatilov Note Added: 0009947
31.12.2017 07:42 stgatilov Note Edited: 0009947 View Revisions
28.03.2018 08:37 user81 Note Added: 0010173
28.03.2018 09:31 duzenko Note Added: 0010196
28.03.2018 09:32 duzenko Note Edited: 0010196 View Revisions
21.03.2020 17:47 stgatilov Product Version SVN => TDM 2.05
21.03.2020 17:47 stgatilov Target Version => TDM 2.09
21.03.2020 17:47 stgatilov Assigned To => stgatilov
21.03.2020 17:47 stgatilov Status new => assigned
05.12.2020 12:35 stgatilov Target Version TDM 2.09 => TDM 2.10