fix(render3d): a body hidden from the camera still stands in the sun
Actor.cast_hidden separates drawn from casting. ac_visible rejected a hidden actor from the shadow pass too, so hiding the player's own body for first person took the player's shadow with it - and in a sunlit basin your own shadow is what tells you where you are. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
parent
ab6f310013
commit
a88aecb993
2 changed files with 16 additions and 1 deletions
8
changes/a-hidden-body-still-stands-in-the-sun.md
Normal file
8
changes/a-hidden-body-still-stands-in-the-sun.md
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
bump: patch
|
||||
type: fix
|
||||
`Actor.cast_hidden` separates being DRAWN from CASTING. `ac_visible` rejected any hidden
|
||||
actor from the shadow pass as well as the scene pass, so a game that hides the player's
|
||||
own body - first person, or a viewfinder held to the eye - lost that player's shadow
|
||||
entirely. An actor hidden because the camera is inside its head is still standing in the
|
||||
sun; set this on it and it keeps its shadow. Everything else still stops casting when it
|
||||
is hidden.
|
||||
|
|
@ -22,6 +22,12 @@ property Actor {
|
|||
rough: int = 0,
|
||||
mat: words, # the model matrix
|
||||
visible: bool = true,
|
||||
# Drawn and CASTING are not the same question. An actor hidden because the camera is inside
|
||||
# its head still stands in the sun, and a body that stops casting the moment you look out of
|
||||
# its own eyes loses its shadow - which in a game played in a sunlit basin is the one thing
|
||||
# that tells you where you are standing. Set this on anything hidden for a reason the sun
|
||||
# does not share; everything else keeps stopping its shadow when it is hidden.
|
||||
cast_hidden: bool = false,
|
||||
casts: bool = true,
|
||||
id: int = 0,
|
||||
cutout: bool = false, # alpha-tested (a flame's cards)
|
||||
|
|
@ -141,7 +147,8 @@ function ac_bind_scene(ap: AcProg) -> void {
|
|||
fog_bind(p)
|
||||
}
|
||||
function ac_visible(a: Actor, shadow: bool) -> bool {
|
||||
if not a.visible or a.model == null { return false }
|
||||
if a.model == null { return false }
|
||||
if not a.visible and not (shadow and a.cast_hidden) { return false }
|
||||
if shadow and not a.casts { return false }
|
||||
if a.cull != 0 {
|
||||
let dx = f_sub(a.x, cam_pos[0]); let dz = f_sub(a.z, cam_pos[2])
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue