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

Allow 16-bit PNG depth maps for backgrounds #571

Closed
2 tasks done
p0nce opened this issue Aug 17, 2021 · 2 comments
Closed
2 tasks done

Allow 16-bit PNG depth maps for backgrounds #571

p0nce opened this issue Aug 17, 2021 · 2 comments
Labels
Enhancement This issue is about a new feature rather than a bug.

Comments

@p0nce
Copy link
Collaborator

p0nce commented Aug 17, 2021

Currently because the depth map is 8-bit when loaded as background, you can't make slow ramps without artifacts.

For example here is the render with a depth map that contains slow ramps (modified Panagment graphics)
16-bit depth
16-bit-depth

instead of

8-bit depth
image

This limitation doesn't affect runtime primitives that draw into depth properly, it's only image resources.
A former workaround was to increase precision by using a color like (255, 254, 253), when reduced to 16-bit grey it would increase precision.

  • Support loading 16-bit PNG as depth map
  • Constraint: legacy depth maps using 8-bit RGB PNG shoud keep working with only minor visual change.
@p0nce p0nce added the Enhancement This issue is about a new feature rather than a bug. label Aug 17, 2021
@p0nce
Copy link
Collaborator Author

p0nce commented Aug 17, 2021

Visual effect of former loading vs directly loading as L16 is pretty neutral (not really better), yet pretty visible.

@p0nce
Copy link
Collaborator Author

p0nce commented Aug 17, 2021

Checked in, will be available in v12.0.9

8-bit depth maps load as before.
16-bit depth maps are built more directly. So it is not a breaking change.

Using a 16-bit greyscale depth map (you can set in GIMP) changes the following:

  • saves 1.8mb of RAM in Panagement, that is 1.5% of its total memory consumtion.
  • not really seen a change in load time

When converting the map in GIMP be sure to first augment bitdepth before converting to greyscale.

@p0nce p0nce closed this as completed Aug 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement This issue is about a new feature rather than a bug.
Projects
None yet
Development

No branches or pull requests

1 participant