View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0006278 | The Dark Mod | Mapping | public | 22.03.2023 17:43 | 22.03.2025 13:25 |
Reporter | Amadeus | Assigned To | |||
Priority | normal | Severity | normal | Reproducibility | always |
Status | new | Resolution | open | ||
Product Version | TDM 2.11 | ||||
Target Version | TDM 2.14 | ||||
Summary | 0006278: Func_Peek lightgem glitch | ||||
Description | When using the func_peek entity in game, the player's lightgem reflects the light value of the room they are peeking into instead of the light value of where the player actually is. For instance, if the player is standing/crouching in a pitch-black room and peers through a keyhole looking into a brightly lit room, the player's light gem will brighten as though they are standing in that brightly lit room. | ||||
Steps To Reproduce | 1. Load up an FM that uses func_peek entity, such as A Good Neighbor, Written in Stone, or Seeking Lady Leicester 2. Lean forward into a func_peek entity (such as a keyhole on a door) in game. 3. Notice how the lightgem reflects the brightness of the room the player is peering into, not the room the player is actually standing in | ||||
Additional Information | Please let me know if additional description/input is needed by me. I'd be happy to include a test map if required. | ||||
Tags | leaning, lighting | ||||
duplicate of | 0006207 | closed | nbohr1more | When peeking, lightgem matches lighting on the other side of the door |
related to | 0006477 | new | func_peek view in wrong position on Linux | |
related to | 0004848 | resolved | duzenko | Crashes when quick loading | Lightgem as Subview |
related to | 0006591 | resolved | nbohr1more | Lightgem produces unexpected results during lean actions |
The code for setting up lightgem is in function R_Lightgem_Render. I believe right now it always uses eye position as lightgem location. There is some logic to put to put location 30% between normal origin and leaned position, to adjust for crouching, etc. But right now it is not used. I guess all of it was broken during changing how lightgem works in terms of rendering (maybe 2.05?) So I would say that: 1) Use the LGPos as origin for lightgem subview rendering (lightgemRv.viewOrg). Check that lightgem works properly and nothing is broken =) 2) Make sure peeking does not modify lightgem position. I think as soon as p.1 is fixed, lightgem will behave properly while peeking. 3) Preferably move the whole stuff about lightgem position calculation into a method of idPlayer class. It is strange that frontend code contains this obviously gameplay logic. |
|
Here is restoring back LGPos. However, there are many more problems: 1) Moving mouse in peeked view is inverted horizontally from one side of the door. 2) It is weird that moving mouse around causes camera to slide along the door plane. At the same time, view direction is not orthogonal to this plane. The math and controls for peeking view need some love, that's for sure =) 3) I still get dark lightgem when peeking into a door from bright side. Moreover, I get dark lightgem when peeking even if there is strong light on both sides of the door. tr_subview.cpp.patch (508 bytes)
Index: tr_subview.cpp =================================================================== --- tr_subview.cpp (revision 10635) +++ tr_subview.cpp (working copy) @@ -569,6 +569,7 @@ lightgemRv.fov_x = lightgemRv.fov_y = DARKMOD_LG_RENDER_FOV; // square, TODO: investigate lowering the value to increase performance on tall maps lightgemRv.x = lightgemRv.y = 0; lightgemRv.viewID = VID_LIGHTGEM; + lightgemRv.vieworg = LGPos; lightgemRv.viewaxis = idMat3( 0.0f, 0.0f, 1.0f, 0.0f, 1.0f, 0.0f, |
|
Hm, that is strange you are seeing a dark lightgem when looking into a lit room. Admittedly, I haven't really looked at this since I first reported this for Seeking Lady Leicester, but I'll do some testing later. Maybe something has changed? | |
So I tested using func_peek in the 2.12 release build, and I am still getting this lightgem glitch. It's puzzling why you aren't able to replicate this. For me, the light gem changes slightly. Try this door in SLL: |
|
Lightgem while leaning was fixed recently. Can you still reproduce in the latest 2.13 Dev build? | |
So I just tested this in SLL and A Good Neighbor on the latest dev build, and I'm still getting the same results; The lightgem still reflects the brightness of the room the player is peering into, not the room they are actually in |
|
For context: I'm the guy that fixed the lightgem leaning inconsistency issue mentioned by nbohr1more. I've done testing on this func_peek problem on a custom built map to find more details. This bug will never occur if there are no areaportals involved. I've tried: - Loose func_peek entity attached to nothing - Func_peek attached to a wall with one side being dark and the other being light - Func_peek attached to a loose door (not placed in a doorway/wall) with different light levels - Func_peek attached to a proper door (inside a doorway) with different light levels NOT using areaportals All of the above cases work as expected. As soon as I put an areaportal in the doorway, the issue starts happening. I'm assuming this is somehow tied to the PVS system and its optimizations. Camera/eye position being moved behind the door into the other room, marking the "body position room" as not being in PVS anymore, therefore not rendering the light that's shining on the player's body and in turn, making the lightgem dark - from my experience it always turns pitch black, that part is consistent and actually has nothing to do with the light in the other room. As of yet, I don't have any concrete or potential solutions/suggestions because the PVS system is a bit "above my pay grade", but I'll keep looking into it when I get time. Edit: Regarding the issues with peeking mentioned by stgatilov (inverted mouse, movement on incorrect plane), I can confirm that those also exist. These seem to be problems with 3D math that are mostly isolated in the tdm_peek.script file. I'll see what I can do with those, since they're in my wheelhouse. |
|
Date Modified | Username | Field | Change |
---|---|---|---|
22.03.2023 17:43 | Amadeus | New Issue | |
29.01.2024 01:23 | Daft Mugi | Relationship added | related to 0006477 |
30.01.2024 22:00 | stgatilov | Note Added: 0016466 | |
30.01.2024 22:22 | stgatilov | Relationship added | related to 0004848 |
30.01.2024 22:42 | stgatilov | Note Added: 0016467 | |
30.01.2024 22:42 | stgatilov | File Added: tr_subview.cpp.patch | |
31.01.2024 14:31 | Amadeus | Note Added: 0016468 | |
03.02.2024 12:46 | stgatilov | Target Version | => TDM 2.13 |
10.02.2024 05:55 | Fiver | Tag Attached: leaning | |
10.02.2024 05:55 | Fiver | Tag Attached: lighting | |
10.02.2024 05:55 | Fiver | Tag Attached: realism | |
16.03.2024 18:31 | Amadeus | Note Added: 0016571 | |
16.03.2024 18:31 | Amadeus | File Added: seekinglady (2024-03-16 12-26-08) (2580 642 41).jpg | |
20.04.2024 14:44 | Fiver | Relationship added | duplicate of 0006207 |
20.04.2024 14:46 | Fiver | Tag Detached: realism | |
08.01.2025 15:19 | nbohr1more | Note Added: 0016939 | |
08.01.2025 15:19 | nbohr1more | Relationship added | related to 0006591 |
08.01.2025 19:11 | Amadeus | Note Added: 0016940 | |
08.01.2025 19:12 | Amadeus | Note Edited: 0016940 | |
09.01.2025 06:12 | nbohr1more | Target Version | TDM 2.13 => TDM 2.14 |
22.03.2025 13:00 | Tinkerton | Note Added: 0016987 | |
22.03.2025 13:13 | Tinkerton | Note Edited: 0016987 | |
22.03.2025 13:25 | Tinkerton | Note Edited: 0016987 | |
22.03.2025 13:25 | Tinkerton | Note Edited: 0016987 |