e->render.flags |= RENDER_ADDITIVE;
if (e->render.effects & EF_DOUBLESIDED)
e->render.flags |= RENDER_DOUBLESIDED;
+ if (e->render.effects & EF_DYNAMICMODELLIGHT)
+ e->render.flags |= RENDER_DYNAMICMODELLIGHT;
// make the other useful stuff
e->render.allowdecals = true;
if(renderflags & RF_WORLDOBJECT) entrender->flags |= RENDER_WORLDOBJECT;
if(renderflags & RF_DEPTHHACK) entrender->flags |= RENDER_NODEPTHTEST;
if(renderflags & RF_ADDITIVE) entrender->flags |= RENDER_ADDITIVE;
+ if(renderflags & RF_DYNAMICMODELLIGHT) entrender->flags |= RENDER_DYNAMICMODELLIGHT;
}
c = (int)PRVM_clientedictfloat(ed, colormap);
entrender->flags |= RENDER_ADDITIVE;
if (entrender->effects & EF_DOUBLESIDED)
entrender->flags |= RENDER_DOUBLESIDED;
+ if (entrender->effects & EF_DYNAMICMODELLIGHT)
+ entrender->flags |= RENDER_DYNAMICMODELLIGHT;
// make the other useful stuff
memcpy(entrender->framegroupblend, ed->priv.server->framegroupblend, sizeof(ed->priv.server->framegroupblend));
#define RF_USETRANSPARENTOFFSET 64 // Allows QC to customize origin used for transparent sorting via transparent_origin global, helps to fix transparent sorting bugs on a very large entities
#define RF_WORLDOBJECT 128 // for large outdoor entities that should not be culled
#define RF_MODELLIGHT 4096 // CSQC-set model light
+#define RF_DYNAMICMODELLIGHT 8192 // origin-dependent model light
#define RF_FULLBRIGHT 256
#define RF_NOSHADOW 512
//description:
//render entity as double sided (backfaces are visible, I.E. you see the 'interior' of the model, rather than just the front), can be occasionally useful on transparent stuff.
+//DP_EF_DYNAMICMODELLIGHT
+//idea: C.Brutail, divVerent, maikmerten
+//darkplaces implementation: divVerent
+//effects bit:
+float EF_DYNAMICMODELLIGHT = 131072;
+//description:
+//force dynamic model light on the entity, even if it's a BSP model (or anything else with lightmaps or light colors)
+
//DP_EF_FLAME
//idea: LordHavoc
//darkplaces implementation: LordHavoc
continue;
// skip bsp models
- if (ent->model && (ent->model == cl.worldmodel || ent->model->brush.parentmodel == cl.worldmodel))
+ if (ent->model && ent->model == cl.worldmodel)
{
// TODO: use modellight for r_ambient settings on world?
VectorSet(ent->modellight_ambient, 0, 0, 0);
{
// no modellight if using fakelight for the map
}
- else if (rsurface.modeltexcoordlightmap2f == NULL && !(t->currentmaterialflags & MATERIALFLAG_FULLBRIGHT))
+ else if ((rsurface.modeltexcoordlightmap2f == NULL || (rsurface.ent_flags & (RENDER_DYNAMICMODELLIGHT | RENDER_CUSTOMIZEDMODELLIGHT))) && !(t->currentmaterialflags & MATERIALFLAG_FULLBRIGHT))
{
// pick a model lighting mode
if (VectorLength2(rsurface.modellight_diffuse) >= (1.0f / 256.0f))
#define EF_SELECTABLE 16384 // LordHavoc: highlights when PRYDON_CLIENTCURSOR mouse is over it
#define EF_DOUBLESIDED 32768 //[515]: disable cull face for this entity
#define EF_NOSELFSHADOW 65536 // LordHavoc: does not cast a shadow on itself (or any other EF_NOSELFSHADOW entities)
-#define EF_UNUSED17 131072
+#define EF_DYNAMICMODELLIGHT 131072
#define EF_UNUSED18 262144
#define EF_UNUSED19 524288
#define EF_RESTARTANIM_BIT 1048576 // div0: restart animation bit (like teleport bit, but lerps between end and start of the anim, and doesn't stop player lerping)
#define RENDER_ADDITIVE 2097152
#define RENDER_DOUBLESIDED 4194304
#define RENDER_CUSTOMIZEDMODELLIGHT 4096
+#define RENDER_DYNAMICMODELLIGHT 8388608 // origin dependent model light
#define MAX_FRAMEGROUPBLENDS 4
typedef struct framegroupblend_s
"DP_EF_ADDITIVE "
"DP_EF_BLUE "
"DP_EF_DOUBLESIDED "
+"DP_EF_DYNAMICMODELLIGHT "
"DP_EF_FLAME "
"DP_EF_FULLBRIGHT "
"DP_EF_NODEPTHTEST "