View Issue Details

IDProjectCategoryView StatusLast Update
0004939The Dark ModGraphicspublic15.02.2021 16:35
Reporterstgatilov Assigned Toduzenko  
PrioritynormalSeveritynormalReproducibilitysometimes
Status confirmedResolutionopen 
Product VersionTDM 2.07 
Summary0004939: Wrong mirror reflection on model - bc_teatray
DescriptionWhen looking into mirror, I see something like a skybox texture.
Steps To Reproduce1) Start "Crucible Omens: Behind Closed Doors" FM.
2) Execute: setviewpos 1004.45 515.88 869.25 7.5 93.5 0.0

Now look at the mirror in front of you.
It is a bit muddy, but after a bit of strafing it is clear that the reflection is wrong.
TagsNo tags attached.

Relationships

related to 0005035 new tea_tray_silver2.ase/bc_teatray issues 
child of 0004615 resolvedduzenko Remote camera lost when saving\loading 

Activities

stgatilov

stgatilov

01.01.2019 15:43

administrator  

stgatilov

stgatilov

01.01.2019 15:44

administrator  

Darkmod.cfg (13,288 bytes)
stgatilov

stgatilov

01.01.2019 15:44

administrator   ~0011203

I used beta207-02 build to reproduce issue.
Although it will most likely happen in any version.
stgatilov

stgatilov

26.12.2020 08:56

administrator   ~0013212

This is not a brush/patch-made mirror, but a model-made.

There are at least two issues with it:
1) The mirror material must have "mirrorRenderMap" in its main stage, but this material "bc_teatray" does not.
  As the result, the subview rendering does not trigger, and things work as if the mirror was caulk.
2) The mirror surface must be exact plane, but this model is curved and material is applied to the whole of it.
  That's because engine computes mirror plane from the first triangle of the model, which can be pretty arbitrary (and curved mirrors are impossible to support).

So I see two solutions:
a) Split model into two surfaces: the mirroring planar surface in the center, and the non-mirroring surroundings.
  Then add "mirrorRenderMap" to the material (will have to review all of its usages too).
b) Remove "mirror" keyword from the material, so that the model looks like an ordinary one.
Bikerdude

Bikerdude

26.12.2020 12:31

reporter   ~0013221

Its a core mod asset, its a problem with the model - not the FM
stgatilov

stgatilov

26.12.2020 13:34

administrator   ~0013236

Yes indeed, it is the problem of stock model + material entirely.
nbohr1more

nbohr1more

06.02.2021 13:25

developer   ~0013657

Last edited: 06.02.2021 15:04

This was caused by revision 7768.

There is a new check to prevent hall-of-mirror effects:

if ( tr.viewDef->superView && tr.viewDef->superView->isSubview ) // 0004615 HOM effect - only draw mirrors from player's view and top-level asubviews

Reverting to:

if ( tr.viewDef->isSubview )

fixes it

As I can tell, the old check would prevent skybox rendering to mirrors.

I think the best solution is to create a material flag "allowSkyBox" and set it to false by default then add it to this check
stgatilov

stgatilov

06.02.2021 14:44

administrator   ~0013658

I have pointed to model/material errors in my comment (https://bugs.thedarkmod.com/view.php?id=4939#c13212).
Before trying to do anything else, these problems must be addressed anyway.
nbohr1more

nbohr1more

06.02.2021 15:05

developer   ~0013659

Last edited: 06.02.2021 15:06

The problem affects puddles and other reflective materials which do not have the other material issues seen in this asset.

See:

https://forums.thedarkmod.com/index.php?/topic/18200-fan-mission-penny-dreadful-3-by-melan-and-bikerdude-20160710/page/6/#elControls_456058_menu
duzenko

duzenko

06.02.2021 19:53

developer   ~0013661

I second @stgatilov
This needs a model fix, although I would slap a fake environment on it (not that I actually know how to)
nbohr1more

nbohr1more

07.02.2021 21:40

developer   ~0013665

Rev 16143 now no longer has the skybox in the reflection.

A future update should replace this with a cubemap reflection.
stgatilov

stgatilov

15.02.2021 05:36

administrator   ~0013683

Regarding 16142.

I see that "map _scratch2" starts spreading over materials, thanks to nbohr1more's efforts.
Could anyone explain exactly how it works?

To me it sounds like a hack.
_scratch2 is not the right material to be used anywhere. Judging from its name, it can have arbitrary contents, which will most likely lead to phantom images being displayed at random places in future. We already have enough of such issues.
nbohr1more

nbohr1more

15.02.2021 15:43

developer   ~0013687

See the discussion here:

https://forums.thedarkmod.com/index.php?/topic/20766-skybox-rendered-to-indoor-reflective-textures/

I think we need to have dedicated _scratch images for different reflective surfaces or some other structure to prevent
these collisions.
nbohr1more

nbohr1more

15.02.2021 16:35

developer   ~0013688

Incidentally, the new reflection looks great on when the tea tray is positioned vertically like a mirror as in "Behind Closed Doors"
but when laid flat on a table the issue with "random triangle" deciding the reflection vector really stands out.
It would be great if mirrorRenderMap materials had something like the "viewOffset" arg for cameras so that you could define your own
triangle orientation for the material by defining the entity origin. I guess the closest analogous thing we have is the spectrum keyword.

Issue History

Date Modified Username Field Change
01.01.2019 15:43 stgatilov New Issue
01.01.2019 15:43 stgatilov File Added: bcd_wrong_mirror_reflection.jpg
01.01.2019 15:44 stgatilov File Added: Darkmod.cfg
01.01.2019 15:44 stgatilov Note Added: 0011203
26.12.2020 08:56 stgatilov Note Added: 0013212
26.12.2020 12:31 Bikerdude Note Added: 0013221
26.12.2020 12:31 Bikerdude Summary Crucible Omens BCD: wrong mirror reflection => Wrong mirror reflection on model - bc_teatray
26.12.2020 13:34 stgatilov Note Added: 0013236
05.02.2021 16:50 nbohr1more Relationship added related to 0005035
05.02.2021 16:51 nbohr1more Relationship added child of 0004615
06.02.2021 13:20 nbohr1more Assigned To => duzenko
06.02.2021 13:20 nbohr1more Status new => confirmed
06.02.2021 13:25 nbohr1more Note Added: 0013657
06.02.2021 14:44 stgatilov Note Added: 0013658
06.02.2021 15:04 nbohr1more Note Edited: 0013657
06.02.2021 15:05 nbohr1more Note Added: 0013659
06.02.2021 15:06 nbohr1more Note Edited: 0013659
06.02.2021 19:53 duzenko Note Added: 0013661
07.02.2021 21:40 nbohr1more Note Added: 0013665
15.02.2021 05:36 stgatilov Note Added: 0013683
15.02.2021 15:43 nbohr1more Note Added: 0013687
15.02.2021 16:35 nbohr1more Note Added: 0013688