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

fix: fix inconsistent VR grass culling #125

Merged
merged 1 commit into from
Oct 10, 2023
Merged

Conversation

thorwin99
Copy link
Contributor

Potential fix for #124.
VR grass cull distance was calculated per eye, resulting in different cull distances for each eye.
This meant, that grass might be visible in the left eye, while culled in the right eye.
This is a potential fix, calculating the cull distance based on the first eye.

VR grass cull distance was calculated per eye, resulting in different
cull distances for each eye.
This meant, that grass might be visible in the left eye, while culled in
the right eye.
This is a potential fix, calculating the cull distance based on the
first eye.
@alandtse
Copy link
Collaborator

Thanks. Do you have any confirmation this actually works like you expect? Please note, this will impact flat.

@thorwin99
Copy link
Contributor Author

Yes, i just tested it with my VR setup. It simply takes the WorldViewProj matrix of the first eye (eyeIndex 0) for culling distance calculation of every eye. That way, the culling distance is consistent for both eyes,

It wont impact flat, as flat already uses eyeIndex 0 by default, which results in the same calculation.
I thought about adding a switch for VR / Non VR, but that would be unnecessary.

Copy link
Collaborator

@alandtse alandtse left a comment

Choose a reason for hiding this comment

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

@doodlum you ok with this? I'm good with it.

@doodlum
Copy link
Owner

doodlum commented Oct 10, 2023

👀 Yes this is fine. It should only apply to VR, though.

@alandtse alandtse changed the title fix: Issue #124 VR grass culling fix: fix inconsistent VR grass culling Oct 10, 2023
@alandtse alandtse merged commit a14ea9b into doodlum:dev Oct 10, 2023
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants