Feature: added bottom texture for the sky during sky loading.

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@10813 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
experimental
Kae..pl 11 years ago
parent 66f1a0302f
commit 4ecc911b69
  1. 8
      engine/src/blender/com/jme3/scene/plugins/blender/landscape/LandscapeHelper.java
  2. 6
      engine/src/blender/com/jme3/scene/plugins/blender/textures/GeneratedTexture.java

@ -169,6 +169,14 @@ public class LandscapeHelper extends AbstractBlenderHelper {
pixelIO.write(image, 3, pixel, x, y); pixelIO.write(image, 3, pixel, x, y);
} }
} }
LOGGER.fine("Creating bottom texture.");
pixelIO.read(image, 0, pixel, 0, 0);
for (int y = 0; y < size; ++y) {
for (int x = 0; x < size; ++x) {
pixelIO.write(image, 2, pixel, x, y);
}
}
texture = new TextureCubeMap(image); texture = new TextureCubeMap(image);
} }

@ -34,7 +34,7 @@ import com.jme3.texture.TextureCubeMap;
/* package */class GeneratedTexture extends Texture { /* package */class GeneratedTexture extends Texture {
private static final int POSITIVE_X = 0; private static final int POSITIVE_X = 0;
private static final int NEGATIVE_X = 1; private static final int NEGATIVE_X = 1;
// private static final int POSITIVE_Y = 2; private static final int POSITIVE_Y = 2;
private static final int NEGATIVE_Y = 3; private static final int NEGATIVE_Y = 3;
private static final int POSITIVE_Z = 4; private static final int POSITIVE_Z = 4;
private static final int NEGATIVE_Z = 5; private static final int NEGATIVE_Z = 5;
@ -167,8 +167,8 @@ import com.jme3.texture.TextureCubeMap;
textureGenerator.getPixel(pixel, forwardU, 0, upS); textureGenerator.getPixel(pixel, forwardU, 0, upS);
pixelIO.write(image, NEGATIVE_Y, ImageUtils.color(pixel, horizontalColor, zenithColor), x, y);// top pixelIO.write(image, NEGATIVE_Y, ImageUtils.color(pixel, horizontalColor, zenithColor), x, y);// top
// textureGenerator.getPixel(pixel, forwardU, 1, upS); textureGenerator.getPixel(pixel, forwardU, 1, 1 - upS);
// pixelIO.write(image, POSITIVE_Y, ImageUtils.color(pixel, horizontalColor, zenithColor), x, y);//bottom pixelIO.write(image, POSITIVE_Y, ImageUtils.color(pixel, horizontalColor, zenithColor), x, y);// bottom
sideV = FastMath.clamp(sideV - delta, 0, 1); sideV = FastMath.clamp(sideV - delta, 0, 1);
forwardV = FastMath.clamp(forwardV - delta, 0, 1); forwardV = FastMath.clamp(forwardV - delta, 0, 1);

Loading…
Cancel
Save