From f192ce5c39e34109cd3fd1476199198e89c1c122 Mon Sep 17 00:00:00 2001 From: e2002e Date: Fri, 26 Apr 2024 11:56:41 +0200 Subject: [PATCH] undo changes to tilesheet, allocate 1000 mipmaps, use linear filters for voxels images. --- Sources/iron/RenderPath.hx | 2 +- Sources/iron/object/Uniforms.hx | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Sources/iron/RenderPath.hx b/Sources/iron/RenderPath.hx index 0d7df7a4..05167a8f 100644 --- a/Sources/iron/RenderPath.hx +++ b/Sources/iron/RenderPath.hx @@ -689,7 +689,7 @@ class RenderPath { // Image only var img = Image.create3D(width, height, depth, t.format != null ? getTextureFormat(t.format) : TextureFormat.RGBA32); - if (t.mipmaps) img.generateMipmaps(Main.voxelgiClipmapCount); // Allocate mipmaps + if (t.mipmaps) img.generateMipmaps(1000); // Allocate mipmaps return img; } else { // 2D texture diff --git a/Sources/iron/object/Uniforms.hx b/Sources/iron/object/Uniforms.hx index 630f8fd3..d59c77f1 100644 --- a/Sources/iron/object/Uniforms.hx +++ b/Sources/iron/object/Uniforms.hx @@ -183,13 +183,13 @@ class Uniforms { if (rt.raw.name.startsWith("voxels_")) { g.setTextureParameters(context.textureUnits[j], TextureAddressing.Clamp, TextureAddressing.Clamp, TextureFilter.LinearFilter, TextureFilter.LinearFilter, MipMapFilter.LinearMipFilter); } - else if (rt.raw.name.startsWith("voxelsOut")) + else if (rt.raw.name.startsWith("voxels")) { - g.setTexture3DParameters(context.textureUnits[j], TextureAddressing.Clamp, TextureAddressing.Clamp, TextureAddressing.Clamp, TextureFilter.PointFilter, TextureFilter.PointFilter, MipMapFilter.LinearMipFilter); + g.setTexture3DParameters(context.textureUnits[j], TextureAddressing.Clamp, TextureAddressing.Clamp, TextureAddressing.Clamp, TextureFilter.LinearFilter, TextureFilter.LinearFilter, MipMapFilter.LinearMipFilter); } - else if (rt.raw.name.startsWith("voxels")) + else { - g.setTexture3DParameters(context.textureUnits[j], TextureAddressing.Clamp, 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); } paramsSet = true; }