Consolidated isometric mode commits #80
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Copy-paste from previous closed PR:
I am making a separate PR for VkDoom since any potential commits to GZDoom from ZDoom/gzdoom#2618 can't be automatically pulled in. The file structures and some function arguments have diverged between the two engines.
Features video: https://youtu.be/tpbVlzMbpcg
PWAD that lets you play your favorite wads like this (I've been testing this with a lot of mods. It just works): https://github.com/dileepvr/DRSGME
Consequential Changes in a nutshell (level mesh untouched, so this only works with
gl_levelmesh
set to0
):viewpos
has two new flags:VPSF_ALLOWOUTOFBOUNDS
andVPSF_ORTHOGRAPHIC
.VPSF_ALLOWOUTOFBOUNDS
flag controls a lot of things, like disabling floor or ceiling rendering depending on sign ofviewpos
pitch. Camera actor position still needs to be inside bounds. Onlyviewpos
can be outside.VPSF_ALLOWOUTOFBOUNDS
flag is active. A vertical clipper has also been added. Alternate angle and pitch functions for clipper exist forVPSF_ORTHOGRAPHIC
flag. BSP calculations also have new alternative functions forVPSF_ORTHOGRAPHIC
flag. A third clipper (dubbed 'radarclipper') meant to keep track of visibility fromcamera.tracer
instead of fromviewpoint
has been added.VPSF_ORTHOGRAPHIC
flag is set. Playsim unaffected.RF2_ISOMETRICSPRITE
flag to do some transformations on the sprites (rotations and displacements towards camera) if desired.r_radarclipper
andr_dithertransparency
.r_radarclipper
enables a fog-of-war effect by not rendering subsectors not seen bycamera.tracer
. This can be disabled by setting theLEVEL3_NOFOGOFWAR
flag inLevelLocals
. A seen subsector is then rendered persistently unless clipped.deathmatch
overrides this persistence.EFF_DITHERTRANS
has been created. Allsidedef
have aWALLF_DITHERTRANS
flag and all sectorfloorplane
andceilingplane
have adithertransflag
boolean. If these are set, the effect is applied and the flag is cleared every frame. So the effect has to be asserted every frame.r_dithertransparency
if true shoots six line tracers towards the camera from thecamera.tracer
actor as well as any hostile actor that thecamera.tracer
can see. Allsidedef
, floors, and ceilings that intersect it get their dithering transparency flags set. This makes occluding level geometry temporarily translucent. ATRACE_ContinueOutOfBounds
type has been added toLineTrace
for this to work. This has not been exposed to zscript.The two CVars could just be replaced by map flags in
LevelLocals
but this would prevent their effect from working on all existing maps. The dithering transparency effect is also unique in that no other effect in the engine is getting reset and needs re-assertion every frame. The addition made the main cleaned up shader file a little bit messy. Some of that code could be moved to a separate file.I wouldn't know how to dynamically apply and revoke per-surface effects to a mesh, or not render subsectors that haven't been seen yet. So I did not touch the
levelmesh
code.