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

Commit

Permalink
soft reset.
Browse files Browse the repository at this point in the history
  • Loading branch information
e2002e committed Apr 17, 2024
1 parent 1d88efa commit fa9d54e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
12 changes: 6 additions & 6 deletions Sources/iron/RenderPath.hx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down Expand Up @@ -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,
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,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;
}
Expand Down

0 comments on commit fa9d54e

Please sign in to comment.