diff --git a/Sources/iron/RenderPath.hx b/Sources/iron/RenderPath.hx index 2da972b1..05167a8f 100644 --- a/Sources/iron/RenderPath.hx +++ b/Sources/iron/RenderPath.hx @@ -571,8 +571,7 @@ class RenderPath { if (rt == null || rt.raw.width > 0 || rt.depthStencilFrom == "" || - rt == depthToRenderTarget.get(rt.depthStencilFrom) || - rt.raw.is_image == true) { + rt == depthToRenderTarget.get(rt.depthStencilFrom)) { continue; } @@ -690,14 +689,15 @@ class RenderPath { // Image only 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; + if (t.mipmaps) img.generateMipmaps(1000); // Allocate mipmaps + return img; } else { // 2D texture if (t.is_image != null && t.is_image) { // Image - return Image.create(width, height, + var img = Image.create(width, height, t.format != null ? getTextureFormat(t.format) : TextureFormat.RGBA32); + if (t.mipmaps) img.generateMipmaps(1000); // Allocate mipmaps + return img; } else { // Render target return Image.createRenderTarget(width, height, diff --git a/Sources/iron/object/Uniforms.hx b/Sources/iron/object/Uniforms.hx index 8c1c3dee..f53d6921 100644 --- a/Sources/iron/object/Uniforms.hx +++ b/Sources/iron/object/Uniforms.hx @@ -181,10 +181,10 @@ class Uniforms { // Multiple voxel volumes, always set params g.setImageTexture(context.textureUnits[j], rt.image); // image2D/3D if (rt.raw.depth <= 1) { - g.setTextureParameters(context.textureUnits[j], TextureAddressing.Clamp, TextureAddressing.Clamp, TextureFilter.LinearFilter, TextureFilter.LinearFilter, MipMapFilter.NoMipFilter); + g.setTextureParameters(context.textureUnits[j], TextureAddressing.Clamp, TextureAddressing.Clamp, TextureFilter.LinearFilter, TextureFilter.LinearFilter, MipMapFilter.LinearMipFilter); } else { - g.setTexture3DParameters(context.textureUnits[j], TextureAddressing.Mirror, TextureAddressing.Mirror, TextureAddressing.Mirror, TextureFilter.LinearFilter, TextureFilter.LinearFilter, MipMapFilter.LinearMipFilter); + g.setTexture3DParameters(context.textureUnits[j], TextureAddressing.Clamp, TextureAddressing.Clamp, TextureAddressing.Clamp, TextureFilter.LinearFilter, TextureFilter.LinearFilter, MipMapFilter.LinearMipFilter); } paramsSet = true; }