Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision
  • 21-installer-nodd
  • 2210-pre1
  • 2210-pre2
  • 2210-rc1
  • 2210-rc2
  • 2210-rc3
  • 622-teamlives-hud
  • 64-gl-log
  • COM_ImmedExecute-lua
  • DJGPP
  • IPv6
  • accel-momentum
  • alien-breed-3d
  • appveyor
  • blend-locking
  • blentran
  • blua-unary-not-fix
  • boost-tickrate
  • bustablesoundz
  • cleanup-opengl
  • cmake-improvements
  • crawlacommander-sprites
  • cutscene-cleanup
  • dd-music-bypass
  • dd-music-fix
  • deprecate-lua-dedicated-server
  • dpl-2
  • dropshadows-spawning
  • emblem-drawing
  • emblem-drawing-hud
  • exchndl-xp-fix
  • few-kart-lua-changes
  • ffloorclip
  • fix-cvar-conflicts
  • fix-opengl-shear-roll
  • fix-stagefailed-checking
  • flipfuncpointers
  • floorsprite-and-shadow-fake-planes-fix
  • fof-lightlist-fixes
  • font-FUCK
  • font_drawer
  • frictionrefactor
  • fuck-macros-1
  • fullscreen-toggle
  • gamepad_experiments
  • ghost-networking
  • gif-splitting
  • gravityflipping
  • grr-lj
  • hitboxviewer
  • hwr-texture-cache-refactor
  • hwrender2
  • improve-439
  • improve-439-again
  • increase-packet-tics
  • increase-unlockables
  • input-display
  • input-display-translucency
  • io
  • joystick-juggling-maz
  • keycodes-only
  • ksf-wadfiles
  • ld413-mp-fix
  • libpng-version-support
  • linedef-actions
  • lj-test
  • lol-states
  • loopedsounds
  • lower-unpegged-fix
  • lua-command-netids
  • lua-local
  • lua-minmax-plus-bruh-moments
  • macosx
  • makefile-auto-mingw-gcc
  • makefile-tinkering
  • map-components-signedness-fixes
  • master
  • master-OpenVR
  • menu-edits
  • mobj-dispoffset
  • modelsize
  • more-cleanup
  • musicdef-lua
  • net-test
  • netcode-tests
  • netxcmd-refactor
  • next
  • next-openvr
  • next-test-2021-7-11
  • nexttest
  • no-airwalking
  • nodepthset
  • nodoublecrumble
  • objectscale
  • pantelegraph
  • parser-fixes
  • patch-cache-refactor
  • pictureformats-software
  • pitch-roll
  • plane-scroller-tweaks
  • SRB2_release_2.1
  • SRB2_release_2.1.1
  • SRB2_release_2.1.10
  • SRB2_release_2.1.11
  • SRB2_release_2.1.12
  • SRB2_release_2.1.14
  • SRB2_release_2.1.15
  • SRB2_release_2.1.16
  • SRB2_release_2.1.16a
  • SRB2_release_2.1.17
  • SRB2_release_2.1.18
  • SRB2_release_2.1.19
  • SRB2_release_2.1.2
  • SRB2_release_2.1.20
  • SRB2_release_2.1.21
  • SRB2_release_2.1.22
  • SRB2_release_2.1.23
  • SRB2_release_2.1.24
  • SRB2_release_2.1.25
  • SRB2_release_2.1.3
  • SRB2_release_2.1.4
  • SRB2_release_2.1.5
  • SRB2_release_2.1.6
  • SRB2_release_2.1.7
  • SRB2_release_2.1.8
  • SRB2_release_2.1.9
  • SRB2_release_2.2.0
  • SRB2_release_2.2.1
  • SRB2_release_2.2.10
  • SRB2_release_2.2.2
  • SRB2_release_2.2.3
  • SRB2_release_2.2.4
  • SRB2_release_2.2.5
  • SRB2_release_2.2.6
  • SRB2_release_2.2.7
  • SRB2_release_2.2.8
  • SRB2_release_2.2.9
  • td-release-v1.0.0
138 results

Target

Select target project
  • STJr/SRB2
  • Sryder/SRB2
  • wolfy852/SRB2
  • Alpha2244/SRB2
  • Inuyasha/SRB2
  • yoshibot/SRB2
  • TehRealSalt/SRB2
  • PrisimaTF/SRB2
  • Hatninja/SRB2
  • SteelT/SRB2
  • james/SRB2
  • ShaderWraith/SRB2
  • SinnamonLat/SRB2
  • mazmazz_/SRB2
  • filpAM/SRB2
  • chaoloveicemdboy/SRB2
  • Whooa21/SRB2
  • Machturne/SRB2
  • Golden/SRB2
  • Tatsuru/SRB2
  • Snu/SRB2
  • Zwip-Zwap_Zapony/SRB2
  • fickleheart/SRB2
  • alphaRexJames/SRB2
  • JJK/SRB2
  • diskpoppy/SRB2
  • Hannu_Hanhi/SRB2
  • ZipperQR/SRB2
  • kays/SRB2
  • spherallic/SRB2
  • Zippy_Zolton/SRB2
  • namiishere/SRB2
  • Ors/SRB2
  • SMS_Alfredo/SRB2
  • sonic_edge/SRB2
  • lavla/SRB2
  • ashi/SRB2
  • X.organic/SRB2
  • Fafabis/SRB2
  • Meziu/SRB2
  • v-rob/SRB2
  • tertu/SRB2
  • bitten2up/SRB2
  • flarn2006/SRB2
  • Krabs/SRB2
  • clairebun/SRB2
  • Lactozilla/SRB2
  • thehackstack/SRB2
  • Spice/SRB2
  • win8linux/SRB2
  • JohnFrostFox/SRB2
  • talktoneon726/SRB2
  • Wane/SRB2
  • Lamibe/SRB2
  • spectrumuk2/srb-2
  • nerdyminer18/srb-2
  • 256nil/SRB2
  • ARJr/SRB2
  • Alam/SRB2
  • Zenya/srb-2-marathon-demos
  • Acelite/srb-2-archivedmodifications
  • MIDIMan/SRB2
  • Lach/SRB2
  • Frostiikin/bounce-tweaks
  • Jaden/SRB2
  • Tyron/SRB2
  • Astronight/SRB2
  • Mari0shi06/SRB2
  • aiire/SRB2
  • Galactice/SRB2
  • srb2-ports/srb2-dreamcast
  • sdasdas/SRB2
  • chreas/srb-2-vr
  • StarManiaKG/the-story-of-sinically-rocketing-and-botching-the-2nd
  • LoganAir/SRB2
  • NepDisk/srb-2
  • alufolie91/SRB2
  • Felicia.iso/SRB2
  • twi/SRB2
  • BarrelsOFun/SRB2
  • Speed2411/SRB2
  • Leather_Realms/SRB2
  • Ayemar/SRB2
  • Acelite/SRB2
  • VladDoc/SRB2
  • kaldrum/model-features
  • strawberryfox417/SRB2
  • Lugent/SRB2
  • Rem/SRB2
  • Refrag/SRB2
  • Henry_3230/srb-3230
  • TehPuertoRicanSpartan2/tprs-srb2
  • Leminn/srb-2-marathon-stuff
  • chromaticpipe2/SRB2
  • MiguelGustavo15/SRB2
  • Maru/srb-2-tests
  • SilicDev/SRB2
  • UnmatchedBracket/SRB2
  • HybridDog/SRB2
  • xordspar0/SRB2
  • jsjhbewfhh/SRB2
  • Fancy2209/SRB2
  • Lorsoen/SRB2
  • shindoukin/SRB2
  • GamerOfDays/SRB2
  • Craftyawesome/SRB2
  • tenshi-tensai-tennoji/SRB2
  • Scarfdudebalder/SRB2
  • luigi-budd/srb-2-fix-interplag-lockon
  • mskluesner/SRB2
  • johnpetersa19/SRB2
  • Pheazant/SRB2
  • chromaticpipe2/srb2classic
  • romoney5/SRB2
  • PAS/SRB2Classic
  • BlueStaggo/SRB2
  • Jisk/srb-2-beef-jerky
  • voltybystorm/SRB2
118 results
Select Git revision
  • 21-installer-nodd
  • 2210-pre1
  • 2210-pre2
  • 2210-rc1
  • 2210-rc2
  • 2210-rc3
  • 2211-pre1
  • 2211-pre2
  • 2211-rc1
  • 2212-pre1
  • 2212-pre2
  • 2212-pre3
  • 2212-rc1
  • 2213
  • 2214-pre1
  • 2214-pre2
  • 2214-pre3
  • 2214-pre4
  • 2_2_12
  • 64-gl-log
  • COM_ImmedExecute-lua
  • DJGPP
  • accel-momentum
  • acs
  • action-args
  • alpha-fixes
  • any-resolution
  • appveyor
  • better-distance-math
  • blend-locking
  • blentran
  • blua-unary-not-fix
  • boost-tickrate
  • bustablesoundz
  • cleanup-opengl
  • cleanupmusic
  • clipmidtex
  • cmake-valgrind
  • crawlacommander-sprites
  • custom-map-names
  • custom-teams
  • cutscene-cleanup
  • dd-music-bypass
  • dd-music-fix
  • delfile2
  • deprecate-lua-dedicated-server
  • dpl-2
  • dropshadows-spawning
  • dynabsp
  • emblem-drawing
  • exchndl-xp-fix
  • extra-textures
  • few-kart-lua-changes
  • ffloorclip
  • fix-167
  • fix-cvar-conflicts
  • fix-opengl-parameter-crash
  • fix-opengl-shear-roll
  • flipfuncpointers
  • fof-lightlist-fixes
  • font-FUCK
  • frictionrefactor
  • fuck-macros-1
  • gamepad-luakeydown
  • gamepad-morefixes
  • gamepad_experiments
  • gametype-refactor
  • gametype-refactor-1
  • gametype-refactor-player-spawns
  • ghost-networking
  • gif-splitting
  • grr-lj
  • hitboxviewer
  • hwr-texture-cache-refactor
  • hwrender2
  • improve-439
  • increase-maxconditionsets
  • increase-packet-tics
  • input-display
  • input-display-translucency
  • io
  • joystick-juggling-maz
  • just-in-case
  • keycodes-only
  • ksf-wadfiles
  • ld413-mp-fix
  • levelstruct
  • libpng-version-support
  • linedef-actions
  • lj-test
  • lol-states
  • loopedsounds
  • lower-unpegged-fix
  • lua-change-gametype
  • lua-command-netids
  • lua-gfx-2
  • lua-gfx-sprites
  • lua-local
  • makefile-auto-mingw-gcc
  • makefile-tinkering
  • SRB2_release_2.1
  • SRB2_release_2.1.1
  • SRB2_release_2.1.10
  • SRB2_release_2.1.11
  • SRB2_release_2.1.12
  • SRB2_release_2.1.14
  • SRB2_release_2.1.15
  • SRB2_release_2.1.16
  • SRB2_release_2.1.16a
  • SRB2_release_2.1.17
  • SRB2_release_2.1.18
  • SRB2_release_2.1.19
  • SRB2_release_2.1.2
  • SRB2_release_2.1.20
  • SRB2_release_2.1.21
  • SRB2_release_2.1.22
  • SRB2_release_2.1.23
  • SRB2_release_2.1.24
  • SRB2_release_2.1.25
  • SRB2_release_2.1.3
  • SRB2_release_2.1.4
  • SRB2_release_2.1.5
  • SRB2_release_2.1.6
  • SRB2_release_2.1.7
  • SRB2_release_2.1.8
  • SRB2_release_2.1.9
  • SRB2_release_2.2.0
  • SRB2_release_2.2.1
  • SRB2_release_2.2.10
  • SRB2_release_2.2.11
  • SRB2_release_2.2.12
  • SRB2_release_2.2.13
  • SRB2_release_2.2.15
  • SRB2_release_2.2.2
  • SRB2_release_2.2.3
  • SRB2_release_2.2.4
  • SRB2_release_2.2.5
  • SRB2_release_2.2.6
  • SRB2_release_2.2.7
  • SRB2_release_2.2.8
  • SRB2_release_2.2.9
  • td-release-v1.0.0
142 results
Show changes
Commits on Source (3)
Showing
with 574 additions and 45 deletions
File added
File added
File added
File added
File added
File added
File added
File added
File added
...@@ -9,9 +9,11 @@ opts+=-DUNIXCOMMON -DLUA_USE_POSIX ...@@ -9,9 +9,11 @@ opts+=-DUNIXCOMMON -DLUA_USE_POSIX
# instead of addresses # instead of addresses
libs+=-lm -rdynamic libs+=-lm -rdynamic
ifndef NOHW ifndef NOHW
opts+=-I/usr/X11R6/include opts+=-I/usr/X11R6/include
libs+=-L/usr/X11R6/lib libs+=-L/usr/X11R6/lib
#libs+=-L../../libs/openvr/libopenvr_api.so
endif endif
SDL?=1 SDL?=1
......
...@@ -25,6 +25,30 @@ opts+=-DDIRECTFULLSCREEN -DHAVE_SDL ...@@ -25,6 +25,30 @@ opts+=-DDIRECTFULLSCREEN -DHAVE_SDL
ifndef NOHW ifndef NOHW
sources+=sdl/ogl_sdl.c sources+=sdl/ogl_sdl.c
sources+=openvr/openvr_common.c openvr/openvr_common.h openvr/openvr_capi.h
endif
#LINK OPENVR LIBRARIES TO SDL/OPENGL
libs+=-lopenvr_api
ifdef LINUX
ifdef LINUX64
ifdef ARM64
LDFLAGS+=-L../libs/openvr/linuxarm64
else
LDFLAGS+=-L../libs/openvr/linux64
endif
else
LDFLAGS+=-L../libs/openvr/linux32
endif
endif
ifdef MINGW
ifdef MINGW64
LDFLAGS+=-L../libs/openvr/win64
else
LDFLAGS+=-L../libs/openvr/win32
endif
endif endif
ifdef NOMIXER ifdef NOMIXER
......
...@@ -60,7 +60,7 @@ endif ...@@ -60,7 +60,7 @@ endif
ifdef GCC45 ifdef GCC45
WFLAGS+=-Wlogical-op WFLAGS+=-Wlogical-op
endif endif
WFLAGS+=-Waggregate-return #WFLAGS+=-Waggregate-return
ifdef HAIKU ifdef HAIKU
ifdef GCC41 ifdef GCC41
#WFLAGS+=-Wno-attributes #WFLAGS+=-Wno-attributes
......
...@@ -81,6 +81,7 @@ ...@@ -81,6 +81,7 @@
#ifdef HWRENDER #ifdef HWRENDER
#include "hardware/hw_main.h" // 3D View Rendering #include "hardware/hw_main.h" // 3D View Rendering
#include "openvr/openvr_common.h"
#endif #endif
#ifdef _WINDOWS #ifdef _WINDOWS
...@@ -695,6 +696,13 @@ static void D_Display(void) ...@@ -695,6 +696,13 @@ static void D_Display(void)
I_FinishUpdate(); // page flip or blit buffer I_FinishUpdate(); // page flip or blit buffer
PS_STOP_TIMING(ps_swaptime); PS_STOP_TIMING(ps_swaptime);
} }
#ifdef HWRENDER
if(vrPendingErrorMessage[0])
{
CONS_Alert(CONS_ERROR, "%s", vrPendingErrorMessage);
vrPendingErrorMessage[0] = 0;
}
#endif
} }
// ========================================================================= // =========================================================================
......
...@@ -76,6 +76,7 @@ ...@@ -76,6 +76,7 @@
#include "../r_state.h" #include "../r_state.h"
#include "../tables.h" #include "../tables.h"
#include "r_opengl/r_opengl.h" #include "r_opengl/r_opengl.h"
#include "../openvr/openvr_common.h"
#ifdef HAVE_SPHEREFRUSTRUM #ifdef HAVE_SPHEREFRUSTRUM
static GLdouble viewMatrix[16]; static GLdouble viewMatrix[16];
...@@ -329,7 +330,7 @@ angle_t gld_FrustumAngle(angle_t tiltangle) ...@@ -329,7 +330,7 @@ angle_t gld_FrustumAngle(angle_t tiltangle)
// NEWCLIP TODO: SRB2CBTODO: make a global render_fov for this function // NEWCLIP TODO: SRB2CBTODO: make a global render_fov for this function
float render_fov = FIXED_TO_FLOAT(cv_fov.value); float render_fov = FIXED_TO_FLOAT(openvr_started ? 120 * FRACUNIT : cv_fov.value);
float render_fovratio = (float)BASEVIDWIDTH / (float)BASEVIDHEIGHT; // SRB2CBTODO: NEWCLIPTODO: Is this right? float render_fovratio = (float)BASEVIDWIDTH / (float)BASEVIDHEIGHT; // SRB2CBTODO: NEWCLIPTODO: Is this right?
float render_multiplier = 64.0f / render_fovratio / RMUL; float render_multiplier = 64.0f / render_fovratio / RMUL;
......
...@@ -64,6 +64,11 @@ EXPORT void HWRAPI(DrawIntermissionBG) (void); ...@@ -64,6 +64,11 @@ EXPORT void HWRAPI(DrawIntermissionBG) (void);
EXPORT void HWRAPI(MakeScreenTexture) (void); EXPORT void HWRAPI(MakeScreenTexture) (void);
EXPORT void HWRAPI(MakeScreenFinalTexture) (void); EXPORT void HWRAPI(MakeScreenFinalTexture) (void);
EXPORT void HWRAPI(DrawScreenFinalTexture) (int width, int height); EXPORT void HWRAPI(DrawScreenFinalTexture) (int width, int height);
EXPORT void HWRAPI(MakeViewTexture) (void);
EXPORT void HWRAPI(SetEye) (int);
EXPORT void HWRAPI(SubmitTextureToHMD) (void);
EXPORT void HWRAPI(ProjectUI)(int width, int height);
#define SCREENVERTS 10 #define SCREENVERTS 10
EXPORT void HWRAPI(PostImgRedraw) (float points[SCREENVERTS][SCREENVERTS][2]); EXPORT void HWRAPI(PostImgRedraw) (float points[SCREENVERTS][SCREENVERTS][2]);
...@@ -119,6 +124,7 @@ struct hwdriver_s ...@@ -119,6 +124,7 @@ struct hwdriver_s
MakeScreenTexture pfnMakeScreenTexture; MakeScreenTexture pfnMakeScreenTexture;
MakeScreenFinalTexture pfnMakeScreenFinalTexture; MakeScreenFinalTexture pfnMakeScreenFinalTexture;
DrawScreenFinalTexture pfnDrawScreenFinalTexture; DrawScreenFinalTexture pfnDrawScreenFinalTexture;
MakeViewTexture pfnMakeViewTexture;
CompileShaders pfnCompileShaders; CompileShaders pfnCompileShaders;
CleanShaders pfnCleanShaders; CleanShaders pfnCleanShaders;
...@@ -127,6 +133,10 @@ struct hwdriver_s ...@@ -127,6 +133,10 @@ struct hwdriver_s
SetShaderInfo pfnSetShaderInfo; SetShaderInfo pfnSetShaderInfo;
LoadCustomShader pfnLoadCustomShader; LoadCustomShader pfnLoadCustomShader;
SetEye pfnSetEye;
SubmitTextureToHMD pfnSubmitTextureToHMD;
ProjectUI pfnProjectUI;
}; };
extern struct hwdriver_s hwdriver; extern struct hwdriver_s hwdriver;
......
...@@ -42,6 +42,7 @@ ...@@ -42,6 +42,7 @@
#include "../d_main.h" #include "../d_main.h"
#include "../p_slopes.h" #include "../p_slopes.h"
#include "hw_md2.h" #include "hw_md2.h"
#include "../openvr/openvr_common.h"
#ifdef NEWCLIP #ifdef NEWCLIP
#include "hw_clip.h" #include "hw_clip.h"
...@@ -172,6 +173,8 @@ boolean gl_maploaded = false; ...@@ -172,6 +173,8 @@ boolean gl_maploaded = false;
boolean gl_sessioncommandsadded = false; boolean gl_sessioncommandsadded = false;
boolean gl_shadersavailable = true; boolean gl_shadersavailable = true;
boolean is_drawing_sky = false;
// ========================================================================== // ==========================================================================
// Lighting // Lighting
// ========================================================================== // ==========================================================================
...@@ -5876,6 +5879,8 @@ void HWR_BuildSkyDome(void) ...@@ -5876,6 +5879,8 @@ void HWR_BuildSkyDome(void)
static void HWR_DrawSkyBackground(player_t *player) static void HWR_DrawSkyBackground(player_t *player)
{ {
if(cv_vrcomfortmode.value) return;
HWD.pfnSetBlend(PF_Translucent|PF_NoDepthTest|PF_Modulated); HWD.pfnSetBlend(PF_Translucent|PF_NoDepthTest|PF_Modulated);
if (cv_glskydome.value) if (cv_glskydome.value)
...@@ -6039,6 +6044,15 @@ static inline void HWR_ClearView(void) ...@@ -6039,6 +6044,15 @@ static inline void HWR_ClearView(void)
// HWD.pfnGClipRect(0, 0, vid.width, vid.height); // HWD.pfnGClipRect(0, 0, vid.width, vid.height);
} }
// -----------------+
// HWR_SetEye : set vr eye frame buffer
// -----------------+
void HWR_SetEye(int eye)
{
HWD.pfnSetEye(eye);
}
// -----------------+ // -----------------+
// HWR_SetViewSize : set projection and scaling values // HWR_SetViewSize : set projection and scaling values
...@@ -6216,7 +6230,15 @@ void HWR_RenderSkyboxView(INT32 viewnumber, player_t *player) ...@@ -6216,7 +6230,15 @@ void HWR_RenderSkyboxView(INT32 viewnumber, player_t *player)
{ {
angle_t a1 = gld_FrustumAngle(gl_aimingangle); angle_t a1 = gld_FrustumAngle(gl_aimingangle);
gld_clipper_Clear(); gld_clipper_Clear();
// Modify the viewangle based on the HMD's look direction.
// Use atan2 to get the angle (in radians) from HMD pose,
// then normalize and multiply by ANGLE_MAX so the game can use it.
if(openvr_started && cv_vrspriterotate.value)
{
viewangle -= ANGLE_MAX * atan2(vrHMDPoseMatrix[8], vrHMDPoseMatrix[0]) / M_PI * 0.5;
}
gld_clipper_SafeAddClipRange(viewangle + a1, viewangle - a1); gld_clipper_SafeAddClipRange(viewangle + a1, viewangle - a1);
#ifdef HAVE_SPHEREFRUSTRUM #ifdef HAVE_SPHEREFRUSTRUM
gld_FrustrumSetup(); gld_FrustrumSetup();
#endif #endif
...@@ -6333,6 +6355,7 @@ void HWR_RenderPlayerView(INT32 viewnumber, player_t *player) ...@@ -6333,6 +6355,7 @@ void HWR_RenderPlayerView(INT32 viewnumber, player_t *player)
if (viewnumber == 0) // Only do it if it's the first screen being rendered if (viewnumber == 0) // Only do it if it's the first screen being rendered
HWD.pfnClearBuffer(true, false, &ClearColor); // Clear the Color Buffer, stops HOMs. Also seems to fix the skybox issue on Intel GPUs. HWD.pfnClearBuffer(true, false, &ClearColor); // Clear the Color Buffer, stops HOMs. Also seems to fix the skybox issue on Intel GPUs.
is_drawing_sky = true;
PS_START_TIMING(ps_hw_skyboxtime); PS_START_TIMING(ps_hw_skyboxtime);
if (skybox && drawsky) // If there's a skybox and we should be drawing the sky, draw the skybox if (skybox && drawsky) // If there's a skybox and we should be drawing the sky, draw the skybox
HWR_RenderSkyboxView(viewnumber, player); // This is drawn before everything else so it is placed behind HWR_RenderSkyboxView(viewnumber, player); // This is drawn before everything else so it is placed behind
...@@ -6348,6 +6371,7 @@ void HWR_RenderPlayerView(INT32 viewnumber, player_t *player) ...@@ -6348,6 +6371,7 @@ void HWR_RenderPlayerView(INT32 viewnumber, player_t *player)
HWR_SetLights(viewnumber); HWR_SetLights(viewnumber);
#endif #endif
} }
is_drawing_sky = false;
// note: sets viewangle, viewx, viewy, viewz // note: sets viewangle, viewx, viewy, viewz
R_SetupFrame(player); R_SetupFrame(player);
...@@ -6417,8 +6441,10 @@ void HWR_RenderPlayerView(INT32 viewnumber, player_t *player) ...@@ -6417,8 +6441,10 @@ void HWR_RenderPlayerView(INT32 viewnumber, player_t *player)
//------------------------------------------------------------------------ //------------------------------------------------------------------------
HWR_ClearView(); // Clears the depth buffer and resets the view I believe HWR_ClearView(); // Clears the depth buffer and resets the view I believe
is_drawing_sky = true;
if (!skybox && drawsky) // Don't draw the regular sky if there's a skybox if (!skybox && drawsky) // Don't draw the regular sky if there's a skybox
HWR_DrawSkyBackground(player); HWR_DrawSkyBackground(player);
is_drawing_sky = false;
//Hurdler: it doesn't work in splitscreen mode //Hurdler: it doesn't work in splitscreen mode
drawsky = splitscreen; drawsky = splitscreen;
...@@ -6432,11 +6458,18 @@ void HWR_RenderPlayerView(INT32 viewnumber, player_t *player) ...@@ -6432,11 +6458,18 @@ void HWR_RenderPlayerView(INT32 viewnumber, player_t *player)
{ {
angle_t a1 = gld_FrustumAngle(gl_aimingangle); angle_t a1 = gld_FrustumAngle(gl_aimingangle);
gld_clipper_Clear(); gld_clipper_Clear();
// Modify the viewangle based on the HMD's look direction.
// Use atan2 to get the angle (in radians) from HMD pose,
// then normalize and multiply by ANGLE_MAX so the game can use it.
if(openvr_started && cv_vrspriterotate.value)
{
viewangle -= ANGLE_MAX * atan2(vrHMDPoseMatrix[8], vrHMDPoseMatrix[0]) / M_PI * 0.5;
gld_clipper_SafeAddClipRange(viewangle + a1, viewangle - a1); gld_clipper_SafeAddClipRange(viewangle + a1, viewangle - a1);
#ifdef HAVE_SPHEREFRUSTRUM #ifdef HAVE_SPHEREFRUSTRUM
gld_FrustrumSetup(); gld_FrustrumSetup();
#endif #endif
} }
}
#else #else
HWR_ClearClipSegs(); HWR_ClearClipSegs();
#endif #endif
...@@ -6535,6 +6568,7 @@ void HWR_RenderPlayerView(INT32 viewnumber, player_t *player) ...@@ -6535,6 +6568,7 @@ void HWR_RenderPlayerView(INT32 viewnumber, player_t *player)
// added by Hurdler for correct splitscreen // added by Hurdler for correct splitscreen
// moved here by hurdler so it works with the new near clipping plane // moved here by hurdler so it works with the new near clipping plane
HWD.pfnGClipRect(0, 0, vid.width, vid.height, NZCLIP_PLANE); HWD.pfnGClipRect(0, 0, vid.width, vid.height, NZCLIP_PLANE);
if(openvr_started) HWD.pfnMakeViewTexture();
} }
void HWR_LoadLevel(void) void HWR_LoadLevel(void)
...@@ -6950,6 +6984,9 @@ void HWR_DoWipe(UINT8 wipenum, UINT8 scrnnum) ...@@ -6950,6 +6984,9 @@ void HWR_DoWipe(UINT8 wipenum, UINT8 scrnnum)
return; return;
HWR_GetFadeMask(wipelumpnum); HWR_GetFadeMask(wipelumpnum);
if(openvr_started)
openvr_compositor()->ClearLastSubmittedFrame();
HWD.pfnDoScreenWipe(); HWD.pfnDoScreenWipe();
} }
...@@ -6969,6 +7006,16 @@ void HWR_DrawScreenFinalTexture(int width, int height) ...@@ -6969,6 +7006,16 @@ void HWR_DrawScreenFinalTexture(int width, int height)
HWD.pfnDrawScreenFinalTexture(width, height); HWD.pfnDrawScreenFinalTexture(width, height);
} }
void HWR_SubmitTextureToHMD(void)
{
HWD.pfnSubmitTextureToHMD();
}
void HWR_ProjectUI(int width, int height)
{
HWD.pfnProjectUI(width, height);
}
static inline UINT16 HWR_FindShaderDefs(UINT16 wadnum) static inline UINT16 HWR_FindShaderDefs(UINT16 wadnum)
{ {
UINT16 i; UINT16 i;
......
...@@ -38,6 +38,7 @@ void HWR_BuildSkyDome(void); ...@@ -38,6 +38,7 @@ void HWR_BuildSkyDome(void);
void HWR_DrawViewBorder(INT32 clearlines); void HWR_DrawViewBorder(INT32 clearlines);
void HWR_DrawFlatFill(INT32 x, INT32 y, INT32 w, INT32 h, lumpnum_t flatlumpnum); void HWR_DrawFlatFill(INT32 x, INT32 y, INT32 w, INT32 h, lumpnum_t flatlumpnum);
void HWR_InitTextureMapping(void); void HWR_InitTextureMapping(void);
void HWR_SetEye(int eye);
void HWR_SetViewSize(void); void HWR_SetViewSize(void);
void HWR_DrawPatch(patch_t *gpatch, INT32 x, INT32 y, INT32 option); void HWR_DrawPatch(patch_t *gpatch, INT32 x, INT32 y, INT32 option);
void HWR_DrawStretchyFixedPatch(patch_t *gpatch, fixed_t x, fixed_t y, fixed_t pscale, fixed_t vscale, INT32 option, const UINT8 *colormap); void HWR_DrawStretchyFixedPatch(patch_t *gpatch, fixed_t x, fixed_t y, fixed_t pscale, fixed_t vscale, INT32 option, const UINT8 *colormap);
...@@ -75,6 +76,9 @@ FBITFIELD HWR_GetBlendModeFlag(INT32 style); ...@@ -75,6 +76,9 @@ FBITFIELD HWR_GetBlendModeFlag(INT32 style);
FBITFIELD HWR_SurfaceBlend(INT32 style, INT32 transtablenum, FSurfaceInfo *pSurf); FBITFIELD HWR_SurfaceBlend(INT32 style, INT32 transtablenum, FSurfaceInfo *pSurf);
FBITFIELD HWR_TranstableToAlpha(INT32 transtablenum, FSurfaceInfo *pSurf); FBITFIELD HWR_TranstableToAlpha(INT32 transtablenum, FSurfaceInfo *pSurf);
void HWR_SubmitTextureToHMD(void);
void HWR_ProjectUI(int width, int height);
boolean HWR_CompileShaders(void); boolean HWR_CompileShaders(void);
void HWR_LoadAllCustomShaders(void); void HWR_LoadAllCustomShaders(void);
......
This diff is collapsed.
...@@ -51,6 +51,12 @@ void I_StartupGraphics(void); ...@@ -51,6 +51,12 @@ void I_StartupGraphics(void);
/** \brief shutdown video mode /** \brief shutdown video mode
*/ */
void I_ShutdownGraphics(void); void I_ShutdownGraphics(void);
#ifdef HWRENDER
void I_StartupVR(void);
void I_ChangeVRRenderSize(int mode);
void I_ChangeVRRenderScale(int mode);
void I_ShutdownVR(void);
#endif
/** \brief The I_SetPalette function /** \brief The I_SetPalette function
......
...@@ -326,7 +326,8 @@ static void M_VideoOptions(INT32 choice); ...@@ -326,7 +326,8 @@ static void M_VideoOptions(INT32 choice);
menu_t OP_VideoOptionsDef, OP_VideoModeDef, OP_ColorOptionsDef; menu_t OP_VideoOptionsDef, OP_VideoModeDef, OP_ColorOptionsDef;
#ifdef HWRENDER #ifdef HWRENDER
static void M_OpenGLOptionsMenu(void); static void M_OpenGLOptionsMenu(void);
menu_t OP_OpenGLOptionsDef; static void M_OpenVROptionsMenu(void);
menu_t OP_OpenGLOptionsDef, OP_VROptionsDef;
#ifdef ALAM_LIGHTING #ifdef ALAM_LIGHTING
menu_t OP_OpenGLLightingDef; menu_t OP_OpenGLLightingDef;
#endif // ALAM_LIGHTING #endif // ALAM_LIGHTING
...@@ -1286,6 +1287,7 @@ enum ...@@ -1286,6 +1287,7 @@ enum
#endif #endif
op_video_vsync, op_video_vsync,
op_video_renderer, op_video_renderer,
op_video_vr
}; };
static menuitem_t OP_VideoOptionsMenu[] = static menuitem_t OP_VideoOptionsMenu[] =
...@@ -1343,7 +1345,8 @@ static menuitem_t OP_VideoOptionsMenu[] = ...@@ -1343,7 +1345,8 @@ static menuitem_t OP_VideoOptionsMenu[] =
#ifdef HWRENDER #ifdef HWRENDER
{IT_HEADER, NULL, "Renderer", NULL, 208}, {IT_HEADER, NULL, "Renderer", NULL, 208},
{IT_CALL | IT_STRING, NULL, "OpenGL Options...", M_OpenGLOptionsMenu, 214}, {IT_CALL | IT_STRING, NULL, "OpenGL Options...", M_OpenGLOptionsMenu, 214},
{IT_STRING | IT_CVAR, NULL, "FPS Cap", &cv_fpscap, 219}, {IT_CALL | IT_STRING, NULL, "VR Options...", M_OpenVROptionsMenu, 219},
{IT_STRING | IT_CVAR, NULL, "FPS Cap", &cv_fpscap, 224},
#endif #endif
}; };
...@@ -1394,6 +1397,20 @@ static menuitem_t OP_ColorOptionsMenu[] = ...@@ -1394,6 +1397,20 @@ static menuitem_t OP_ColorOptionsMenu[] =
}; };
#ifdef HWRENDER #ifdef HWRENDER
static menuitem_t OP_VROptionsMenu[] =
{
{IT_STRING | IT_CVAR, NULL, "Virtual Reality", &cv_vrenabled, 10},
{IT_STRING | IT_CVAR, NULL, "World Scale", &cv_vrscale, 30},
{IT_STRING | IT_CVAR, NULL, "Scale World With Player", &cv_vrplayerscale, 40},
{IT_STRING | IT_CVAR, NULL, "UI Distance", &cv_vruidistance, 50},
{IT_STRING | IT_CVAR, NULL, "UI Scale", &cv_vruiscale, 60},
{IT_STRING | IT_CVAR, NULL, "Rotate Sprites With HMD", &cv_vrspriterotate, 70},
{IT_STRING | IT_CVAR, NULL, "Desktop Render Mode", &cv_vrviewmode, 80},
{IT_STRING | IT_CVAR, NULL, "Lock Camera Forward", &cv_glshearing, 90},
{IT_STRING | IT_CVAR, NULL, "Disable Skybox Stereoscopy", &cv_vrdisableskystereo, 100},
{IT_STRING | IT_CVAR, NULL, "Disable Skyboxes", &cv_vrcomfortmode, 110}
};
static menuitem_t OP_OpenGLOptionsMenu[] = static menuitem_t OP_OpenGLOptionsMenu[] =
{ {
{IT_HEADER, NULL, "3D Models", NULL, 0}, {IT_HEADER, NULL, "3D Models", NULL, 0},
...@@ -1418,6 +1435,18 @@ static menuitem_t OP_OpenGLOptionsMenu[] = ...@@ -1418,6 +1435,18 @@ static menuitem_t OP_OpenGLOptionsMenu[] =
#endif #endif
}; };
static void M_OpenVROptionsMenu(void)
{
if (rendermode == render_opengl)
M_SetupNextMenu(&OP_VROptionsDef);
else
M_StartMessage(M_GetText("You must be in OpenGL mode\nto access this menu.\n\n(Press a key)\n"), NULL, MM_NOTHING);
}
menu_t OP_VROptionsDef = DEFAULTMENUSTYLE(
MTREE3(MN_OP_MAIN, MN_OP_VIDEO, MN_OP_OPENVR),
"M_VIDEO", OP_VROptionsMenu, &OP_VideoOptionsDef, 30, 30);
#ifdef ALAM_LIGHTING #ifdef ALAM_LIGHTING
static menuitem_t OP_OpenGLLightingMenu[] = static menuitem_t OP_OpenGLLightingMenu[] =
{ {
...@@ -3911,6 +3940,14 @@ void M_Init(void) ...@@ -3911,6 +3940,14 @@ void M_Init(void)
quitmsg[QUIT3MSG5] = M_GetText("You'll be back to play soon, though...\n......right?\n\n(Press 'Y' to quit)"); quitmsg[QUIT3MSG5] = M_GetText("You'll be back to play soon, though...\n......right?\n\n(Press 'Y' to quit)");
quitmsg[QUIT3MSG6] = M_GetText("Aww, is Egg Rock Zone too\ndifficult for you?\n\n(Press 'Y' to quit)"); quitmsg[QUIT3MSG6] = M_GetText("Aww, is Egg Rock Zone too\ndifficult for you?\n\n(Press 'Y' to quit)");
#ifdef HWRENDER
// Permanently hide some options based on render mode
if (rendermode == render_soft)
{
OP_VideoOptionsMenu[op_video_vr].status = IT_DISABLED;
}
#endif
/* /*
Well the menu sucks for forcing us to have an item set Well the menu sucks for forcing us to have an item set
at all if every item just calls the same function, and at all if every item just calls the same function, and
......