Additional dyn lights changes

- Used correct dyn lights cvar now
- Default ScreenSize to 11 (transparent / alternative HUD mode)
This commit is contained in:
Simon 2020-04-27 19:10:21 +01:00
parent 92c100b12e
commit d739555967
25 changed files with 31 additions and 29 deletions

View file

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.drbeef.questzdoom"
android:versionCode="9"
android:versionName="0.5.2" android:installLocation="auto" >
android:versionCode="10"
android:versionName="0.5.3" android:installLocation="auto" >
<!-- Tell the system this app requires OpenGL ES 3.1. -->
<uses-feature android:glEsVersion="0x00030001" android:required="true"/>

View file

@ -81,12 +81,16 @@ static FMemArena DynLightArena(sizeof(FDynamicLight) * 200);
static TArray<FDynamicLight*> FreeList;
static FRandom randLight;
CUSTOM_CVAR (Bool, gl_lights, true, CVAR_ARCHIVE | CVAR_GLOBALCONFIG | CVAR_NOINITCALL)
//Default dynamic lights to false
CUSTOM_CVAR (Bool, vr_dynlights, false, CVAR_ARCHIVE | CVAR_GLOBALCONFIG | CVAR_NOINITCALL)
{
if (self) AActor::RecreateAllAttachedLights();
else AActor::DeleteAllAttachedLights();
}
//Original dynamic lights cvar does nothing
CVAR (Bool, gl_lights, false, CVAR_ARCHIVE | CVAR_GLOBALCONFIG)
//==========================================================================
//
//==========================================================================

View file

@ -4,7 +4,7 @@
#include "cycler.h"
#include "g_levellocals.h"
EXTERN_CVAR(Bool, gl_lights)
EXTERN_CVAR(Bool, vr_dynlights)
class FSerializer;

View file

@ -284,7 +284,7 @@ void GLWall::DrawDecal(DBaseDecal *decal)
}
// calculate dynamic light effect.
if (gl_lights && GLRenderer->mLightCount && !mDrawer->FixedColormap && gl_light_sprites)
if (vr_dynlights && GLRenderer->mLightCount && !mDrawer->FixedColormap && gl_light_sprites)
{
// Note: This should be replaced with proper shader based lighting.
double x, y;

View file

@ -323,7 +323,7 @@ void GLSceneDrawer::RenderScene(int recursion)
// if we don't have a persistently mapped buffer, we have to process all the dynamic lights up front,
// so that we don't have to do repeated map/unmap calls on the buffer.
bool haslights = GLRenderer->mLightCount > 0 && FixedColormap == CM_DEFAULT && gl_lights;
bool haslights = GLRenderer->mLightCount > 0 && FixedColormap == CM_DEFAULT && vr_dynlights;
if (gl.lightmethod == LM_DEFERRED && haslights)
{
GLRenderer->mLights->Begin();

View file

@ -271,7 +271,7 @@ void GLSprite::Draw(int pass)
{
if (RenderStyle.BlendOp != STYLEOP_Shadow)
{
if (gl_lights && GLRenderer->mLightCount && mDrawer->FixedColormap == CM_DEFAULT && !fullbright)
if (vr_dynlights && GLRenderer->mLightCount && mDrawer->FixedColormap == CM_DEFAULT && !fullbright)
{
if (!particle)
{
@ -356,7 +356,7 @@ void GLSprite::Draw(int pass)
}
if (RenderStyle.BlendOp != STYLEOP_Shadow)
{
if (gl_lights && GLRenderer->mLightCount && mDrawer->FixedColormap == CM_DEFAULT && !fullbright)
if (vr_dynlights && GLRenderer->mLightCount && mDrawer->FixedColormap == CM_DEFAULT && !fullbright)
{
if (modelframe && !particle)
dynlightindex = gl_SetDynModelLight(gl_light_sprites ? actor : NULL, dynlightindex);

View file

@ -493,7 +493,7 @@ void GLWall::RenderTranslucentWall()
{
if (gltexture)
{
if (mDrawer->FixedColormap == CM_DEFAULT && gl_lights && gl.lightmethod == LM_DIRECT)
if (mDrawer->FixedColormap == CM_DEFAULT && vr_dynlights && gl.lightmethod == LM_DIRECT)
{
SetupLights();
}

View file

@ -288,7 +288,7 @@ void GLSceneDrawer::SetupWeaponLight()
if (psp->GetState() != nullptr)
{
// set the lighting parameters
if (gl_lights && GLRenderer->mLightCount && FixedColormap == CM_DEFAULT && gl_light_sprites)
if (vr_dynlights && GLRenderer->mLightCount && FixedColormap == CM_DEFAULT && gl_light_sprites)
{
FSpriteModelFrame *smf = playermo->player->ReadyWeapon ? FindModelFrame(playermo->player->ReadyWeapon->GetClass(), psp->GetState()->sprite, psp->GetState()->GetFrame(), false) : nullptr;
if (smf)
@ -539,7 +539,7 @@ void GLSceneDrawer::DrawPlayerSprites(sector_t * viewsector, bool hudModelStep)
}
else
{
if (gl_lights && GLRenderer->mLightCount && FixedColormap == CM_DEFAULT && gl_light_sprites)
if (vr_dynlights && GLRenderer->mLightCount && FixedColormap == CM_DEFAULT && gl_light_sprites)
{
FSpriteModelFrame *smf = playermo->player->ReadyWeapon ? FindModelFrame(playermo->player->ReadyWeapon->GetClass(), psp->GetSprite(), psp->GetState()->GetFrame(), false) : nullptr;
if (smf)

View file

@ -71,9 +71,6 @@ CVAR(Bool, vr_switch_sticks, false, CVAR_ARCHIVE | CVAR_GLOBALCONFIG)
CVAR(Float, vr_pickup_haptic_level, 0.2, CVAR_ARCHIVE | CVAR_GLOBALCONFIG)
CVAR(Float, vr_quake_haptic_level, 0.8, CVAR_ARCHIVE | CVAR_GLOBALCONFIG)
//Our own control over dynamic lights
CVAR(Bool, vr_dynlights, 0, CVAR_ARCHIVE | CVAR_GLOBALCONFIG);
//HUD control
CVAR(Float, vr_hud_scale, 0.3f, CVAR_ARCHIVE | CVAR_GLOBALCONFIG)

View file

@ -21,7 +21,9 @@ EXTERN_CVAR(Bool, gl_usefb)
EXTERN_CVAR(Int, gl_weaponlight)
EXTERN_CVAR (Bool, gl_lights);
EXTERN_CVAR (Bool, vr_dynlights);
EXTERN_CVAR (Bool, gl_lights); // Now does nothing - replaced by our vr cvar
EXTERN_CVAR (Bool, gl_lights_checkside);
EXTERN_CVAR (Bool, gl_light_sprites);
EXTERN_CVAR (Bool, gl_light_particles);

View file

@ -111,7 +111,7 @@ PolyModelRenderer::PolyModelRenderer(PolyRenderThread *thread, const Mat4f &worl
void PolyModelRenderer::AddLights(AActor *actor)
{
if (vr_dynlights && actor)
if (r_dynlights && actor)
{
auto &addedLights = Thread->AddedLightsArray;

View file

@ -269,7 +269,7 @@ void RenderPolyPlane::SetLightLevel(PolyRenderThread *thread, PolyDrawArgs &args
void RenderPolyPlane::SetDynLights(PolyRenderThread *thread, PolyDrawArgs &args, subsector_t *sub, bool ceiling)
{
if (!vr_dynlights)
if (!r_dynlights)
{
args.SetLights(nullptr, 0);
return;

View file

@ -372,7 +372,7 @@ FTexture *RenderPolySprite::GetSpriteTexture(AActor *thing, /*out*/ bool &flipX)
void RenderPolySprite::SetDynlight(AActor *thing, PolyDrawArgs &args)
{
bool fullbrightSprite = ((thing->renderflags & RF_FULLBRIGHT) || (thing->flags5 & MF5_BRIGHT));
if (fullbrightSprite || !vr_dynlights)
if (fullbrightSprite || !r_dynlights)
{
args.SetDynLightColor(0);
return;

View file

@ -405,7 +405,7 @@ void RenderPolyWall::Render(PolyRenderThread *thread)
void RenderPolyWall::SetDynLights(PolyRenderThread *thread, PolyDrawArgs &args)
{
if (!vr_dynlights)
if (!r_dynlights)
{
args.SetLights(nullptr, 0);
return;

View file

@ -361,7 +361,7 @@ double R_GetGlobVis(const FViewWindow &viewwindow, double vis)
//
//==========================================================================
CUSTOM_CVAR (Int, screenblocks, 10, CVAR_ARCHIVE)
CUSTOM_CVAR (Int, screenblocks, 11, CVAR_ARCHIVE)
{
if (self > 12)
self = 12;

View file

@ -52,7 +52,7 @@
#include "r_thread.h"
#include "swrenderer/scene/r_light.h"
CVAR(Bool, r_dynlights, 0, CVAR_ARCHIVE | CVAR_GLOBALCONFIG); // Now does nothing in VR
CVAR(Bool, r_dynlights, 0, CVAR_ARCHIVE | CVAR_GLOBALCONFIG);
CVAR(Bool, r_fuzzscale, 1, CVAR_ARCHIVE | CVAR_GLOBALCONFIG);
namespace swrenderer

View file

@ -16,7 +16,7 @@ EXTERN_CVAR(Float, r_lod_bias);
EXTERN_CVAR(Int, r_drawfuzz);
EXTERN_CVAR(Bool, r_drawtrans);
EXTERN_CVAR(Float, transsouls);
EXTERN_CVAR(Bool, vr_dynlights);
EXTERN_CVAR(Bool, r_dynlights);
EXTERN_CVAR(Bool, r_fuzzscale);
class DrawerCommandQueue;

View file

@ -185,7 +185,7 @@ namespace swrenderer
float zcol = 1.0f / wcol;
float zbufferdepth = 1.0f / (zcol / Thread->Viewport->viewwindow.FocalTangent);
if (vr_dynlights && light_list)
if (r_dynlights && light_list)
{
auto viewport = Thread->Viewport.get();

View file

@ -203,7 +203,7 @@ namespace swrenderer
drawerargs.SetLight(basecolormap, (float)(GlobVis * fabs(viewport->CenterY - y)), planeshade);
}
if (vr_dynlights)
if (r_dynlights)
{
int tx = x1;
bool mirror = !!(Thread->Portal->MirrorFlags & RF_XFLIP);

View file

@ -67,7 +67,7 @@ namespace swrenderer
void VisiblePlane::AddLights(RenderThread *thread, FLightNode *node)
{
if (!vr_dynlights)
if (!r_dynlights)
return;
CameraLight *cameraLight = CameraLight::Instance();

View file

@ -152,7 +152,7 @@ namespace swrenderer
void SWModelRenderer::AddLights(AActor *actor)
{
if (vr_dynlights && actor)
if (r_dynlights && actor)
{
auto &addedLights = Thread->AddedLightsArray;

View file

@ -246,7 +246,7 @@ namespace swrenderer
bool fullbright = !vis->foggy && ((renderflags & RF_FULLBRIGHT) || (thing->flags5 & MF5_BRIGHT));
bool fadeToBlack = (vis->RenderStyle.Flags & STYLEF_FadeToBlack) != 0;
if (vr_dynlights && gl_light_sprites)
if (r_dynlights && gl_light_sprites)
{
float lit_red = 0;
float lit_green = 0;

View file

@ -41,7 +41,7 @@ const char *GetVersionString();
/** Lots of different version numbers **/
#define VERSIONSTR "DrBeef's QuestZDoom-0.5.2 (LZDoom 3.83a)"
#define VERSIONSTR "DrBeef's QuestZDoom-0.5.3 (LZDoom 3.83a)"
// The version as seen in the Windows resource
#define RC_FILEVERSION 3,83,1

View file

@ -2619,7 +2619,6 @@ OptionMenu "GLTextureGLOptions" protected
OptionMenu "GLLightOptions" protected
{
Title "$GLLIGHTMNU_TITLE"
Option "$GLLIGHTMNU_LIGHTSENABLED", gl_lights, "OnOff"
Option "$GLLIGHTMNU_CLIPLIGHTS", gl_lights_checkside, "YesNo"
Option "$GLLIGHTMNU_LIGHTSPRITES", gl_light_sprites, "YesNo"
Option "$GLLIGHTMNU_LIGHTPARTICLES", gl_light_particles, "YesNo"

Binary file not shown.