Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support lights "nospecular" parm (if explicitly enabled) #643

Closed
wants to merge 4 commits into from

Conversation

DanielGibson
Copy link
Member

based on #254

The "nospecular" parm will only be used if either
r_supportNoSpecular is set to 1
or r_supportNoSpecular is set to -1 (the default) and the maps spawnargs contain "allow_nospecular" "1"

Drawback: I think the current code doesn't work with (time)demos, as I think that I can't access the maps spawnargs when playing one

@DanielGibson
Copy link
Member Author

This needs testing, which implies a custom testmap (that someone - not me - has to create).
I won't merge this if it's not tested!

based on dhewm#254

The "nospecular" parm will only be used if either
r_supportNoSpecular is set to 1
or r_supportNoSpecular is set to -1 (the default) and the maps spawnargs
contain "allow_nospecular" "1"

This probably doesn't work with (time)demos yet, because I think when
they're being played I can't access the worldspawn entity
@DanielGibson
Copy link
Member Author

@FriskTheFallenHuman was so friendly to create a testmap for this:
nospecular_test.zip

This seems to work as expected.

There are two things that need a bit more investigation:

  1. (time)demos
  2. D3Radiant - @FriskTheFallenHuman said that this worked in the level editor, but I don't understand how/why/when. Ideally nospecular should only work there if "allow_nospecular" "1" is set in the worldspawn (and then ideally it should work immediately without reloading the map), but I didn't add any code to enable that so I'm surprised it apparently works at all..

D3::ImGuiHooks::NewFrame() was still called every frame, but EndFrame()
wasn't because idSessionLocal::UpdateScreen() exited early.
This caused an assertion in Dear ImGui, because it doesn't like calling
NewFrame() if it has been called before without EndFrame() afterwards
depending on worldspawn's allow_nospecular
@DanielGibson
Copy link
Member Author

DanielGibson commented Jan 20, 2025

The radiant part of the problem is solved, it now works reliably and updates tr.allowNoSpecular whenever allow_nospecular is set/changed in the worldspawn, and when a map is loaded.

Still not sure what to do about the timedemos, though.
I could just change the demoformat to save the current tr.allowNoSpecular value when recording and set that when playing...
Is that bad? dhewm3 could still play old demos, but new demos would be incompatible with older versions of dhewm3 or Vanilla Doom3 or other source ports.

@FriskTheFallenHuman
Copy link

The radiant part of the problem is solved, it now works reliably and updates tr.allowNoSpecular whenever allow_nospecular is set/changed in the worldspawn, and when a map is loaded.

Still not sure what to do about the timedemos, though. I could just change the demoformat to save the current tr.allowNoSpecular value when recording and set that when playing... Is that bad? dhewm3 could still play old demos, but new demos would be incompatible with older versions of dhewm3 or Vanilla Doom3 or other source ports.

perhaps implementing a new timedemo format may not be that bad, has far i know it shouldn't be a problem since timedemos where not that common unlike standard demos iirc

@DanielGibson
Copy link
Member Author

I mean standard demos, timedemos just play standard demos at high speed

@DanielGibson
Copy link
Member Author

I changed it now.
Still not sure if it matters - is recording demos and redistributing them something that's (still) commonly done?

If this really turns into a problem I could create a CVar that allows choosing the demo recording format

By writing that info into the demo when recording it (when demos are
played back, mylevel.map isn't read, only mylevel.proc, so the
worldspawn can't be accessed to get allow_nospecular from there)
@DanielGibson
Copy link
Member Author

no idea why github doesn't detect that, but I rebased and merged the branch manually

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants