Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Light reflections from transparent blocks are ignored. #483

Closed
kpreid opened this issue Mar 24, 2024 · 1 comment
Closed

Light reflections from transparent blocks are ignored. #483

kpreid opened this issue Mar 24, 2024 · 1 comment
Labels
area: simulation Things related to what can happen in the world as time progresses. kind: bug Something isn't working as it should

Comments

@kpreid
Copy link
Owner

kpreid commented Mar 24, 2024

The light ray tracer currently has a structure like

if hit block has a fully opaque face {
    // use light from before the hit block, multiplied by face reflectance
} else {
    // use light occupying the hit block
}

This ignores reflection from the face when the block is transparent. Instead, we should do both simultaneously, weighting the contributions appropriately by the face alpha. The tricky part is doing this without significantly decreasing performance; so far my best attempt still adds +30% time to lighting_bench.

@kpreid kpreid added kind: bug Something isn't working as it should area: simulation Things related to what can happen in the world as time progresses. labels Mar 24, 2024
@kpreid
Copy link
Owner Author

kpreid commented Mar 27, 2024

Fixed in 1453326. I didn't find any substantial improvements to this specific part of the algorithm, but I did spend some time optimizing other aspects first.

Something that belatedly occurred to me is that lighting_bench doesn't just measure lighting calculation throughput: it measures the total time to quiescence, which will be longer when we take more blocks into account. So that 30% number isn't necessarily as bad as it sounds.

@kpreid kpreid closed this as completed Mar 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: simulation Things related to what can happen in the world as time progresses. kind: bug Something isn't working as it should
Projects
None yet
Development

No branches or pull requests

1 participant