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

Commit

Permalink
set filtering options for voxels images.
Browse files Browse the repository at this point in the history
  • Loading branch information
e2002e committed Mar 22, 2024
1 parent cae82b1 commit 3a590f9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Sources/iron/RenderPath.hx
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ class RenderPath {
armory.renderpath.RenderPathCreator.clipmapLevel = (armory.renderpath.RenderPathCreator.clipmapLevel + 1) % Main.voxelgiClipmapCount;
var clipmap = armory.renderpath.RenderPathCreator.clipmaps[armory.renderpath.RenderPathCreator.clipmapLevel];

clipmap.voxelSize = Main.voxelgiVoxelSize * Math.pow(2.0, armory.renderpath.RenderPathCreator.clipmapLevel);
clipmap.voxelSize = armory.renderpath.RenderPathCreator.clipmaps[0].voxelSize * Math.pow(2.0, armory.renderpath.RenderPathCreator.clipmapLevel);

var texelSize = 2.0 * clipmap.voxelSize;
var camera = iron.Scene.active.camera;
Expand Down
9 changes: 7 additions & 2 deletions Sources/iron/object/Uniforms.hx
Original file line number Diff line number Diff line change
Expand Up @@ -178,9 +178,14 @@ class Uniforms {
}

if (isImage) {
g.setImageTexture(context.textureUnits[j], rt.image); // image2D/3D
// Multiple voxel volumes, always set params
g.setTexture3DParameters(context.textureUnits[j], TextureAddressing.Clamp, TextureAddressing.Clamp, TextureAddressing.Clamp, TextureFilter.PointFilter, TextureFilter.PointFilter, MipMapFilter.NoMipFilter);
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.LinearMipFilter);
}
else {
g.setTexture3DParameters(context.textureUnits[j], TextureAddressing.Clamp, TextureAddressing.Clamp, TextureAddressing.Clamp, TextureFilter.LinearFilter, TextureFilter.LinearFilter, MipMapFilter.NoMipFilter);
}
paramsSet = true;
}
else if (rt.isCubeMap) {
Expand Down

0 comments on commit 3a590f9

Please sign in to comment.