protected static String formatMatParamTexture(MatParamTexture param) { StringBuilder ret = new StringBuilder(); Texture tex = (Texture) param.getValue(); TextureKey key; if (tex != null) { key = (TextureKey) tex.getKey(); if (key != null && key.isFlipY()) { ret.append("Flip "); } ret.append(formatWrapMode(tex, Texture.WrapAxis.S)); ret.append(formatWrapMode(tex, Texture.WrapAxis.T)); ret.append(formatWrapMode(tex, Texture.WrapAxis.R)); //Min and Mag filter Texture.MinFilter def = Texture.MinFilter.BilinearNoMipMaps; if (tex.getImage().hasMipmaps() || (key != null && key.isGenerateMips())) { def = Texture.MinFilter.Trilinear; } if (tex.getMinFilter() != def) { ret.append("Min").append(tex.getMinFilter().name()).append(" "); } if (tex.getMagFilter() != Texture.MagFilter.Bilinear) { ret.append("Mag").append(tex.getMagFilter().name()).append(" "); } ret.append("\"").append(key.getName()).append("\""); } return ret.toString(); }
@Override public int hashCode() { int hash = 5; // NOTE: Since images are generally considered unique assets in jME3, // using the image's hashCode() implementation is not necessary here // (would be too slow) hash = 67 * hash + (this.image != null ? System.identityHashCode(this.image) : 0); hash = 67 * hash + (this.minificationFilter != null ? this.minificationFilter.hashCode() : 0); hash = 67 * hash + (this.magnificationFilter != null ? this.magnificationFilter.hashCode() : 0); hash = 67 * hash + (this.shadowCompareMode != null ? this.shadowCompareMode.hashCode() : 0); hash = 67 * hash + this.anisotropicFilter; return hash; }
if (tex.getMinFilter().usesMipMapLevels()) { throw new RendererException("non-power-of-2 textures with mip-maps " + "are not supported by the video hardware");
ret += "Min" + texVal.getMinFilter().name()+ " ";
Texture tex = rb.getTexture(); if (tex != null && tex.getMinFilter().usesMipMapLevels()) { setTexture(0, rb.getTexture());
if (tex.getMinFilter().usesMipMapLevels()) { throw new RendererException("non-power-of-2 textures with mip-maps " + "are not supported by the video hardware");
Texture tex = rb.getTexture(); if (tex != null && tex.getMinFilter().usesMipMapLevels()) { setTexture(0, rb.getTexture());
protected static String formatMatParamTexture(MatParamTexture param) { StringBuilder ret = new StringBuilder(); Texture tex = (Texture) param.getValue(); TextureKey key; if (tex != null) { key = (TextureKey) tex.getKey(); if (key != null && key.isFlipY()) { ret.append("Flip "); } ret.append(formatWrapMode(tex, Texture.WrapAxis.S)); ret.append(formatWrapMode(tex, Texture.WrapAxis.T)); ret.append(formatWrapMode(tex, Texture.WrapAxis.R)); //Min and Mag filter Texture.MinFilter def = Texture.MinFilter.BilinearNoMipMaps; if (tex.getImage().hasMipmaps() || (key != null && key.isGenerateMips())) { def = Texture.MinFilter.Trilinear; } if (tex.getMinFilter() != def) { ret.append("Min").append(tex.getMinFilter().name()).append(" "); } if (tex.getMagFilter() != Texture.MagFilter.Bilinear) { ret.append("Mag").append(tex.getMagFilter().name()).append(" "); } ret.append("\"").append(key.getName()).append("\""); } return ret.toString(); }
/** * @param minificationFilter * the new MinificationFilterMode for this texture. * @throws IllegalArgumentException * if minificationFilter is null */ public void setMinFilter(MinFilter minificationFilter) { if (minificationFilter == null) { throw new IllegalArgumentException( "minificationFilter can not be null."); } this.minificationFilter = minificationFilter; if (minificationFilter.usesMipMapLevels() && image != null && !image.isGeneratedMipmapsRequired() && !image.hasMipmaps()) { image.setNeedGeneratedMipmaps(); } }
@Override public int hashCode() { int hash = 5; // NOTE: Since images are generally considered unique assets in jME3, // using the image's hashCode() implementation is not necessary here // (would be too slow) hash = 67 * hash + (this.image != null ? System.identityHashCode(this.image) : 0); hash = 67 * hash + (this.minificationFilter != null ? this.minificationFilter.hashCode() : 0); hash = 67 * hash + (this.magnificationFilter != null ? this.magnificationFilter.hashCode() : 0); hash = 67 * hash + (this.shadowCompareMode != null ? this.shadowCompareMode.hashCode() : 0); hash = 67 * hash + this.anisotropicFilter; return hash; }
@Override public void applyToTexture(final String option, final Texture texture) { texture.setMinFilter(Texture.MinFilter.valueOf(option)); } },
@Override public int hashCode() { int hash = 5; hash = 67 * hash + (this.image != null ? this.image.hashCode() : 0); hash = 67 * hash + (this.minificationFilter != null ? this.minificationFilter.hashCode() : 0); hash = 67 * hash + (this.magnificationFilter != null ? this.magnificationFilter.hashCode() : 0); hash = 67 * hash + (this.shadowCompareMode != null ? this.shadowCompareMode.hashCode() : 0); hash = 67 * hash + this.anisotropicFilter; return hash; }
ret += "Min" + texVal.getMinFilter().name()+ " ";
Texture tex = rb.getTexture(); if (tex != null && tex.getMinFilter().usesMipMapLevels()) { setTexture(0, rb.getTexture());
/** * @param minificationFilter * the new MinificationFilterMode for this texture. * @throws IllegalArgumentException * if minificationFilter is null */ public void setMinFilter(MinFilter minificationFilter) { if (minificationFilter == null) { throw new IllegalArgumentException( "minificationFilter can not be null."); } this.minificationFilter = minificationFilter; if (minificationFilter.usesMipMapLevels() && image != null && !image.isGeneratedMipmapsRequired() && !image.hasMipmaps()) { image.setNeedGeneratedMipmaps(); } }
@Override public void applyToTexture(final String option, final Texture texture) { texture.setMinFilter(Texture.MinFilter.valueOf(option)); } },