Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Renderer: Re-enabled old flare/halo rendering code
The new flares are not quite ready yet, and besides they can coexist
with the old code.
  • Loading branch information
skyjake committed Dec 8, 2013
1 parent 2c29bd0 commit 74256a9
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 66 deletions.
15 changes: 0 additions & 15 deletions doomsday/client/include/render/rend_halo.h
Expand Up @@ -20,19 +20,6 @@
#ifndef DENG_CLIENT_RENDER_HALO_H
#define DENG_CLIENT_RENDER_HALO_H

#include <de/libdeng1.h>

DENG_EXTERN_C int haloOccludeSpeed;

void H_Register();

#endif

#if 0

#ifndef DENG_CLIENT_RENDER_HALO_H
#define DENG_CLIENT_RENDER_HALO_H

#include <de/Vector>

#include "TextureVariantSpec"
Expand Down Expand Up @@ -82,5 +69,3 @@ bool H_RenderHalo(de::Vector3d const &origin, float size,
D_CMD(FlareConfig);

#endif // DENG_CLIENT_RENDER_HALO_H

#endif // 0
12 changes: 1 addition & 11 deletions doomsday/client/src/gl/gl_texmanager.cpp
Expand Up @@ -1104,13 +1104,11 @@ void GL_LoadSystemTextures()

GL_PrepareSysFlaremap(FXT_ROUND);
GL_PrepareSysFlaremap(FXT_FLARE);

/*
if(!haloRealistic)
{
GL_PrepareSysFlaremap(FXT_BRFLARE);
GL_PrepareSysFlaremap(FXT_BIGFLARE);
}*/
}

Rend_ParticleLoadSystemTextures();
}
Expand Down Expand Up @@ -1838,8 +1836,6 @@ DGLuint GL_PrepareLSTexture(lightingtexid_t which)

DGLuint GL_PrepareSysFlaremap(flaretexid_t which)
{
DENG_UNUSED(which);
#if 0
if(novideo) return 0;
if(which < 0 || which >= NUM_SYSFLARE_TEXTURES) return 0;

Expand Down Expand Up @@ -1877,15 +1873,10 @@ DGLuint GL_PrepareSysFlaremap(flaretexid_t which)

DENG_ASSERT(sysFlareTextures[which] != 0);
return sysFlareTextures[which];
#endif
return 0;
}

DGLuint GL_PrepareFlaremap(de::Uri const &resourceUri)
{
DENG_UNUSED(resourceUri);
#if 0
return 0;
if(resourceUri.path().length() == 1)
{
// Select a system flare by numeric identifier?
Expand All @@ -1904,7 +1895,6 @@ DGLuint GL_PrepareFlaremap(de::Uri const &resourceUri)
}
// Dang...
}
#endif
return 0;
}

Expand Down
3 changes: 1 addition & 2 deletions doomsday/client/src/render/lumobj.cpp
Expand Up @@ -230,8 +230,7 @@ void Lumobj::generateFlare(Vector3d const &eye, double distFromEye)
vis->distance = distFromEye;
V3f_Set(vis->data.flare.color, d->color.x, d->color.y, d->color.z);
vis->data.flare.mul = d->source->occlusion(eye) * attenuation(distFromEye);
//vis->data.flare.size = d->flareSize > 0? de::max(1.f, d->flareSize * 60 * (50 + haloSize) / 100.0f) : 0;
vis->data.flare.size = 1;
vis->data.flare.size = d->flareSize > 0? de::max(1.f, d->flareSize * 60 * (50 + haloSize) / 100.0f) : 0;
vis->data.flare.tex = d->flareTex;
vis->data.flare.lumIdx = indexInMap();
vis->data.flare.isDecoration = true;
Expand Down
6 changes: 3 additions & 3 deletions doomsday/client/src/render/r_things.cpp
Expand Up @@ -478,9 +478,9 @@ void R_ProjectSprite(mobj_t *mo)
vis->data.flare.flags = def->flags;
}

vis->data.flare.size = 1; //flareSize * 60 * (50 + haloSize) / 100.0f;
/*if(vis->data.flare.size < 8)
vis->data.flare.size = 8;*/
vis->data.flare.size = flareSize * 60 * (50 + haloSize) / 100.0f;
if(vis->data.flare.size < 8)
vis->data.flare.size = 8;

// Color is taken from the associated lumobj.
V3f_Set(vis->data.flare.color, lum->color().x, lum->color().y, lum->color().z);
Expand Down
19 changes: 1 addition & 18 deletions doomsday/client/src/render/rend_halo.cpp
Expand Up @@ -17,23 +17,6 @@
* http://www.gnu.org/licenses</small>
*/

#include "de_base.h"
#include "de_console.h"
#include "render/rend_halo.h"

int haloOccludeSpeed = 48;

void H_Register(void)
{
cvartemplate_t cvars[] = {
{"rend-halo-occlusion", CVF_NO_MAX, CVT_INT, &haloOccludeSpeed, 0, 0},
{NULL}
};
Con_AddVariableList(cvars);
}

#if 0 // old GL1 implementation

#include <cmath>

#include "de_base.h"
Expand Down Expand Up @@ -62,6 +45,7 @@ D_CMD(FlareConfig);

int haloMode = 5, haloBright = 45, haloSize = 80;
int haloRealistic = true;
int haloOccludeSpeed = 48;
float haloZMagDiv = 62, haloMinRadius = 20;
float haloDimStart = 10, haloDimEnd = 100;

Expand Down Expand Up @@ -413,4 +397,3 @@ D_CMD(FlareConfig)

return true;
}
#endif
9 changes: 0 additions & 9 deletions doomsday/client/src/render/sprite.cpp
Expand Up @@ -674,12 +674,6 @@ static void setupModelParamsForVisPSprite(rendmodelparams_t *params, vispsprite_

static bool generateHaloForVisSprite(vissprite_t const *spr, bool primary = false)
{
/// @todo Rethink how to draw the 3D halo around the object. Needs to be done
/// in the vissprite order.
DENG_UNUSED(spr);
DENG_UNUSED(primary);
return false;
#if 0
float occlusionFactor;

if(primary && (spr->data.flare.flags & RFF_NO_PRIMARY))
Expand Down Expand Up @@ -707,7 +701,6 @@ static bool generateHaloForVisSprite(vissprite_t const *spr, bool primary = fals
occlusionFactor, spr->data.flare.mul,
spr->data.flare.xOff, primary,
(spr->data.flare.flags & RFF_NO_TURN) == 0);
#endif
}

void Rend_DrawMasked()
Expand Down Expand Up @@ -751,7 +744,6 @@ void Rend_DrawMasked()
}
}

#if 0
// Draw secondary halos?
if(primaryHaloDrawn && haloMode > 1)
{
Expand All @@ -769,7 +761,6 @@ void Rend_DrawMasked()
// And we're done...
H_SetupState(false);
}
#endif
}
}

Expand Down
4 changes: 0 additions & 4 deletions doomsday/client/src/resource/materialsnapshot.cpp
Expand Up @@ -150,9 +150,6 @@ MaterialSnapshot::Decoration &MaterialSnapshot::decoration(int index) const
*/
static DGLuint prepareFlaremap(Texture *texture, int oldIdx)
{
DENG_UNUSED(texture);
DENG_UNUSED(oldIdx);
#if 0
if(texture)
{
if(TextureVariant const *variant = texture->prepareVariant(Rend_HaloTextureSpec()))
Expand All @@ -165,7 +162,6 @@ static DGLuint prepareFlaremap(Texture *texture, int oldIdx)
{
return GL_PrepareSysFlaremap(flaretexid_t(oldIdx - 1));
}
#endif
return 0; // Use the automatic selection logic.
}

Expand Down
7 changes: 3 additions & 4 deletions doomsday/client/src/ui/editors/rendererappearanceeditor.cpp
Expand Up @@ -402,7 +402,6 @@ DENG2_OBSERVES(App, GameChange)
haloGroup->addLabel(tr("Vignette Width:"));
haloGroup->addSlider("rend-vignette-width");

#if 0
haloGroup->addSpace();
haloGroup->addToggle("rend-halo-realistic", tr("Realistic Halos"));

Expand All @@ -414,10 +413,10 @@ DENG2_OBSERVES(App, GameChange)

haloGroup->addLabel(tr("Halo Size Factor:"));
haloGroup->addSlider("rend-halo-size");
#endif

haloGroup->addLabel(tr("Occlusion Fading:"));
haloGroup->addSlider("rend-halo-occlusion", Ranged(1, 256), 1, 0);
#if 0

haloGroup->addLabel(tr("Min Halo Radius:"));
haloGroup->addSlider("rend-halo-radius-min", Ranged(1, 80), .1, 1);

Expand All @@ -432,7 +431,7 @@ DENG2_OBSERVES(App, GameChange)

haloGroup->addLabel(tr("Z-Mag Divisor:"));
haloGroup->addSlider("rend-halo-zmag-div", Ranged(1, 100), .1, 1);
#endif

haloGroup->commit();

// Material settings.
Expand Down

0 comments on commit 74256a9

Please sign in to comment.