Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 18 additions & 3 deletions utils/pxrad/trace.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -648,7 +648,7 @@ static void LinkEdict( entity_t *ent, modtype_t modtype, const char *modname, in
}

// don't link into world if shadow was disabled
if(( ent->modtype == mod_studio || ent->modtype == mod_alias ) && !FBitSet( flags, FMESH_CAST_SHADOW ))
if(( ent->modtype == mod_studio || ent->modtype == mod_alias ) && !FBitSet( flags, FMESH_CAST_SHADOW ) && !FBitSet( flags, FMESH_SELF_SHADOW ))
return;

#ifdef HLRAD_RAYTRACE
Expand Down Expand Up @@ -1059,8 +1059,23 @@ static void ClipToLinks( areanode_t *node, moveclip_t *clip, bool stop_on_first_

touch = ENTITY_FROM_AREA( l );

if( touch == clip->ignore )
continue;
//hack for self shadowing without casting shadows
if( touch->modtype == mod_studio || touch->modtype == mod_alias )
{
tmesh_t *mesh = (tmesh_t *)touch->cache;

if( touch == clip->ignore )
{
if( !FBitSet( mesh->flags, FMESH_SELF_SHADOW ) )
continue;
}
else
if( !FBitSet( mesh->flags, FMESH_CAST_SHADOW ) )
continue;
}
else
if( touch == clip->ignore )
continue;

if( !BoundsIntersect( clip->boxmins, clip->boxmaxs, touch->absmin, touch->absmax ))
continue;
Expand Down
6 changes: 2 additions & 4 deletions utils/pxrad/vertexlight.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -192,8 +192,7 @@ void BuildVertexLights( int indexnum, int thread = -1 )
if( !mesh->verts || mesh->numverts <= 0 )
return;

if( !FBitSet( mesh->flags, FMESH_SELF_SHADOW ))
ignoreent = mapent;
ignoreent = mapent;

GetStylesFromMesh( styles, mesh );

Expand Down Expand Up @@ -314,8 +313,7 @@ void VertexPatchLights( int indexnum, int threadnum = -1 )
if( !mesh->verts || mesh->numverts <= 0 )
return;

if( !FBitSet( mesh->flags, FMESH_SELF_SHADOW ))
ignoreent = mapent;
ignoreent = mapent;

GetStylesFromMesh( newstyles, mesh );

Expand Down
Loading