Add vertical shadows back in, dim them when close to the ground.

This commit is contained in:
Dario 2021-04-27 18:07:34 -03:00
parent 7c261eeb25
commit c7d84406f9
4 changed files with 26 additions and 3 deletions

View File

@ -1146,6 +1146,24 @@
"materialMod": null,
"name": "textures/segment2/segment2.13C58.rgba16"
},
{
"materialMod": {
"depthBias": 25.0,
"lightGroupMaskBits": 0,
"shadowAlphaMultiplier": 0.0,
"solidAlphaMultiplier": 0.8
},
"name": "textures/segment2/shadow_quarter_circle.ia8"
},
{
"materialMod": {
"depthBias": 5.0,
"lightGroupMaskBits": 0,
"shadowAlphaMultiplier": 0.0,
"solidAlphaMultiplier": 0.5
},
"name": "textures/segment2/shadow_quarter_square.ia8"
},
{
"materialMod": null,
"name": "textures/sky/rr_textures.00000.rgba16"

View File

@ -696,7 +696,6 @@ void geo_set_animation_globals(struct GraphNodeObject_sub *node, s32 hasAnimatio
* the floor below it.
*/
static void geo_process_shadow(struct GraphNodeShadow *node) {
#ifndef GFX_DISABLE_SHADOWS
Gfx *shadowList;
Mat4 mtxf;
Vec3f shadowPos;
@ -774,7 +773,6 @@ static void geo_process_shadow(struct GraphNodeShadow *node) {
gMatStackIndex--;
}
}
#endif
if (node->node.children != NULL) {
geo_process_node_and_siblings(node->node.children);

View File

@ -240,6 +240,13 @@ s8 init_shadow(struct Shadow *s, f32 xPos, f32 yPos, f32 zPos, s16 shadowScale,
s->solidity = dim_shadow_with_distance(overwriteSolidity, yPos - s->floorHeight);
}
#ifdef GFX_DIM_SHADOWS_CLOSE_TO_GROUND
const f32 blendOff = 100.0f;
const f32 blendDist = 200.0f;
int newSolidity = s->solidity * ((yPos - s->floorHeight - blendOff) / blendDist);
s->solidity = min(max(newSolidity, 0), s->solidity);
#endif
s->shadowScale = scale_shadow_with_distance(shadowScale, yPos - s->floorHeight);
s->floorDownwardAngle = atan2_deg(s->floorNormalZ, s->floorNormalX);

View File

@ -3,7 +3,7 @@
#ifdef RAPI_RT64
# define GFX_MAX_BUFFERED 16384
# define GFX_DISABLE_SHADOWS
# define GFX_DIM_SHADOWS_CLOSE_TO_GROUND
# define GFX_DISABLE_FRUSTUM_CULLING
# define GFX_DISABLE_LIGHTING
# define GFX_FLUSH_ON_ENDDL