ec- / Quake3e

Improved Quake III Arena engine
GNU General Public License v2.0
1.15k stars 149 forks source link

Issue/Question: Shader reloading on map restart (map rgoer_seasons). #225

Closed ghost closed 1 year ago

ghost commented 1 year ago

Issue/Question: Is shader re-loading correct?

Please note that I'm not 100% sure if this is an issue/bug or not, please check this for yourself!

The map:

The specific map is called rgoer_seasons, it shows a tree in an environment that changes with the four seasons. The leaves of the tree changes their color, snow is covering the ground, even the sky changes with the seasons. The map starts with spring, goes through summer, autumn and winter, and starts from beginning. I added the map (bsp) and the relevant shaders here, so you can try the map for yourself. NOTE: The map was NOT made by me. It is a very old map, I don't know if there is any place to still download this map, and I don't remember the author's real name.

The issue:

Like I said above the map starts with shaders being in 'spring' state. In Spearmint and iirc with vanilla 1.32, the map always starts in 'spring' state, even after a map restart. Well, it seems in Q3e when the map is already loaded and we do a \devmap or \map_restart command and load the map again the shaders aren't reset to their default 'spring' state.

How to reproduce:

  1. Download the attached rgoer_seasons.zip file from below.
  2. Unzip the pk3 file into your baseq3 folder (Q3e\baseq3).
  3. Start Q3e.
  4. Open the console and type: \devmap rgoer_seasons
  5. After the map was loaded, wait a few minutes, until the season has changed.
  6. Now open the console and type \map_restart or type \devmap rgoer_seasons again.
  7. The map will restart.
  8. Now you see that the map is in the same season as before the restart.

So the question is if this can be considered as bug or not, tbh, I don't know. Shouldn't shaders always reset to their default state? Checked this with other idtech3 engines, shows that Q3e doesn't reset the shader state, whereas other engines do. Or do I miss something here?

Notes:

Feel free to close this ticket if you think this isn't an issue at all. I just found this Q3e behaviour mismatch when I was talking with zturtleman about rendering 'funny' shaders... Thanks

rgoer_seasons.zip

ensiform commented 1 year ago

Is the map using shader remaps or something?

ghost commented 1 year ago

The sky uses 'animMap' other shaders use 'rgbGen wave sin' etc. The shader is included in the zip file. It is called 'rgoer_seasons.shader'. Idk, if the Q3e engine does shader remapping differently than 1.32, iirc it was added to 1.32 because of Team Arena.

ghost commented 1 year ago

@ensiform just in case you want the map in ETe format, download the attached zip file. rgoer_seasons_ETe.zip NOTE: this is only for ensiform, or other ETe users. Don't use it if you're on Q3e.

Chomenor commented 1 year ago

Does it make a difference if sv_levelTimeReset is set to 1 or 0?

ghost commented 1 year ago

YES! You are right! If sv_levelTimeReset is set to 1, the \devmap command resets the shader/season. A map_restart works different to other idtech3 games, but I don't know if this was intentionally changed, at least it makes sense. I think I can close this ticket than. Thanks for this advice @Chomenor , you're genius!

ensiform commented 1 year ago

But is it intended behavior? Even for that cvar? And which value is default

ghost commented 1 year ago

@ensiform I don't know, stupidity on my part prevents a correct answer to your question, what I know is that default is 0. And this is what the Q3e docs says:

... reset or do not reset leveltime after new map loads, when enabled - fixes gfx for clients affected by "frameloss" bug, however it may be necessary disable in case of troubles with GTV

ensiform commented 1 year ago

Default 0 should be the same behavior as other engines.