Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@
import com.jme3.texture.Image;
import com.jme3.texture.Texture;
import com.jme3.texture.Texture.WrapMode;
import com.jme3.texture.Texture.MagFilter;
import com.jme3.texture.Texture.MinFilter;
import com.jme3.texture.TextureArray;
import java.util.ArrayList;
import java.util.List;
Expand Down Expand Up @@ -279,10 +281,10 @@ private void setUpTerrainMaterial() {
TextureArray metallicRoughnessAoEiTextureArray = new TextureArray(metallicRoughnessAoEiMapImages);

//apply wrapMode to the whole texture array, rather than each individual texture in the array
albedoTextureArray.setWrap(WrapMode.Repeat);
normalParallaxTextureArray.setWrap(WrapMode.Repeat);
metallicRoughnessAoEiTextureArray.setWrap(WrapMode.Repeat);

setWrapAndMipMaps(albedoTextureArray);
setWrapAndMipMaps(normalParallaxTextureArray);
setWrapAndMipMaps(metallicRoughnessAoEiTextureArray);
//assign texture array to materials
matTerrain.setParam("AlbedoTextureArray", VarType.TextureArray, albedoTextureArray);
matTerrain.setParam("NormalParallaxTextureArray", VarType.TextureArray, normalParallaxTextureArray);
Expand Down Expand Up @@ -430,6 +432,12 @@ private void setUpTerrain() {
rootNode.attachChild(terrain);
}

private void setWrapAndMipMaps(Texture texture){
texture.setWrap(WrapMode.Repeat);
texture.setMinFilter(MinFilter.Trilinear);
texture.setMagFilter(MagFilter.Bilinear);
}

private void setUpLights() {
LightProbe probe = (LightProbe) assetManager.loadAsset("Scenes/LightProbes/quarry_Probe.j3o");

Expand Down