Jump to content
The Dark Mod Forums

[Resolved] X-ray glasses stale first frame


Daft Mugi
 Share

Recommended Posts

When playing Iris and Written in Stone, I noticed a graphical glitch with the x-ray glasses.

When the x-ray glasses are activated, the first frame of the fade to x-ray vision is the last frame of the previous x-ray glasses usage.

To reproduce:

  1. Use the x-ray glasses and look at something easily recognizable, such as a light source.
  2. Turn off the x-ray glasses.
  3. Look at something else.
  4. Use the x-ray glasses, and you should for a moment see the last thing you were looking at from #1.

What could be causing that?

 

I don't know if it is related, but I've noticed something similar with other (animated) fades:

  1. The pop-up note in the upper-left corner will start at 100% opacity and then reset near 0% before fading in to 100% opacity.
  2. Loading a new mission or loading a save will have a fullscreen graphical blink. It might be the last frame of the previous scene or the 100% -> 0% -> 100% opacity fade issue.

 

Bug: https://bugs.thedarkmod.com/view.php?id=6109

Edited by Daft Mugi
Link to comment
Share on other sites

  • 1 month later...
On 9/8/2022 at 12:10 AM, Daft Mugi said:

@duzenko Hey, checking on the status of this.

Has this been fixed? If not, does this have a bug tracker ticket?

Thanks!

I would think we don't have a ticket yet for this - feel free to create.

The big problem here is it's hard for me to notice that single bad frame.

Can you help with testing? You'd need to run a dev build and get to the point where you can reproduce it

Link to comment
Share on other sites

  • 3 weeks later...

@duzenko Hey, sorry for the late reply. I saw an email notification, but the "Can you help with testing?" bit wasn't in the email.

Sure, I can help with testing. However, with the recent SVN versions, the game has errors and I cannot play. I'm not sure what's going on yet. I can build and play earlier versions, such as r9853, just fine. I got compiled versions working again by using dev assets instead of 2.10 assets, so I can test properly now.

As a suggestion, could you use something like OBS to record your game and play it back frame by frame to catch the artifact?

Added bug to tracker: https://bugs.thedarkmod.com/view.php?id=6109

Edited by Daft Mugi
Link to comment
Share on other sites

Well, the engine is not very accurate regarding first frames of anything, given that it has SMP and other things.

I'd suggest trying to disable com_smp, maybe the issue will go away.
When SMP is on, we render previous frame while we model gameplay for the next one.
It might be a texture rendered specifically for X-ray, or some frontend data which is gathered for X-ray, etc.

In order to find the issue, I'd recommend using apitrace to capture OpenGL replay (on a smaller map).
It is not nice to use, but unlike RenderDoc, it captures every frame, so you can later find the glitchy one and see what's wrong in OpenGL calls.

After you understand what causes this issue, a proper fix would probably be adding some kind of delay to X-ray visualization, or some kind of clear when X-ray is disabled/enabled.
 

Link to comment
Share on other sites

On 9/27/2022 at 1:28 AM, stgatilov said:

I'd suggest trying to disable com_smp, maybe the issue will go away.
When SMP is on, we render previous frame while we model gameplay for the next one.
It might be a texture rendered specifically for X-ray, or some frontend data which is gathered for X-ray, etc.

Thank you for the suggestion. I tried com_smp set to 0 and the stale frame was still there.

10 hours ago, duzenko said:

OK, so to start with, play towards obtaining the x-ray glasses where you can reproduce the bug and save there.

Now upload that save somewhere for me.

Or if you feel like jumping into the C++ code, look for the GUI x-ray flag that triggers that late frame copy

Would viewpos coordinates work instead of a save?

MISSION: Written in Stone

setviewpos 270 -535 537 180

// Or, bind to a key for convenience
bind "j" "setviewpos 270 -535 537 180"

To test (always reproducible):

  1. Pick up the glasses on the desk.
  2. Enable glasses.
  3. Look at the candle on the desk.
  4. Disable glasses.
  5. Turn around and look at a dark area.
  6. Enable glasses. (The previous x-ray view of the candle will blink briefly before fading to the current x-ray view.)

I don't have much experience with graphics programming, so I'm afraid I can't help much with this one other than testing.

Thank you for working on this!

Edited by Daft Mugi
Link to comment
Share on other sites

3 hours ago, Daft Mugi said:

Thank you for the suggestion. I tried com_smp set to 0 and the stale frame was still there.

Would viewpos coordinates work instead of a save?

MISSION: Written in Stone

setviewpos 270 -535 537 180

// Or, bind to a key for convenience
bind "j" "setviewpos 270 -535 537 180"

To test (always reproducible):

  1. Pick up the glasses on the desk.
  2. Enable glasses.
  3. Look at the candle on the desk.
  4. Disable glasses.
  5. Turn around and look at a dark area.
  6. Enable glasses. (The previous x-ray view of the candle will blink briefly before fading to the current x-ray view.)

I don't have much experience with graphics programming, so I'm afraid I can't help much with this one other than testing.

Thank you for working on this!

I suppose it might be enough, now a matter of me having spare time to look into it

  • Thanks 1
Link to comment
Share on other sites

10 hours ago, duzenko said:

sorry, but it seems that your location is not correct

At least for me it moves into the sky

Well, that's quite odd. I wonder why. Is the dev build of TDM using a different coordinate system or setviewpos function?

I'm using written_a7cfb7c80ad19609.pk4.

I've attached an image of noclipping to the area that has the x-ray glasses.

It's quite easy to noclip there.

  1. Start map.
  2. noclip
  3. Fly straight and slightly upwards.
  4. You'll see a tower with a stained glass window. Fly into it.
  5. You'll be in the room with the x-ray glasses.

wis-x-ray-glasses-fly-to.webp

Edited by Daft Mugi
Link to comment
Share on other sites

1 hour ago, Daft Mugi said:

@duzenko Thank you for the candidate.

Unfortunately, I don't have a Windows machine to test this. I use Linux.

Could you please post a (text) patch here either as an attachment or code block, so I can compile my own build?

It's in svn already

 
Link to comment
Share on other sites

  • Daft Mugi changed the title to [Resolved] X-ray glasses stale first frame

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recent Status Updates

    • snatcher

      TDM Modpack v2.6 released!
      · 0 replies
    • peter_spy

      Perhaps an unpopular opinion: TDM team might benefit from someone with actual QA experience; someone with naturally and professionally developed curiosity, who is interested in how and why things work, how they break At least to me it's kind of mind-boggling how untested some rather important features are (first the absence alert feature for items, now the rope +body carry behavior).
      · 4 replies
    • nbohr1more

      The Dark Mod is hosting an Ask Me Anything thread on the PC Gaming reddit forum:  https://www.reddit.com/r/pcgaming/comments/10nfcwj/hello_we_are_the_international_development_team/
      Feel free to join the discussion there
      · 2 replies
    • stgatilov

      Bumped into an interesting piece of wisdom called Hyrum's Law:
      With a sufficient number of users of an API, it does not matter what you promise in the contract: all observable behaviors of your system will be depended on by somebody.
      · 5 replies
    • The Black Arrow

      I love playing The Dark Mod when it's cold in my place. Bonus points when it's a bit (or even very) dark and it's raining, too.
      · 2 replies
×
×
  • Create New...