-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
default 16bit rgb/rgba textures to unorm instead of uint #9611
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems OK to me.
@@ -88,7 +88,7 @@ pub fn dds_format_to_texture_format( | |||
TextureFormat::Bc3RgbaUnorm | |||
} | |||
} | |||
D3DFormat::A16B16G16R16 => TextureFormat::Rgba16Uint, | |||
D3DFormat::A16B16G16R16 => TextureFormat::Rgba16Unorm, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Checked the microsoft docs and it seems like A16B16G16R16 is an old dx9 format and the dx11 equivalent is DXGI_FORMAT_R16G16B16A16_UNORM, so this seems correct.
|
||
data = local_data; | ||
data = cast_slice(&raw_data).to_owned(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this potentially be in an unsafe block?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do you mean make Image::from_dynamic
unsafe? i don't think it's necessary, the worst that'll happen is garbage pixeldata in your image.
…9611) # Objective fix bevyengine#8185, bevyengine#6710 replace bevyengine#7005 (closed) rgb and rgba 16 bit textures currently default to `Rgba16Uint`, the more common use is `Rgba16Unorm`, which also matches the default type of rgb8 and rgba8 textures. ## Solution Change default to `Rgba16Unorm`
Objective
fix #8185, #6710
replace #7005 (closed)
rgb and rgba 16 bit textures currently default to
Rgba16Uint
, the more common use isRgba16Unorm
, which also matches the default type of rgb8 and rgba8 textures.Solution
Change default to
Rgba16Unorm