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

Wave struct stores float instead of half types. #168

Merged
merged 1 commit into from
Feb 23, 2022

Conversation

kaychang-unity
Copy link
Collaborator

This fixes a bug on some platforms where half types in structBuffers are stored as 16 bits, but the data uploaded from the CPU are 32 bits floats. This would result in the water geometry not appearing on screen.

https://fogbugz.unity3d.com/f/cases/1382009/

…ome platforms where half types in structBuffers are stored as 16 bits.
@kaychang-unity kaychang-unity added the bug Something isn't working label Feb 18, 2022
@kaychang-unity kaychang-unity self-assigned this Feb 18, 2022
Copy link
Contributor

@Wilfrid-Unity Wilfrid-Unity left a comment

Choose a reason for hiding this comment

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

That looks good.
I'm curious where is the CPU-side code that uploads the data?

@kaychang-unity
Copy link
Collaborator Author

That looks good. I'm curious where is the CPU-side code that uploads the data?

Here:

Shader.SetGlobalBuffer(WaveDataBuffer, waveBuffer);

Copy link
Contributor

@Verasl Verasl left a comment

Choose a reason for hiding this comment

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

LGTM

@Verasl Verasl merged commit a8a7abe into master Feb 23, 2022
@Verasl Verasl deleted the bugfix/wave-float-struct branch February 23, 2022 07:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants