From 4ecc911b693efe30ca9185f0cbae426a1d9b221f Mon Sep 17 00:00:00 2001 From: "Kae..pl" Date: Wed, 2 Oct 2013 18:53:48 +0000 Subject: [PATCH] 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 --- .../scene/plugins/blender/landscape/LandscapeHelper.java | 8 ++++++++ .../scene/plugins/blender/textures/GeneratedTexture.java | 6 +++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/engine/src/blender/com/jme3/scene/plugins/blender/landscape/LandscapeHelper.java b/engine/src/blender/com/jme3/scene/plugins/blender/landscape/LandscapeHelper.java index 3449ac19a..4639a2f10 100644 --- a/engine/src/blender/com/jme3/scene/plugins/blender/landscape/LandscapeHelper.java +++ b/engine/src/blender/com/jme3/scene/plugins/blender/landscape/LandscapeHelper.java @@ -169,6 +169,14 @@ public class LandscapeHelper extends AbstractBlenderHelper { 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); } diff --git a/engine/src/blender/com/jme3/scene/plugins/blender/textures/GeneratedTexture.java b/engine/src/blender/com/jme3/scene/plugins/blender/textures/GeneratedTexture.java index f99a8f307..2e173e796 100644 --- a/engine/src/blender/com/jme3/scene/plugins/blender/textures/GeneratedTexture.java +++ b/engine/src/blender/com/jme3/scene/plugins/blender/textures/GeneratedTexture.java @@ -34,7 +34,7 @@ import com.jme3.texture.TextureCubeMap; /* package */class GeneratedTexture extends Texture { private static final int POSITIVE_X = 0; 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 POSITIVE_Z = 4; private static final int NEGATIVE_Z = 5; @@ -167,8 +167,8 @@ import com.jme3.texture.TextureCubeMap; textureGenerator.getPixel(pixel, forwardU, 0, upS); pixelIO.write(image, NEGATIVE_Y, ImageUtils.color(pixel, horizontalColor, zenithColor), x, y);// top - // textureGenerator.getPixel(pixel, forwardU, 1, upS); - // pixelIO.write(image, POSITIVE_Y, ImageUtils.color(pixel, horizontalColor, zenithColor), x, y);//bottom + textureGenerator.getPixel(pixel, forwardU, 1, 1 - upS); + pixelIO.write(image, POSITIVE_Y, ImageUtils.color(pixel, horizontalColor, zenithColor), x, y);// bottom sideV = FastMath.clamp(sideV - delta, 0, 1); forwardV = FastMath.clamp(forwardV - delta, 0, 1);