-
Notifications
You must be signed in to change notification settings - Fork 540
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
Max draw distance setting #2695
base: master
Are you sure you want to change the base?
Conversation
…culling. Can chang from console. Works for both hardware and software rendering, but with different effects. Test with something like Frozen Time wad.
…ibly exposed to zscript (verify). Added a mode to CVar r_clearbuffer (== 5) where the void gets the fog fade color.
…ing in some subsectors within distance not being rendered). Centered the camera for orthographic projection.
…pulate the r_clearbuffer CVar.
Uh, wrong video? Also if it isn't already, I'd recommend the ability to set this via mapinfo with the cvar overriding it if it's not at 0 or something like that. |
Err... fixed. (That could have gotten so wrong) Yes. Both |
Watching the video, a couple things came to mind.
|
The Fog Effect thing is just a mod I was using. It isn't part of the commit. I'll need to think about a menu option for toggling maxdrawdist and clearbuffer color and get back to you. Trivially done of course, but I hope others chime in as well. I stumbled on |
Oh! Can you show me where that mod is? |
Fog Effects by Sergeant Mark IV (standalone version of whatever BD uses, I think): https://www.moddb.com/mods/brutal-doom/addons/fog-effects |
Thanks!
That's fair, it's merely a suggestion because it fits with being able to toggle fog on and off. Just figured having an easy switch would be nice. "On", "Off", and "Map Based" (or "Default" if you want to keep to the naming convention for Allow Jump/Crouch) Also this feature has me thinking about the above issue I made but no need to address here, unless you want to. Just planting the seed for improving fog is all. |
So does the fog not automatically turn on if the subsector cull distance is enabled? The map needs to either have VOIDFADETOFOG or you need to type r_clearbuffer 5 to the console? Because if that's how it works right now then it feels like an oversight IMO. The game looks pretty bad with just the plain culling. And most maps won't have the flag to replace culled geometry with fog on. Which is a problem because people will use this to make otherwise large and slow maps run faster. You basically demonstrated this with Frozen Time, it obviously doesn't have the map flag on, but people will use the render distance CVAR/setting to run the map faster, and it'll have no fog unless they know to type a very specific command in, which they probably WON'T know how to do. So I think the behavior of VOIDFADETOFOG should probably be on by default whenever a maximum render distance is set. |
It is actually a little worse than that. It is setting the void color to I don't know if the engine should be fogging up the map by itself (after checking for existing fog density to be zero, and setting it to one everywhere). That is how mid-late 90s' 3D games did it I think? |
…amps to maximum of computed fog density versus that set by mapper.
…ys painting the void with fog/fade color by default (in HW renderer).
The void now gets the fog/fade color by default (as per request) unless a level flag is set or I am also setting a maximum value for |
Can you record a quick video to show it in action? I'm curious. |
I accidently pressed the approve button sorry lol. |
…e (this will override map defaults).
Video of auto-fog/fade effect: https://youtu.be/hfmrBEGH9Dg I am not happy with this. I need to make the fog only turn on in the last 10% of the draw distance, and work with enhanced vision modes. But that will require intervention in the shader code. |
…aggressively kick in at half the maxdrawdist. This allowed for nearby fogdensity to be a lot less.
Soft, late-kick-in fog boundary, so the closer fog density is lower by 10x: https://youtu.be/n4GktOPwp_w Required an if-block in the main fragment shader. |
would it be at all possible to, optionally, make the render distance adjust itself based on current FPS vs monitor refresh rate? |
You mean an actual performance mode that can be toggled from the options menu? I don't know how to read the monitor refresh rate, but could probably copy the What does this look like from a UI perspective? The Options menu has an On/Off option for "Performance Mode", a number value for "Minimum FPS," and a color picker for "fog color"? And should I allow |
The other issue might be the something like nuts.wad isn't slow because of geometry, but merely because of too many actors. And a naive user toggling the performance mode will see no difference. I don't want any of this to affect playsim. Would a simple renaming like "performance rendering" help? |
it's not slow because of too many actors ticking, but because of too many actors rendering, so yes, this would help (you can verify it's the renderer by running it in software mode (without software mode lights enabled) at 320x200, it'll run fine) |
yeah, that
oh, i didn't realize that this completely disabled skyboxes, that might be a deal breaker yeah |
Added the ability to not draw any node in the BSP whose bounding box is farther from the viewpoint than a
maxdrawdist
value fromstruct Flevellocals
. Works in both hardware and software renderer modes.Demo of speed up in Frozen Time bridge scene on a 12-year old CPU: https://www.youtube.com/watch?v=2oUUpMxDngc
maxdrawdist
can be supplied fromMAPINFO
lump as well as changed from console live. It will persist through saved games. Default is set to-1
, and won't activate unless greater than0
.The absence of drawn regions will show up as void space with clearbuffer color (normally controlled by the existing CVar
r_clearbuffer
). If using fog, this color can be set to match the local or global fog fade color by either setting theLEVEL3_VOIDFADETOFOG
flag (setvoidfadetofog
inMAPINFO
lump) or settingr_clearbuffer
to5
.I wish I knew how to just replace the void space with a sky box but couldn't figure it out.