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

Consolidated isometric mode commits #80

Merged
merged 1 commit into from
Aug 11, 2024

Conversation

dileepvr
Copy link
Contributor

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 to 0):

  1. Camera viewpos has two new flags: VPSF_ALLOWOUTOFBOUNDS and VPSF_ORTHOGRAPHIC.
  2. The VPSF_ALLOWOUTOFBOUNDS flag controls a lot of things, like disabling floor or ceiling rendering depending on sign of viewpos pitch. Camera actor position still needs to be inside bounds. Only viewpos can be outside.
  3. Clipping within the view frustum is also disabled when VPSF_ALLOWOUTOFBOUNDS flag is active. A vertical clipper has also been added. Alternate angle and pitch functions for clipper exist for VPSF_ORTHOGRAPHIC flag. BSP calculations also have new alternative functions for VPSF_ORTHOGRAPHIC flag. A third clipper (dubbed 'radarclipper') meant to keep track of visibility from camera.tracer instead of from viewpoint has been added.
  4. Rending portals including skies is disabled when VPSF_ORTHOGRAPHIC flag is set. Playsim unaffected.
  5. Actors have an RF2_ISOMETRICSPRITE flag to do some transformations on the sprites (rotations and displacements towards camera) if desired.
  6. Two boolean CVars created: r_radarclipper and r_dithertransparency.
  7. r_radarclipper enables a fog-of-war effect by not rendering subsectors not seen by camera.tracer. This can be disabled by setting the LEVEL3_NOFOGOFWAR flag in LevelLocals. A seen subsector is then rendered persistently unless clipped. deathmatch overrides this persistence.
  8. This is the big one: A new shader effect called EFF_DITHERTRANS has been created. All sidedef have a WALLF_DITHERTRANS flag and all sector floorplane and ceilingplane have a dithertransflag 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.
  9. The CVar r_dithertransparency if true shoots six line tracers towards the camera from the camera.tracer actor as well as any hostile actor that the camera.tracer can see. All sidedef, floors, and ceilings that intersect it get their dithering transparency flags set. This makes occluding level geometry temporarily translucent. A TRACE_ContinueOutOfBounds type has been added to LineTrace 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.

@dpjudas dpjudas merged commit 8a5e744 into dpjudas:master Aug 11, 2024
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants