Skip to content
This repository has been archived by the owner on Dec 2, 2024. It is now read-only.

Commit

Permalink
don't use mimpmaps for voxels images.
Browse files Browse the repository at this point in the history
  • Loading branch information
e2002e committed Jul 26, 2024
1 parent c9c4666 commit 4f2694c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 8 deletions.
6 changes: 1 addition & 5 deletions Sources/iron/RenderPath.hx
Original file line number Diff line number Diff line change
Expand Up @@ -689,11 +689,7 @@ class RenderPath {
if (height < 1) height = 1;
if (t.depth != null && t.depth > 1) { // 3D texture
// Image only
var img = Image.create3D(width, height, depth,
t.format != null ? getTextureFormat(t.format) : TextureFormat.RGBA32);
if (t.mipmaps)
img.generateMipmaps(1); // Allocate mipmaps
return img;
return Image.create3D(width, height, depth, t.format != null ? getTextureFormat(t.format) : TextureFormat.RGBA32);
}
else { // 2D texture
if (t.is_image != null && t.is_image) { // Image
Expand Down
2 changes: 1 addition & 1 deletion Sources/iron/object/LightObject.hx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class LightObject extends Object {
public var lightInAtlas = false;
public var culledLight = false;
public static var pointLightsData: kha.arrays.Float32Array = null;
public var shadowMapScale = 1.0;//when in forward, we drawMeshes() which will set this only after drawing shadowmap. This locks the drawing of the atlases so it's better to initialize it at 1.0
public var shadowMapScale = 1.0;//when in forward, we drawMeshes() which will set this only after drawing shadowmap. This blocks the drawing of the atlases so it's better to initialize it at 1.0
// Data used in uniforms
public var tileOffsetX: Array<Float> = [0.0];
public var tileOffsetY: Array<Float> = [0.0];
Expand Down
4 changes: 2 additions & 2 deletions Sources/iron/object/Uniforms.hx
Original file line number Diff line number Diff line change
Expand Up @@ -181,11 +181,11 @@ class Uniforms {
// Multiple voxel volumes, always set params
g.setImageTexture(context.textureUnits[j], rt.image); // image2D/3D
if (rt.raw.name.startsWith("voxels_")) {
g.setTextureParameters(context.textureUnits[j], TextureAddressing.Clamp, TextureAddressing.Clamp, TextureFilter.LinearFilter, TextureFilter.LinearFilter, MipMapFilter.LinearMipFilter);
g.setTextureParameters(context.textureUnits[j], TextureAddressing.Clamp, TextureAddressing.Clamp, TextureFilter.LinearFilter, TextureFilter.LinearFilter, MipMapFilter.NoMipFilter);
}
else if (rt.raw.name.startsWith("voxels"))
{
g.setTexture3DParameters(context.textureUnits[j], TextureAddressing.Clamp, TextureAddressing.Clamp, TextureAddressing.Clamp, TextureFilter.LinearFilter, TextureFilter.LinearFilter, MipMapFilter.LinearMipFilter);
g.setTexture3DParameters(context.textureUnits[j], TextureAddressing.Clamp, TextureAddressing.Clamp, TextureAddressing.Clamp, TextureFilter.LinearFilter, TextureFilter.PointFilter, MipMapFilter.NoMipFilter);
}
else
{
Expand Down

0 comments on commit 4f2694c

Please sign in to comment.