Skip to content

Commit

Permalink
Check if 3D images are mipmaps for images creation.
Browse files Browse the repository at this point in the history
  • Loading branch information
e2002e committed Aug 8, 2024
1 parent c93aa27 commit 3debc86
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions Sources/iron/RenderPath.hx
Original file line number Diff line number Diff line change
Expand Up @@ -689,14 +689,18 @@ class RenderPath {
if (height < 1) height = 1;
if (t.depth != null && t.depth > 1) { // 3D texture
// Image only
return Image.create3D(width, height, depth, t.format != null ? getTextureFormat(t.format) : TextureFormat.RGBA32);
var img = Image.create3D(width, height, depth,
t.format != null ? getTextureFormat(t.format) : TextureFormat.RGBA32);
if (t.mipmaps)
img.generateMipmaps(1000); // Allocate mipmaps
return img;
}
else { // 2D texture
if (t.is_image != null && t.is_image) { // Image
var img = Image.create(width, height,
t.format != null ? getTextureFormat(t.format) : TextureFormat.RGBA32);
if (t.mipmaps)
img.generateMipmaps(16); // Allocate mipmaps
img.generateMipmaps(1000); // Allocate mipmaps
return img;
}
else { // Render target
Expand Down

0 comments on commit 3debc86

Please sign in to comment.