Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
godot
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
community
godot
Commits
0c3af32d
Commit
0c3af32d
authored
Feb 29, 2020
by
clayjohn
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Force mipmaps off when importing RGBA4444 textures
parent
f3c70191
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
0 deletions
+8
-0
image.cpp
core/image.cpp
+2
-0
image_etc.cpp
modules/etc/image_etc.cpp
+6
-0
No files found.
core/image.cpp
View file @
0c3af32d
...
...
@@ -1458,6 +1458,8 @@ Error Image::generate_mipmaps(bool p_renormalize) {
ERR_FAIL_COND_V_MSG
(
!
_can_modify
(
format
),
ERR_UNAVAILABLE
,
"Cannot generate mipmaps in compressed or custom image formats."
);
ERR_FAIL_COND_V_MSG
(
format
==
FORMAT_RGBA4444
,
ERR_UNAVAILABLE
,
"Cannot generate mipmaps from RGBA4444 format."
);
ERR_FAIL_COND_V_MSG
(
width
==
0
||
height
==
0
,
ERR_UNCONFIGURED
,
"Cannot generate mipmaps with width or height equal to 0."
);
int
mmcount
;
...
...
modules/etc/image_etc.cpp
View file @
0c3af32d
...
...
@@ -106,9 +106,15 @@ static void _compress_etc(Image *p_img, float p_lossy_quality, bool force_etc1_f
// If VRAM compression is using ETC, but image has alpha, convert to RGBA4444 or LA8
// This saves space while maintaining the alpha channel
if (detected_channels == Image::USED_CHANNELS_RGBA) {
if (p_img->has_mipmaps()) {
// Image doesn't support mipmaps with RGBA4444 textures
p_img->clear_mipmaps();
}
p_img->convert(Image::FORMAT_RGBA4444);
return;
} else if (detected_channels == Image::USE_CHANNELS_LA) {
p_img->convert(Image::FORMAT_LA8);
return;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment