فهرست منبع

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
Kae..pl 12 سال پیش
والد
کامیت
4ecc911b69

+ 8 - 0
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);
         }

+ 3 - 3
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);