@@ -260,98 +260,6 @@ int R_LightForPoint( vec3_t point, vec3_t ambientLight, vec3_t directedLight, ve
260260 return true ;
261261}
262262
263- /*
264- =================
265- R_SetupEntityLightingGrid
266- =================
267- */
268- static void R_SetupEntityLightingGrid ( trRefEntity_t *ent, vec3_t forcedOrigin )
269- {
270- vec3_t lightOrigin;
271-
272- if ( forcedOrigin )
273- {
274- VectorCopy ( forcedOrigin, lightOrigin );
275- }
276- else
277- {
278- if ( ent->e .renderfx & RF_LIGHTING_ORIGIN )
279- {
280- // separate lightOrigins are needed so an object that is
281- // sinking into the ground can still be lit, and so
282- // multi-part models can be lit identically
283- VectorCopy ( ent->e .lightingOrigin , lightOrigin );
284- }
285- else
286- {
287- VectorCopy ( ent->e .origin , lightOrigin );
288- }
289- }
290-
291- R_LightForPoint ( lightOrigin, ent->ambientLight , ent->directedLight ,
292- ent->lightDir );
293- }
294-
295- /*
296- =================
297- R_SetupEntityLighting
298-
299- Calculates all the lighting values that will be used
300- by the Calc_* functions
301- =================
302- */
303- void R_SetupEntityLighting ( const trRefdef_t *refdef, trRefEntity_t *ent, vec3_t forcedOrigin )
304- {
305- // lighting calculations
306- if ( ent->lightingCalculated )
307- {
308- return ;
309- }
310-
311- ent->lightingCalculated = true ;
312-
313- // if NOWORLDMODEL, only use dynamic lights (menu system, etc)
314- if ( !( refdef->rdflags & RDF_NOWORLDMODEL ) && tr.world
315- && tr.world ->lightGridData1 && tr.world ->lightGridData2 )
316- {
317- R_SetupEntityLightingGrid ( ent, forcedOrigin );
318- }
319- else
320- {
321- /* Historically those values were multiplied by
322- tr.identityLight but tr.identityLight is always 1.0f
323- in Dæmon engine as the overbright bit implementation
324- is fully software. */
325-
326- // % ent->ambientLight[0] = ent->ambientLight[1] = ent->ambientLight[2] = 150.0f;
327- // % ent->directedLight[0] = ent->directedLight[1] = ent->directedLight[2] = 150.0f;
328- // % VectorCopy( tr.sunDirection, ent->lightDir );
329- ent->ambientLight [ 0 ] = 64 .0f / 255 .0f ;
330- ent->ambientLight [ 1 ] = 64 .0f / 255 .0f ;
331- ent->ambientLight [ 2 ] = 96 .0f / 255 .0f ;
332-
333- ent->directedLight [ 0 ] = 255 .0f / 255 .0f ;
334- ent->directedLight [ 1 ] = 232 .0f / 255 .0f ;
335- ent->directedLight [ 2 ] = 224 .0f / 255 .0f ;
336-
337- VectorSet ( ent->lightDir , -1 , 1 , 1.25 );
338- VectorNormalize ( ent->lightDir );
339- }
340-
341- if ( ( ent->e .renderfx & RF_MINLIGHT ) ) // && VectorLength(ent->ambientLight) <= 0)
342- {
343- /* Historically those values were multiplied by
344- tr.identityLight but tr.identityLight is always 1.0f
345- in Dæmon engine as the as the overbright bit
346- implementation is fully software. */
347-
348- // give everything a minimum light add
349- ent->ambientLight [ 0 ] += 0 .125f ;
350- ent->ambientLight [ 1 ] += 0 .125f ;
351- ent->ambientLight [ 2 ] += 0 .125f ;
352- }
353- }
354-
355263/*
356264=================
357265R_SetupLightOrigin
0 commit comments