From 41fd34e424148784704c71de08351aa8ff441e00 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Wed, 31 Oct 2018 12:28:10 +0100 Subject: [PATCH] - use standard sprite lighting for voxels. Per-pixel lighting requires normals which voxels do not have. --- src/hwrenderer/scene/hw_sprites.cpp | 2 +- src/r_data/models/models.cpp | 1 + src/r_data/models/models.h | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/hwrenderer/scene/hw_sprites.cpp b/src/hwrenderer/scene/hw_sprites.cpp index a3ea2a63f..a053ee423 100644 --- a/src/hwrenderer/scene/hw_sprites.cpp +++ b/src/hwrenderer/scene/hw_sprites.cpp @@ -458,7 +458,7 @@ bool GLSprite::CalculateVertices(HWDrawInfo *di, FVector3 *v, DVector3 *vp) inline void GLSprite::PutSprite(HWDrawInfo *di, bool translucent) { // That's a lot of checks... - if (modelframe && RenderStyle.BlendOp != STYLEOP_Shadow && gl_light_sprites && level.HasDynamicLights && !di->isFullbrightScene() && !fullbright) + if (modelframe && !modelframe->isVoxel && RenderStyle.BlendOp != STYLEOP_Shadow && gl_light_sprites && level.HasDynamicLights && !di->isFullbrightScene() && !fullbright) { hw_GetDynModelLight(actor, lightdata); dynlightindex = screen->mLights->UploadLights(lightdata); diff --git a/src/r_data/models/models.cpp b/src/r_data/models/models.cpp index 95d1d5310..e8cb52678 100644 --- a/src/r_data/models/models.cpp +++ b/src/r_data/models/models.cpp @@ -509,6 +509,7 @@ void InitModels() FVoxelModel *md = (FVoxelModel*)Models[VoxelDefs[i]->Voxel->VoxelIndex]; FSpriteModelFrame smf; memset(&smf, 0, sizeof(smf)); + smf.isVoxel = true; smf.modelIDs[1] = smf.modelIDs[2] = smf.modelIDs[3] = -1; smf.modelIDs[0] = VoxelDefs[i]->Voxel->VoxelIndex; smf.skinIDs[0] = md->GetPaletteTexture(); diff --git a/src/r_data/models/models.h b/src/r_data/models/models.h index 5e72269aa..a6b8bf65b 100644 --- a/src/r_data/models/models.h +++ b/src/r_data/models/models.h @@ -475,6 +475,7 @@ struct FSpriteModelFrame float angleoffset; // added pithoffset, rolloffset. float pitchoffset, rolloffset; // I don't want to bother with type transformations, so I made this variables float. + bool isVoxel; }; FSpriteModelFrame * FindModelFrame(const PClass * ti, int sprite, int frame, bool dropped);