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

Investigate: 32 bit (4*8 bit) gradients #205

Open
mlavik1 opened this issue Jun 5, 2023 · 2 comments
Open

Investigate: 32 bit (4*8 bit) gradients #205

mlavik1 opened this issue Jun 5, 2023 · 2 comments
Assignees
Milestone

Comments

@mlavik1
Copy link
Owner

mlavik1 commented Jun 5, 2023

See discussion in #204

By switching to 8 bit components for gradients we could:

  • Reduce CPU side memory usage to 1/4
  • Reduce GPU memory usage to to 1/2
  • Make rendering faster when using gradients (smaller texture fetches)

Implementation:

  • Switch to Color32
  • Use Texture3D.SetPixelData instead of Texture3D.SetPixels
  • Switch to TextureFormat.RGBA32
  • Add a setting for this?

Possible issues:

Precision will suffer. Investigate if this causes noticable issues. We might want to support both 8 bit unsigned int and half precision floating point format.

@SitronX
Copy link
Contributor

SitronX commented Jun 5, 2023

Use Texture3D.SetPixelData instead of Texture3D.SetPixels

Just note, there is also Texture3D.SetPixels32 method exactly for this :)

@mlavik1
Copy link
Owner Author

mlavik1 commented Jun 6, 2023

Use Texture3D.SetPixelData instead of Texture3D.SetPixels

Just note, there is also Texture3D.SetPixels32 method exactly for this :)

Oh yes, you're right! Thank you :)

@mlavik1 mlavik1 added this to the release-5 milestone Jul 2, 2023
@mlavik1 mlavik1 self-assigned this Jul 2, 2023
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

No branches or pull requests

2 participants