|
52 | 52 | import com.jme3.texture.Image;
|
53 | 53 | import com.jme3.texture.Texture;
|
54 | 54 | import com.jme3.texture.Texture.WrapMode;
|
| 55 | +import com.jme3.texture.Texture.MagFilter; |
| 56 | +import com.jme3.texture.Texture.MinFilter; |
55 | 57 | import com.jme3.texture.TextureArray;
|
56 | 58 | import java.util.ArrayList;
|
57 | 59 | import java.util.List;
|
@@ -279,10 +281,10 @@ private void setUpTerrainMaterial() {
|
279 | 281 | TextureArray metallicRoughnessAoEiTextureArray = new TextureArray(metallicRoughnessAoEiMapImages);
|
280 | 282 |
|
281 | 283 | //apply wrapMode to the whole texture array, rather than each individual texture in the array
|
282 |
| - albedoTextureArray.setWrap(WrapMode.Repeat); |
283 |
| - normalParallaxTextureArray.setWrap(WrapMode.Repeat); |
284 |
| - metallicRoughnessAoEiTextureArray.setWrap(WrapMode.Repeat); |
285 |
| - |
| 284 | + setWrapAndMipMaps(albedoTextureArray); |
| 285 | + setWrapAndMipMaps(normalParallaxTextureArray); |
| 286 | + setWrapAndMipMaps(metallicRoughnessAoEiTextureArray); |
| 287 | + |
286 | 288 | //assign texture array to materials
|
287 | 289 | matTerrain.setParam("AlbedoTextureArray", VarType.TextureArray, albedoTextureArray);
|
288 | 290 | matTerrain.setParam("NormalParallaxTextureArray", VarType.TextureArray, normalParallaxTextureArray);
|
@@ -430,6 +432,12 @@ private void setUpTerrain() {
|
430 | 432 | rootNode.attachChild(terrain);
|
431 | 433 | }
|
432 | 434 |
|
| 435 | + private void setWrapAndMipMaps(Texture texture){ |
| 436 | + texture.setWrap(WrapMode.Repeat); |
| 437 | + texture.setMinFilter(MinFilter.Trilinear); |
| 438 | + texture.setMagFilter(MagFilter.Bilinear); |
| 439 | + } |
| 440 | + |
433 | 441 | private void setUpLights() {
|
434 | 442 | LightProbe probe = (LightProbe) assetManager.loadAsset("Scenes/LightProbes/quarry_Probe.j3o");
|
435 | 443 |
|
|
0 commit comments