mirror of
https://github.com/DrBeef/ioq3quest.git
synced 2025-04-24 17:41:31 +00:00
Changed size of HUD buffer to increase performance
Console text should be visible again
This commit is contained in:
parent
239a348c68
commit
8839768f26
16 changed files with 70 additions and 60 deletions
|
@ -2,8 +2,8 @@
|
|||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.drbeef.ioq3quest"
|
||||
android:installLocation="preferExternal"
|
||||
android:versionCode="42"
|
||||
android:versionName="0.29.3">
|
||||
android:versionCode="43"
|
||||
android:versionName="0.30.0">
|
||||
<uses-feature android:name="android.hardware.vr.headtracking" android:version="1" android:required="true" />
|
||||
<uses-feature android:glEsVersion="0x00030001" />
|
||||
<!-- <uses-feature android:name="oculus.software.overlay_keyboard" android:required="false"/>-->
|
||||
|
|
Binary file not shown.
|
@ -304,6 +304,8 @@ void CG_Draw3DModel( float x, float y, float w, float h, qhandle_t model, qhandl
|
|||
|
||||
refdef.time = cg.time;
|
||||
|
||||
refdef.isHUD = qtrue;
|
||||
|
||||
trap_R_ClearScene();
|
||||
trap_R_AddRefEntityToScene( &ent );
|
||||
trap_R_RenderScene( &refdef );
|
||||
|
@ -2890,7 +2892,7 @@ void CG_DrawActive( void ) {
|
|||
}
|
||||
|
||||
//Now draw the HUD shader in the world
|
||||
if (trap_Cvar_VariableValue("vr_hudDrawStatus") == 1.0f)
|
||||
if (trap_Cvar_VariableValue("vr_hudDrawStatus") != 2.0f)
|
||||
{
|
||||
refEntity_t ent;
|
||||
trace_t trace;
|
||||
|
|
|
@ -46,19 +46,17 @@ Adjusted for resolution and screen aspect ratio
|
|||
*/
|
||||
void CG_AdjustFrom640( float *x, float *y, float *w, float *h )
|
||||
{
|
||||
int hudDrawStatus = (int)trap_Cvar_VariableValue("vr_hudDrawStatus");
|
||||
//If using floating HUD and we are drawing it, then no need to scale as the HUD
|
||||
//buffer is 640x480
|
||||
float screenXScale = cgs.screenXScale;
|
||||
float screenYScale = cgs.screenYScale;
|
||||
if ( trap_Cvar_VariableValue("vr_hudDrawStatus") == 1.0f &&
|
||||
cg.drawingHUD)
|
||||
if ( hudDrawStatus == 1 && cg.drawingHUD)
|
||||
{
|
||||
screenXScale = 1.0f;
|
||||
screenYScale = 1.0f;
|
||||
return;
|
||||
}
|
||||
|
||||
if ( trap_Cvar_VariableValue("vr_hudDrawStatus") != 2.0f ||
|
||||
!cg.drawingHUD)
|
||||
if (!cg.drawingHUD)
|
||||
{
|
||||
*x *= screenXScale;
|
||||
*y *= screenYScale;
|
||||
|
|
|
@ -28,6 +28,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|||
int g_console_field_width = 78;
|
||||
|
||||
extern vr_clientinfo_t vr;
|
||||
extern cvar_t *vr_hudDrawStatus;
|
||||
|
||||
#define NUM_CON_TIMES 4
|
||||
|
||||
|
@ -555,12 +556,6 @@ void Con_DrawInput (void) {
|
|||
SCREEN_WIDTH - 3 * SMALLCHAR_WIDTH, qtrue, qtrue );
|
||||
}
|
||||
|
||||
|
||||
static int Con_GetChatOffsetY( void )
|
||||
{
|
||||
return vr.show_console ? (-30 * vr.hmdorientation[PITCH]) : 0;
|
||||
}
|
||||
|
||||
/*
|
||||
================
|
||||
Con_DrawNotify
|
||||
|
@ -582,6 +577,9 @@ void Con_DrawNotify (void)
|
|||
|
||||
re.HUDBufferStart(qfalse);
|
||||
|
||||
int xadjust = (vr_hudDrawStatus->integer != 1) ? 500 : 10;
|
||||
int yadjust = (vr_hudDrawStatus->integer != 1) ? 600 : 10;
|
||||
|
||||
v = 0;
|
||||
for (i= con.current-NUM_CON_TIMES+1 ; i<=con.current ; i++)
|
||||
{
|
||||
|
@ -607,7 +605,13 @@ void Con_DrawNotify (void)
|
|||
currentColor = ColorIndexForNumber( text[x]>>8 );
|
||||
re.SetColor( g_color_table[currentColor] );
|
||||
}
|
||||
SCR_DrawSmallChar( cl_conXOffset->integer + con.xadjust + (x+1)*SMALLCHAR_WIDTH + 500, v + Con_GetChatOffsetY(), text[x] & 0xff );
|
||||
|
||||
if (vr.show_console)
|
||||
{
|
||||
SCR_DrawSmallChar(
|
||||
cl_conXOffset->integer + con.xadjust + (x + 1) * SMALLCHAR_WIDTH + xadjust,
|
||||
v + yadjust, text[x] & 0xff);
|
||||
}
|
||||
}
|
||||
|
||||
v += SMALLCHAR_HEIGHT;
|
||||
|
|
|
@ -75,7 +75,7 @@ void SCR_AdjustFrom640( float *x, float *y, float *w, float *h ) {
|
|||
xscale = cls.glconfig.vidWidth / 640.0;
|
||||
yscale = cls.glconfig.vidHeight / 480.0;
|
||||
|
||||
if (vr.virtual_screen || vr_hudDrawStatus->integer == 1) {
|
||||
if (vr.virtual_screen || vr_hudDrawStatus->integer != 2) {
|
||||
if (x) {
|
||||
*x *= xscale;
|
||||
}
|
||||
|
|
|
@ -92,7 +92,7 @@ typedef struct {
|
|||
void (*EndFrame)( int *frontEndMsec, int *backEndMsec );
|
||||
|
||||
#if __ANDROID__
|
||||
void (*SetVRHeadsetParms)( const ovrMatrix4f *projectionMatrix,
|
||||
void (*SetVRHeadsetParms)( const ovrMatrix4f *projectionMatrix, const ovrMatrix4f *nonVRProjectionMatrix,
|
||||
int renderBuffer );
|
||||
#endif
|
||||
|
||||
|
|
|
@ -131,6 +131,8 @@ typedef struct {
|
|||
vec3_t vieworg;
|
||||
vec3_t viewaxis[3]; // transformation matrix
|
||||
|
||||
qboolean isHUD;
|
||||
|
||||
// time in milliseconds for shader effects and other time dependent rendering issues
|
||||
int time;
|
||||
|
||||
|
|
|
@ -26,8 +26,6 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|||
backEndData_t *backEndData;
|
||||
backEndState_t backEnd;
|
||||
|
||||
extern cvar_t *vr_hudDrawStatus;
|
||||
|
||||
static float s_flipMatrix[16] = {
|
||||
// convert from our coordinate system (looking down X)
|
||||
// to OpenGL's coordinate system (looking down -Z)
|
||||
|
@ -305,19 +303,11 @@ static void RB_Hyperspace( void ) {
|
|||
static void SetViewportAndScissor( void ) {
|
||||
GL_SetProjectionMatrix( backEnd.viewParms.projectionMatrix );
|
||||
|
||||
if (glState.isDrawingHUD && vr_hudDrawStatus->integer == 1)
|
||||
{
|
||||
qglViewport(0, 0, tr.hudImage->width, tr.hudImage->height);
|
||||
qglScissor(0, 0, tr.hudImage->width, tr.hudImage->height);
|
||||
}
|
||||
else
|
||||
{
|
||||
// set the window clipping
|
||||
qglViewport(backEnd.viewParms.viewportX, backEnd.viewParms.viewportY,
|
||||
backEnd.viewParms.viewportWidth, backEnd.viewParms.viewportHeight);
|
||||
qglScissor(backEnd.viewParms.viewportX, backEnd.viewParms.viewportY,
|
||||
backEnd.viewParms.viewportWidth, backEnd.viewParms.viewportHeight);
|
||||
}
|
||||
// set the window clipping
|
||||
qglViewport(backEnd.viewParms.viewportX, backEnd.viewParms.viewportY,
|
||||
backEnd.viewParms.viewportWidth, backEnd.viewParms.viewportHeight);
|
||||
qglScissor(backEnd.viewParms.viewportX, backEnd.viewParms.viewportY,
|
||||
backEnd.viewParms.viewportWidth, backEnd.viewParms.viewportHeight);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -636,7 +626,7 @@ void RB_SetGL2D (void) {
|
|||
}
|
||||
|
||||
// set 2D virtual screen size
|
||||
if (glState.isDrawingHUD && vr_hudDrawStatus->integer == 1)
|
||||
if (glState.isDrawingHUD && vr_hudDrawStatus->integer != 2)
|
||||
{
|
||||
qglViewport(0, 0, tr.hudImage->width, tr.hudImage->height);
|
||||
qglScissor(0, 0, tr.hudImage->width, tr.hudImage->height);
|
||||
|
@ -1768,8 +1758,6 @@ const void* RB_SwitchEye( const void* data ) {
|
|||
glState.currentFBO = tr.renderFbo;
|
||||
}
|
||||
|
||||
tr.refdef.stereoFrame = cmd->stereoFrame;
|
||||
|
||||
return (const void*)(cmd + 1);
|
||||
}
|
||||
|
||||
|
@ -1790,9 +1778,7 @@ const void* RB_HUDBuffer( const void* data ) {
|
|||
{
|
||||
glState.isDrawingHUD = qtrue;
|
||||
|
||||
//Only set the HUD buffer if we are using the in-world HUD otherwise
|
||||
//just flag we are drawing the hud
|
||||
if (vr_hudDrawStatus->integer == 1)
|
||||
if (vr_hudDrawStatus->integer != 2)
|
||||
{
|
||||
//keep record of current render fbo and switch to the hud buffer
|
||||
tr.backupFrameBuffer = tr.renderFbo->frameBuffer;
|
||||
|
@ -1827,7 +1813,7 @@ const void* RB_HUDBuffer( const void* data ) {
|
|||
{
|
||||
glState.isDrawingHUD = qfalse;
|
||||
|
||||
if (vr_hudDrawStatus->integer == 1)
|
||||
if (vr_hudDrawStatus->integer != 2)
|
||||
{
|
||||
//restore the true render fbo
|
||||
tr.renderFbo->frameBuffer = tr.backupFrameBuffer;
|
||||
|
|
|
@ -429,8 +429,6 @@ void RE_BeginFrame( stereoFrame_t stereoFrame ) {
|
|||
}
|
||||
}
|
||||
|
||||
tr.refdef.stereoFrame = stereoFrame;
|
||||
|
||||
GLSL_PrepareUniformBuffers();
|
||||
}
|
||||
|
||||
|
@ -516,9 +514,10 @@ void R_Mat4Transpose( const float in[4][4], float* out ) {
|
|||
}
|
||||
|
||||
|
||||
void RE_SetVRHeadsetParms( const ovrMatrix4f *projectionMatrix,
|
||||
void RE_SetVRHeadsetParms( const ovrMatrix4f *projectionMatrix, const ovrMatrix4f *nonVRProjectionMatrix,
|
||||
int renderBuffer ) {
|
||||
R_Mat4Transpose(projectionMatrix->M, tr.vrParms.projection);
|
||||
R_Mat4Transpose(nonVRProjectionMatrix->M, tr.vrParms.monoVRProjection);
|
||||
tr.vrParms.renderBuffer = renderBuffer;
|
||||
tr.vrParms.valid = qtrue;
|
||||
}
|
||||
|
|
|
@ -56,10 +56,6 @@ extern const char *fallbackShader_texturecolor_fp;
|
|||
extern const char *fallbackShader_tonemap_vp;
|
||||
extern const char *fallbackShader_tonemap_fp;
|
||||
|
||||
extern cvar_t *vr_hudDepth;
|
||||
extern cvar_t *vr_hudDrawStatus;
|
||||
extern vr_clientinfo_t vr;
|
||||
|
||||
typedef struct uniformInfo_s
|
||||
{
|
||||
char *name;
|
||||
|
@ -1704,8 +1700,9 @@ void GLSL_PrepareUniformBuffers(void)
|
|||
GLSL_ProjectionMatricesUniformBuffer(projectionMatricesBuffer[VR_PROJECTION],
|
||||
tr.vrParms.projection);
|
||||
|
||||
//Used for drawing models
|
||||
GLSL_ProjectionMatricesUniformBuffer(projectionMatricesBuffer[MONO_VR_PROJECTION],
|
||||
tr.vrParms.projection);
|
||||
tr.vrParms.monoVRProjection);
|
||||
|
||||
//Set all view matrices
|
||||
GLSL_ViewMatricesUniformBuffer(tr.viewParms.world.eyeViewMatrix, tr.viewParms.world.modelView);
|
||||
|
@ -1733,7 +1730,7 @@ static GLuint GLSL_CalculateProjection() {
|
|||
{
|
||||
if (glState.isDrawingHUD)
|
||||
{
|
||||
if (vr_hudDrawStatus->integer == 1)
|
||||
if (vr_hudDrawStatus->integer != 2)
|
||||
{
|
||||
result = HUDBUFFER_ORTHO_PROJECTION;
|
||||
}
|
||||
|
|
|
@ -35,6 +35,11 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|||
#include "tr_postprocess.h"
|
||||
#include "../renderercommon/iqm.h"
|
||||
#include "../renderercommon/qgl.h"
|
||||
#include "../vr/vr_clientinfo.h"
|
||||
|
||||
extern cvar_t *vr_hudDepth;
|
||||
extern cvar_t *vr_hudDrawStatus;
|
||||
extern vr_clientinfo_t vr;
|
||||
|
||||
#define GLE(ret, name, ...) extern name##proc * qgl##name;
|
||||
QGL_1_1_PROCS;
|
||||
|
@ -732,7 +737,7 @@ typedef struct {
|
|||
vec3_t vieworg;
|
||||
vec3_t viewaxis[3]; // transformation matrix
|
||||
|
||||
stereoFrame_t stereoFrame;
|
||||
qboolean isHUD;
|
||||
|
||||
int time; // time in milliseconds for shader effects and other time dependent rendering issues
|
||||
int rdflags; // RDF_NOWORLDMODEL, etc
|
||||
|
@ -846,6 +851,7 @@ typedef struct {
|
|||
typedef struct {
|
||||
qboolean valid;
|
||||
float projection[16];
|
||||
float monoVRProjection[16];
|
||||
int renderBuffer;
|
||||
int renderBufferOriginal;
|
||||
} vrParms_t;
|
||||
|
@ -2528,7 +2534,7 @@ void RE_StretchPic ( float x, float y, float w, float h,
|
|||
void RE_BeginFrame( stereoFrame_t stereoFrame );
|
||||
void RE_EndFrame( int *frontEndMsec, int *backEndMsec );
|
||||
#if __ANDROID__
|
||||
void RE_SetVRHeadsetParms( const ovrMatrix4f *projectionMatrix,
|
||||
void RE_SetVRHeadsetParms( const ovrMatrix4f *projectionMatrix, const ovrMatrix4f *nonVRProjectionMatrix,
|
||||
int renderBuffer );
|
||||
#endif
|
||||
void RE_HUDBufferStart( qboolean clear );
|
||||
|
|
|
@ -294,6 +294,7 @@ void RE_BeginScene(const refdef_t *fd)
|
|||
tr.refdef.height = fd->height;
|
||||
tr.refdef.fov_x = fd->fov_x;
|
||||
tr.refdef.fov_y = fd->fov_y;
|
||||
tr.refdef.isHUD = fd->isHUD;
|
||||
|
||||
VectorCopy( fd->vieworg, tr.refdef.vieworg );
|
||||
VectorCopy( fd->viewaxis[0], tr.refdef.viewaxis[0] );
|
||||
|
@ -539,10 +540,21 @@ void RE_RenderScene( const refdef_t *fd ) {
|
|||
// convert to GL's 0-at-the-bottom space
|
||||
//
|
||||
Com_Memset( &parms, 0, sizeof( parms ) );
|
||||
parms.viewportX = tr.refdef.x;
|
||||
parms.viewportY = glConfig.vidHeight - ( tr.refdef.y + tr.refdef.height );
|
||||
parms.viewportWidth = tr.refdef.width;
|
||||
parms.viewportHeight = tr.refdef.height;
|
||||
|
||||
if (vr_hudDrawStatus->integer != 2 && tr.refdef.isHUD)
|
||||
{
|
||||
parms.viewportX = tr.refdef.x;
|
||||
parms.viewportY = tr.hudImage->height - (tr.refdef.y + tr.refdef.height);
|
||||
parms.viewportWidth = tr.refdef.width;
|
||||
parms.viewportHeight = tr.refdef.height;
|
||||
}
|
||||
else
|
||||
{
|
||||
parms.viewportX = tr.refdef.x;
|
||||
parms.viewportY = glConfig.vidHeight - (tr.refdef.y + tr.refdef.height);
|
||||
parms.viewportWidth = tr.refdef.width;
|
||||
parms.viewportHeight = tr.refdef.height;
|
||||
}
|
||||
parms.isPortal = qfalse;
|
||||
|
||||
parms.fovX = tr.refdef.fov_x;
|
||||
|
|
|
@ -85,7 +85,7 @@ void VR_InitCvars( void )
|
|||
vr_weaponSelectorMode = Cvar_Get ("vr_weaponSelectorMode", "0", CVAR_ARCHIVE);
|
||||
vr_weaponSelectorWithHud = Cvar_Get ("vr_weaponSelectorWithHud", "0", CVAR_ARCHIVE);
|
||||
vr_goreLevel = Cvar_Get ("vr_goreLevel", "2", CVAR_ARCHIVE);
|
||||
vr_hudDrawStatus = Cvar_Get ("vr_hudDrawStatus", "2", CVAR_ARCHIVE); // 0 - no hud, 1 - in-world hud, 2 - performance (static HUD)
|
||||
vr_hudDrawStatus = Cvar_Get ("vr_hudDrawStatus", "1", CVAR_ARCHIVE); // 0 - no hud, 1 - in-world hud, 2 - performance (static HUD)
|
||||
|
||||
// Values are: scale,right,up,forward,pitch,yaw,roll
|
||||
// VALUES PROVIDED BY SkillFur - Thank-you!
|
||||
|
|
|
@ -308,6 +308,10 @@ void VR_DrawFrame( engine_t* engine ) {
|
|||
const ovrMatrix4f projectionMatrix = ovrMatrix4f_CreateProjectionFov(
|
||||
fov_x / vr.weapon_zoomLevel, fov_y / vr.weapon_zoomLevel, 0.0f, 0.0f, 1.0f, 0.0f );
|
||||
|
||||
//Projection used for drawing HUD models etc
|
||||
const ovrMatrix4f monoVRMatrix = ovrMatrix4f_CreateProjectionFov(
|
||||
30.0f, 30.0f, 0.0f, 0.0f, 1.0f, 0.0f );
|
||||
|
||||
int eyeW, eyeH;
|
||||
VR_GetResolution(engine, &eyeW, &eyeH);
|
||||
|
||||
|
@ -334,7 +338,7 @@ void VR_DrawFrame( engine_t* engine ) {
|
|||
frameDesc.LayerCount = 1;
|
||||
frameDesc.Layers = layers;
|
||||
|
||||
re.SetVRHeadsetParms(&projectionMatrix,
|
||||
re.SetVRHeadsetParms(&projectionMatrix, &monoVRMatrix,
|
||||
engine->framebuffers.framebuffers[engine->framebuffers.swapchainIndex]);
|
||||
|
||||
Com_Frame();
|
||||
|
@ -365,7 +369,7 @@ void VR_DrawFrame( engine_t* engine ) {
|
|||
|
||||
VR_ClearFrameBuffer(engine->framebuffers.framebuffers[engine->framebuffers.swapchainIndex], eyeW, eyeH);
|
||||
|
||||
re.SetVRHeadsetParms(&projectionMatrix,
|
||||
re.SetVRHeadsetParms(&projectionMatrix, &monoVRMatrix,
|
||||
engine->framebuffers.framebuffers[engine->framebuffers.swapchainIndex]);
|
||||
|
||||
Com_Frame();
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
|
||||
setlocal
|
||||
|
||||
set BUILD_TYPE=debug
|
||||
set VERSION=0.29.3-multiview
|
||||
set BUILD_TYPE=release
|
||||
set VERSION=0.30.0-multiview
|
||||
|
||||
@REM Define the following environment variables to sign a release build
|
||||
@REM set KEYSTORE=
|
||||
|
|
Loading…
Reference in a new issue