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

Add a ground plane. #1638

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

ThatRedox
Copy link
Member

This adds an infinite ground plane similar to the water plane.
image

Currently the texture is set to stone and isn't configurable. Currently the controls are in the Water tab so suggestions for a better place are welcome.

@@ -95,6 +95,9 @@ public static boolean nextIntersection(Scene scene, Ray ray) {
if (scene.isWaterPlaneEnabled()) {
hit = waterPlaneIntersection(scene, ray) || hit;
}
if (scene.isGroundPlaneEnabled()) {
hit |= groundPlaneIntersection(scene, ray);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This won't call the groundPlaneIntersection method if hit is already true, eg. if the water plane was hit before. If this gets fixed, we could have ocean grounds for water world mode. 🤩

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it should, |= uses the bitwise or operator so it can't get short circuited.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants