AndroidImageInfo
is set in a jME3 image via the {@link Image#setEfficentData(java.lang.Object) }
- * method to retrieve a {@link Bitmap} when it is needed by the renderer.
- * User code may extend AndroidImageInfo
and provide their own implementation of the
- * {@link AndroidImageInfo#loadBitmap()} method to acquire a bitmap by their own means.
- *
- * @author Kirill Vainer
- */
-@Deprecated
-public class AndroidImageInfo extends ImageRaster {
-
- private static final Logger logger = Logger.getLogger(AndroidImageInfo.class.getName());
-
- protected AssetInfo assetInfo;
- protected Bitmap bitmap;
- protected Format format;
-
- public AndroidImageInfo(AssetInfo assetInfo) {
- this.assetInfo = assetInfo;
- }
-
- public Bitmap getBitmap(){
- if (bitmap == null || bitmap.isRecycled()){
- try {
- loadBitmap();
- } catch (IOException ex) {
- // If called first inside AssetManager, the error will propagate
- // correctly. Assuming that if the first calls succeeds
- // then subsequent calls will as well.
- throw new AssetLoadException("Failed to load image " + assetInfo.getKey(), ex);
- }
- }
- return bitmap;
- }
-
- public void notifyBitmapUploaded() {
- // Default function is to recycle the bitmap.
- if (bitmap != null && !bitmap.isRecycled()) {
- bitmap.recycle();
- bitmap = null;
- logger.log(Level.FINE, "Bitmap was deleted. ");
- }
- }
-
- public Format getFormat(){
- return format;
- }
-
- @Override
- public int getWidth() {
- return getBitmap().getWidth();
- }
-
- @Override
- public int getHeight() {
- return getBitmap().getHeight();
- }
-
- @Override
- public void setPixel(int x, int y, ColorRGBA color) {
- getBitmap().setPixel(x, y, color.asIntARGB());
- }
-
- @Override
- public ColorRGBA getPixel(int x, int y, ColorRGBA store) {
- if (store == null) {
- store = new ColorRGBA();
- }
- store.fromIntARGB(getBitmap().getPixel(x, y));
- return store;
- }
-
- /**
- * Loads the bitmap directly from the asset info, possibly updating
- * or creating the image object.
- */
- protected void loadBitmap() throws IOException{
- InputStream in = null;
- try {
- in = assetInfo.openStream();
- bitmap = BitmapFactory.decodeStream(in);
- if (bitmap == null) {
- throw new IOException("Failed to load image: " + assetInfo.getKey().getName());
- }
- } finally {
- if (in != null) {
- in.close();
- }
- }
-
- switch (bitmap.getConfig()) {
- case ALPHA_8:
- format = Image.Format.Alpha8;
- break;
- case ARGB_8888:
- format = Image.Format.RGBA8;
- break;
- case RGB_565:
- format = Image.Format.RGB565;
- break;
- default:
- // This should still work as long
- // as renderer doesn't check format
- // but just loads bitmap directly.
- format = null;
- }
-
- TextureKey texKey = (TextureKey) assetInfo.getKey();
- if (texKey.isFlipY()) {
- // Flip the image, then delete the old one.
- Matrix flipMat = new Matrix();
- flipMat.preScale(1.0f, -1.0f);
- Bitmap newBitmap = Bitmap.createBitmap(bitmap, 0, 0, bitmap.getWidth(), bitmap.getHeight(), flipMat, false);
- bitmap.recycle();
- bitmap = newBitmap;
-
- if (bitmap == null) {
- throw new IOException("Failed to flip image: " + texKey);
- }
- }
- }
-}
diff --git a/jme3-android/src/main/java/com/jme3/audio/android/AndroidMediaPlayerAudioRenderer.java b/jme3-android/src/main/java/com/jme3/audio/android/AndroidMediaPlayerAudioRenderer.java
deleted file mode 100644
index 394cc257b..000000000
--- a/jme3-android/src/main/java/com/jme3/audio/android/AndroidMediaPlayerAudioRenderer.java
+++ /dev/null
@@ -1,533 +0,0 @@
-/*
- * Copyright (c) 2009-2012 jMonkeyEngine
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * * Neither the name of 'jMonkeyEngine' nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
- * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-package com.jme3.audio.android;
-
-import android.app.Activity;
-import android.content.Context;
-import android.content.res.AssetFileDescriptor;
-import android.content.res.AssetManager;
-import android.media.AudioManager;
-import android.media.MediaPlayer;
-import android.media.SoundPool;
-import com.jme3.asset.AssetKey;
-import com.jme3.audio.*;
-import com.jme3.audio.AudioSource.Status;
-import com.jme3.audio.openal.ALAudioRenderer;
-import com.jme3.math.FastMath;
-import com.jme3.math.Vector3f;
-import java.io.IOException;
-import java.util.HashMap;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-/**
- * This class is the android implementation for {@link AudioRenderer}
- *
- * @author larynx
- * @author plan_rich
- *
- * @deprecated No longer supported due to too many limitations.
- * Please use the generic {@link ALAudioRenderer} instead.
- */
-@Deprecated
-public class AndroidMediaPlayerAudioRenderer implements AudioRenderer,
- SoundPool.OnLoadCompleteListener, MediaPlayer.OnCompletionListener {
-
- private static final Logger logger = Logger.getLogger(AndroidMediaPlayerAudioRenderer.class.getName());
- private final static int MAX_NUM_CHANNELS = 16;
- private final HashMapuploadTextureBitmap
uploads a native android bitmap
- */
- public static void uploadTextureBitmap(final int target, Bitmap bitmap, boolean needMips) {
- uploadTextureBitmap(target, bitmap, needMips, false, 0, 0);
- }
-
- /**
- * uploadTextureBitmap
uploads a native android bitmap
- */
- public static void uploadTextureBitmap(final int target, Bitmap bitmap, boolean needMips, boolean subTexture, int x, int y) {
- boolean recycleBitmap = false;
- //TODO, maybe this should raise an exception when NPOT is not supported
-
- boolean willCompress = ENABLE_COMPRESSION && ETC1support && !bitmap.hasAlpha();
- if (needMips && willCompress) {
- // Image is compressed and mipmaps are desired, generate them
- // using software.
- buildMipmap(bitmap, willCompress);
- } else {
- if (willCompress) {
- // Image is compressed but mipmaps are not desired, upload directly.
- logger.log(Level.FINEST, " - Uploading compressed bitmap. Mipmaps are not generated.");
- uploadBitmapAsCompressed(target, 0, bitmap, subTexture, x, y);
-
- } else {
- // Image is not compressed, mipmaps may or may not be desired.
- logger.log(Level.FINEST, " - Uploading bitmap directly.{0}",
- (needMips
- ? " Mipmaps will be generated in HARDWARE"
- : " Mipmaps are not generated."));
- if (subTexture) {
- System.err.println("x : " + x + " y :" + y + " , " + bitmap.getWidth() + "/" + bitmap.getHeight());
- GLUtils.texSubImage2D(target, 0, x, y, bitmap);
- RendererUtil.checkGLError();
- } else {
- GLUtils.texImage2D(target, 0, bitmap, 0);
- RendererUtil.checkGLError();
- }
-
- if (needMips) {
- // No pregenerated mips available,
- // generate from base level if required
- GLES20.glGenerateMipmap(target);
- RendererUtil.checkGLError();
- }
- }
- }
-
- if (recycleBitmap) {
- bitmap.recycle();
- }
- }
-
- public static void uploadTextureAny(Image img, int target, int index, boolean needMips) {
- if (img.getEfficentData() instanceof AndroidImageInfo) {
- logger.log(Level.FINEST, " === Uploading image {0}. Using BITMAP PATH === ", img);
- // If image was loaded from asset manager, use fast path
- AndroidImageInfo imageInfo = (AndroidImageInfo) img.getEfficentData();
- uploadTextureBitmap(target, imageInfo.getBitmap(), needMips);
- } else {
- logger.log(Level.FINEST, " === Uploading image {0}. Using BUFFER PATH === ", img);
- boolean wantGeneratedMips = needMips && !img.hasMipmaps();
- if (wantGeneratedMips && img.getFormat().isCompressed()) {
- logger.log(Level.WARNING, "Generating mipmaps is only"
- + " supported for Bitmap based or non-compressed images!");
- }
-
- // Upload using slower path
- logger.log(Level.FINEST, " - Uploading bitmap directly.{0}",
- (wantGeneratedMips
- ? " Mipmaps will be generated in HARDWARE"
- : " Mipmaps are not generated."));
-
- uploadTexture(img, target, index);
-
- // Image was uploaded using slower path, since it is not compressed,
- // then compress it
- if (wantGeneratedMips) {
- // No pregenerated mips available,
- // generate from base level if required
- GLES20.glGenerateMipmap(target);
- }
- }
- }
-
- private static void unsupportedFormat(Format fmt) {
- throw new UnsupportedOperationException("The image format '" + fmt + "' is unsupported by the video hardware.");
- }
-
- public static AndroidGLImageFormat getImageFormat(Format fmt, boolean forRenderBuffer)
- throws UnsupportedOperationException {
- AndroidGLImageFormat imageFormat = new AndroidGLImageFormat();
- switch (fmt) {
- case Depth32:
- case Depth32F:
- throw new UnsupportedOperationException("The image format '"
- + fmt + "' is not supported by OpenGL ES 2.0 specification.");
- case Alpha8:
- imageFormat.format = GLES20.GL_ALPHA;
- imageFormat.dataType = GLES20.GL_UNSIGNED_BYTE;
- if (RGBA8) {
- imageFormat.renderBufferStorageFormat = GL_RGBA8;
- } else {
- // Highest precision alpha supported by vanilla OGLES2
- imageFormat.renderBufferStorageFormat = GLES20.GL_RGBA4;
- }
- break;
- case Luminance8:
- imageFormat.format = GLES20.GL_LUMINANCE;
- imageFormat.dataType = GLES20.GL_UNSIGNED_BYTE;
- if (RGBA8) {
- imageFormat.renderBufferStorageFormat = GL_RGBA8;
- } else {
- // Highest precision luminance supported by vanilla OGLES2
- imageFormat.renderBufferStorageFormat = GLES20.GL_RGB565;
- }
- break;
- case Luminance8Alpha8:
- imageFormat.format = GLES20.GL_LUMINANCE_ALPHA;
- imageFormat.dataType = GLES20.GL_UNSIGNED_BYTE;
- if (RGBA8) {
- imageFormat.renderBufferStorageFormat = GL_RGBA8;
- } else {
- imageFormat.renderBufferStorageFormat = GLES20.GL_RGBA4;
- }
- break;
- case RGB565:
- imageFormat.format = GLES20.GL_RGB;
- imageFormat.dataType = GLES20.GL_UNSIGNED_SHORT_5_6_5;
- imageFormat.renderBufferStorageFormat = GLES20.GL_RGB565;
- break;
- case RGB5A1:
- imageFormat.format = GLES20.GL_RGBA;
- imageFormat.dataType = GLES20.GL_UNSIGNED_SHORT_5_5_5_1;
- imageFormat.renderBufferStorageFormat = GLES20.GL_RGB5_A1;
- break;
- case RGB8:
- imageFormat.format = GLES20.GL_RGB;
- imageFormat.dataType = GLES20.GL_UNSIGNED_BYTE;
- if (RGBA8) {
- imageFormat.renderBufferStorageFormat = GL_RGBA8;
- } else {
- // Fallback: Use RGB565 if RGBA8 is not available.
- imageFormat.renderBufferStorageFormat = GLES20.GL_RGB565;
- }
- break;
- case BGR8:
- imageFormat.format = GLES20.GL_RGB;
- imageFormat.dataType = GLES20.GL_UNSIGNED_BYTE;
- if (RGBA8) {
- imageFormat.renderBufferStorageFormat = GL_RGBA8;
- } else {
- imageFormat.renderBufferStorageFormat = GLES20.GL_RGB565;
- }
- break;
- case RGBA8:
- imageFormat.format = GLES20.GL_RGBA;
- imageFormat.dataType = GLES20.GL_UNSIGNED_BYTE;
- if (RGBA8) {
- imageFormat.renderBufferStorageFormat = GL_RGBA8;
- } else {
- imageFormat.renderBufferStorageFormat = GLES20.GL_RGBA4;
- }
- break;
- case Depth:
- case Depth16:
- if (!DEPTH_TEXTURE && !forRenderBuffer) {
- unsupportedFormat(fmt);
- }
- imageFormat.format = GLES20.GL_DEPTH_COMPONENT;
- imageFormat.dataType = GLES20.GL_UNSIGNED_SHORT;
- imageFormat.renderBufferStorageFormat = GLES20.GL_DEPTH_COMPONENT16;
- break;
- case Depth24:
- case Depth24Stencil8:
- if (!DEPTH_TEXTURE) {
- unsupportedFormat(fmt);
- }
- if (DEPTH24_STENCIL8) {
- // NEW: True Depth24 + Stencil8 format.
- imageFormat.format = GL_DEPTH_STENCIL_OES;
- imageFormat.dataType = GL_UNSIGNED_INT_24_8_OES;
- imageFormat.renderBufferStorageFormat = GL_DEPTH24_STENCIL8_OES;
- } else {
- // Vanilla OGLES2, only Depth16 available.
- imageFormat.format = GLES20.GL_DEPTH_COMPONENT;
- imageFormat.dataType = GLES20.GL_UNSIGNED_SHORT;
- imageFormat.renderBufferStorageFormat = GLES20.GL_DEPTH_COMPONENT16;
- }
- break;
- case DXT1:
- if (!DXT1) {
- unsupportedFormat(fmt);
- }
- imageFormat.format = GL_DXT1;
- imageFormat.dataType = GLES20.GL_UNSIGNED_BYTE;
- imageFormat.compress = true;
- break;
- case DXT1A:
- if (!DXT1) {
- unsupportedFormat(fmt);
- }
- imageFormat.format = GL_DXT1A;
- imageFormat.dataType = GLES20.GL_UNSIGNED_BYTE;
- imageFormat.compress = true;
- break;
- default:
- throw new UnsupportedOperationException("Unrecognized format: " + fmt);
- }
- return imageFormat;
- }
-
- public static class AndroidGLImageFormat {
-
- boolean compress = false;
- int format = -1;
- int renderBufferStorageFormat = -1;
- int dataType = -1;
- }
-
- private static void uploadTexture(Image img,
- int target,
- int index) {
-
- if (img.getEfficentData() instanceof AndroidImageInfo) {
- throw new RendererException("This image uses efficient data. "
- + "Use uploadTextureBitmap instead.");
- }
-
- // Otherwise upload image directly.
- // Prefer to only use power of 2 textures here to avoid errors.
- Image.Format fmt = img.getFormat();
- ByteBuffer data;
- if (index >= 0 || img.getData() != null && img.getData().size() > 0) {
- data = img.getData(index);
- } else {
- data = null;
- }
-
- int width = img.getWidth();
- int height = img.getHeight();
-
- if (!NPOT && img.isNPOT()) {
- // Check if texture is POT
- throw new RendererException("Non-power-of-2 textures "
- + "are not supported by the video hardware "
- + "and no scaling path available for image: " + img);
- }
- AndroidGLImageFormat imageFormat = getImageFormat(fmt, false);
-
- if (data != null) {
- GLES20.glPixelStorei(GLES20.GL_UNPACK_ALIGNMENT, 1);
- }
-
- int[] mipSizes = img.getMipMapSizes();
- int pos = 0;
- if (mipSizes == null) {
- if (data != null) {
- mipSizes = new int[]{data.capacity()};
- } else {
- mipSizes = new int[]{width * height * fmt.getBitsPerPixel() / 8};
- }
- }
-
- for (int i = 0; i < mipSizes.length; i++) {
- int mipWidth = Math.max(1, width >> i);
- int mipHeight = Math.max(1, height >> i);
-
- if (data != null) {
- data.position(pos);
- data.limit(pos + mipSizes[i]);
- }
-
- if (imageFormat.compress && data != null) {
- GLES20.glCompressedTexImage2D(target,
- i,
- imageFormat.format,
- mipWidth,
- mipHeight,
- 0,
- data.remaining(),
- data);
- } else {
- GLES20.glTexImage2D(target,
- i,
- imageFormat.format,
- mipWidth,
- mipHeight,
- 0,
- imageFormat.format,
- imageFormat.dataType,
- data);
- }
-
- pos += mipSizes[i];
- }
- }
-
- /**
- * Update the texture currently bound to target at with data from the given
- * Image at position x and y. The parameter index is used as the zoffset in
- * case a 3d texture or texture 2d array is being updated.
- *
- * @param image Image with the source data (this data will be put into the
- * texture)
- * @param target the target texture
- * @param index the mipmap level to update
- * @param x the x position where to put the image in the texture
- * @param y the y position where to put the image in the texture
- */
- public static void uploadSubTexture(
- Image img,
- int target,
- int index,
- int x,
- int y) {
- if (img.getEfficentData() instanceof AndroidImageInfo) {
- AndroidImageInfo imageInfo = (AndroidImageInfo) img.getEfficentData();
- uploadTextureBitmap(target, imageInfo.getBitmap(), true, true, x, y);
- return;
- }
-
- // Otherwise upload image directly.
- // Prefer to only use power of 2 textures here to avoid errors.
- Image.Format fmt = img.getFormat();
- ByteBuffer data;
- if (index >= 0 || img.getData() != null && img.getData().size() > 0) {
- data = img.getData(index);
- } else {
- data = null;
- }
-
- int width = img.getWidth();
- int height = img.getHeight();
-
- if (!NPOT && img.isNPOT()) {
- // Check if texture is POT
- throw new RendererException("Non-power-of-2 textures "
- + "are not supported by the video hardware "
- + "and no scaling path available for image: " + img);
- }
- AndroidGLImageFormat imageFormat = getImageFormat(fmt, false);
-
- if (data != null) {
- GLES20.glPixelStorei(GLES20.GL_UNPACK_ALIGNMENT, 1);
- }
-
- int[] mipSizes = img.getMipMapSizes();
- int pos = 0;
- if (mipSizes == null) {
- if (data != null) {
- mipSizes = new int[]{data.capacity()};
- } else {
- mipSizes = new int[]{width * height * fmt.getBitsPerPixel() / 8};
- }
- }
-
- for (int i = 0; i < mipSizes.length; i++) {
- int mipWidth = Math.max(1, width >> i);
- int mipHeight = Math.max(1, height >> i);
-
- if (data != null) {
- data.position(pos);
- data.limit(pos + mipSizes[i]);
- }
-
- if (imageFormat.compress && data != null) {
- GLES20.glCompressedTexSubImage2D(target, i, x, y, mipWidth, mipHeight, imageFormat.format, data.remaining(), data);
- RendererUtil.checkGLError();
- } else {
- GLES20.glTexSubImage2D(target, i, x, y, mipWidth, mipHeight, imageFormat.format, imageFormat.dataType, data);
- RendererUtil.checkGLError();
- }
-
- pos += mipSizes[i];
- }
- }
-}
diff --git a/jme3-android/src/main/java/com/jme3/texture/plugins/AndroidImageLoader.java b/jme3-android/src/main/java/com/jme3/texture/plugins/AndroidImageLoader.java
deleted file mode 100644
index f3c1464a2..000000000
--- a/jme3-android/src/main/java/com/jme3/texture/plugins/AndroidImageLoader.java
+++ /dev/null
@@ -1,23 +0,0 @@
-package com.jme3.texture.plugins;
-
-import android.graphics.Bitmap;
-import com.jme3.asset.AndroidImageInfo;
-import com.jme3.asset.AssetInfo;
-import com.jme3.asset.AssetLoader;
-import com.jme3.texture.Image;
-import com.jme3.texture.image.ColorSpace;
-import java.io.IOException;
-
-@Deprecated
-public class AndroidImageLoader implements AssetLoader {
-
- public Object load(AssetInfo info) throws IOException {
- AndroidImageInfo imageInfo = new AndroidImageInfo(info);
- Bitmap bitmap = imageInfo.getBitmap();
-
- Image image = new Image(imageInfo.getFormat(), bitmap.getWidth(), bitmap.getHeight(), null, ColorSpace.sRGB);
-
- image.setEfficentData(imageInfo);
- return image;
- }
-}
diff --git a/jme3-android/src/main/java/jme3test/android/SimpleTexturedTest.java b/jme3-android/src/main/java/jme3test/android/SimpleTexturedTest.java
index bfc106b17..4ff0c5df7 100644
--- a/jme3-android/src/main/java/jme3test/android/SimpleTexturedTest.java
+++ b/jme3-android/src/main/java/jme3test/android/SimpleTexturedTest.java
@@ -46,7 +46,7 @@ public class SimpleTexturedTest extends SimpleApplication {
shapeSphere = new Sphere(16, 16, .5f);
- shapeBox = new Box(Vector3f.ZERO, 0.3f, 0.3f, 0.3f);
+ shapeBox = new Box(0.3f, 0.3f, 0.3f);
// ModelConverter.optimize(geom);
diff --git a/jme3-bullet-native/build.gradle b/jme3-bullet-native/build.gradle
index dbb74981a..62a30fb1b 100644
--- a/jme3-bullet-native/build.gradle
+++ b/jme3-bullet-native/build.gradle
@@ -34,7 +34,14 @@ libraries {
// linker.args "-static-libstdc++"
} else if (targetPlatform.operatingSystem.name == "windows") {
if (toolChain in Gcc) {
- cppCompiler.args '-I', "${org.gradle.internal.jvm.Jvm.current().javaHome}/include/win32"
+ if (toolChain.name.startsWith('mingw')) {
+ cppCompiler.args '-I', "${org.gradle.internal.jvm.Jvm.current().javaHome}/include/linux"
+ } else {
+ cppCompiler.args '-I', "${org.gradle.internal.jvm.Jvm.current().javaHome}/include/win32"
+ }
+ cppCompiler.args "-fpermissive"
+ cppCompiler.args "-static"
+ linker.args "-static"
}
else if (toolChain in VisualCpp) {
cppCompiler.args "/I${org.gradle.internal.jvm.Jvm.current().javaHome}\\include\\win32"
@@ -76,6 +83,31 @@ sourceSets {
// Set of target platforms, will be available based on build system
model {
+
+ toolChains {
+ gcc(Gcc)
+ mingw_x86(Gcc) {
+ eachPlatform() {
+ cCompiler.executable "i686-w64-mingw32-gcc"
+ cppCompiler.executable "i686-w64-mingw32-g++"
+ linker.executable "i686-w64-mingw32-g++"
+ assembler.executable "i686-w64-mingw32-g++"
+ staticLibArchiver.executable "i686-w64-mingw32-gcc-ar"
+ }
+ target("windows_x86")
+ }
+ mingw_x86_64(Gcc) {
+ eachPlatform() {
+ cCompiler.executable "x86_64-w64-mingw32-gcc"
+ cppCompiler.executable "x86_64-w64-mingw32-g++"
+ linker.executable "x86_64-w64-mingw32-g++"
+ assembler.executable "x86_64-w64-mingw32-g++"
+ staticLibArchiver.executable "x86_64-w64-mingw32-gcc-ar"
+ }
+ target("windows_x86_64")
+ }
+ }
+
platforms{
// osx_universal { // TODO: universal binary doesn't work?
// architecture 'x86_64'
diff --git a/jme3-core/src/main/java/com/jme3/animation/BoneAnimation.java b/jme3-core/src/main/java/com/jme3/animation/BoneAnimation.java
deleted file mode 100644
index 735ee05a5..000000000
--- a/jme3-core/src/main/java/com/jme3/animation/BoneAnimation.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Copyright (c) 2009-2012 jMonkeyEngine
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * * Neither the name of 'jMonkeyEngine' nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
- * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-package com.jme3.animation;
-
-/**
- * @deprecated use Animation instead with tracks of selected type (ie. BoneTrack, SpatialTrack, MeshTrack)
- */
-@Deprecated
-public final class BoneAnimation extends Animation {
-
- @Deprecated
- public BoneAnimation(String name, float length) {
- super(name, length);
- }
-}
diff --git a/jme3-core/src/main/java/com/jme3/animation/SpatialAnimation.java b/jme3-core/src/main/java/com/jme3/animation/SpatialAnimation.java
deleted file mode 100644
index 4a552bba6..000000000
--- a/jme3-core/src/main/java/com/jme3/animation/SpatialAnimation.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Copyright (c) 2009-2012 jMonkeyEngine
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * * Neither the name of 'jMonkeyEngine' nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
- * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-package com.jme3.animation;
-
-/**
- * @deprecated use Animation instead with tracks of selected type (ie. BoneTrack, SpatialTrack, MeshTrack)
- */
-@Deprecated
-public class SpatialAnimation extends Animation {
- public SpatialAnimation(String name, float length) {
- super(name, length);
- }
-}
diff --git a/jme3-core/src/main/java/com/jme3/app/SimpleApplication.java b/jme3-core/src/main/java/com/jme3/app/SimpleApplication.java
index 2ab008c5c..01c04601c 100644
--- a/jme3-core/src/main/java/com/jme3/app/SimpleApplication.java
+++ b/jme3-core/src/main/java/com/jme3/app/SimpleApplication.java
@@ -32,6 +32,7 @@
package com.jme3.app;
import com.jme3.app.state.AppState;
+import com.jme3.audio.AudioListenerState;
import com.jme3.font.BitmapFont;
import com.jme3.font.BitmapText;
import com.jme3.input.FlyByCamera;
@@ -96,7 +97,7 @@ public abstract class SimpleApplication extends LegacyApplication {
}
public SimpleApplication() {
- this( new StatsAppState(), new FlyCamAppState(), new DebugKeysAppState() );
+ this(new StatsAppState(), new FlyCamAppState(), new AudioListenerState(), new DebugKeysAppState());
}
public SimpleApplication( AppState... initialStates ) {
diff --git a/jme3-core/src/main/java/com/jme3/asset/TextureKey.java b/jme3-core/src/main/java/com/jme3/asset/TextureKey.java
index c2b5154ab..cb5450b35 100644
--- a/jme3-core/src/main/java/com/jme3/asset/TextureKey.java
+++ b/jme3-core/src/main/java/com/jme3/asset/TextureKey.java
@@ -123,24 +123,6 @@ public class TextureKey extends AssetKeyAudioListenerState
updates the audio listener's position,
+ * orientation, and velocity from a {@link Camera}.
+ *
+ * @author Kirill Vainer
+ */
+public class AudioListenerState extends BaseAppState {
+
+ private Listener listener;
+ private Camera camera;
+ private float lastTpf;
+
+ public AudioListenerState() {
+ }
+
+ @Override
+ protected void initialize(Application app) {
+ this.camera = app.getCamera();
+ this.listener = app.getListener();
+ }
+
+ @Override
+ protected void cleanup(Application app) {
+ }
+
+ @Override
+ public void update(float tpf) {
+ lastTpf = tpf;
+ }
+
+ @Override
+ public void render(RenderManager rm) {
+ if (!isEnabled()) {
+ return;
+ }
+
+ Vector3f lastLocation = listener.getLocation();
+ Vector3f currentLocation = camera.getLocation();
+ Vector3f velocity = listener.getVelocity();
+
+ if (!lastLocation.equals(currentLocation)) {
+ velocity.set(currentLocation).subtractLocal(lastLocation);
+ velocity.multLocal(1f / lastTpf);
+ listener.setLocation(currentLocation);
+ listener.setVelocity(velocity);
+ } else if (!velocity.equals(Vector3f.ZERO)) {
+ listener.setVelocity(Vector3f.ZERO);
+ }
+
+ Quaternion lastRotation = listener.getRotation();
+ Quaternion currentRotation = camera.getRotation();
+ if (!lastRotation.equals(currentRotation)) {
+ listener.setRotation(currentRotation);
+ }
+ }
+
+ @Override
+ protected void onEnable() {
+ }
+
+ @Override
+ protected void onDisable() {
+ }
+}
diff --git a/jme3-core/src/main/java/com/jme3/audio/AudioNode.java b/jme3-core/src/main/java/com/jme3/audio/AudioNode.java
index 55a57768d..9f44c82be 100644
--- a/jme3-core/src/main/java/com/jme3/audio/AudioNode.java
+++ b/jme3-core/src/main/java/com/jme3/audio/AudioNode.java
@@ -78,6 +78,7 @@ public class AudioNode extends Node implements AudioSource {
protected transient AudioData data = null;
protected transient volatile AudioSource.Status status = AudioSource.Status.Stopped;
protected transient volatile int channel = -1;
+ protected Vector3f previousWorldTranslation = Vector3f.NAN;
protected Vector3f velocity = new Vector3f();
protected boolean reverbEnabled = false;
protected float maxDistance = 200; // 200 meters
@@ -88,6 +89,8 @@ public class AudioNode extends Node implements AudioSource {
protected float innerAngle = 360;
protected float outerAngle = 360;
protected boolean positional = true;
+ protected boolean velocityFromTranslation = false;
+ protected float lastTpf;
/**
* Status
indicates the current status of the audio node.
@@ -702,17 +705,44 @@ public class AudioNode extends Node implements AudioSource {
}
}
+ public boolean isVelocityFromTranslation() {
+ return velocityFromTranslation;
+ }
+
+ public void setVelocityFromTranslation(boolean velocityFromTranslation) {
+ this.velocityFromTranslation = velocityFromTranslation;
+ }
+
@Override
- public void updateGeometricState(){
- boolean updatePos = false;
- if ((refreshFlags & RF_TRANSFORM) != 0){
- updatePos = true;
- }
+ public void updateLogicalState(float tpf) {
+ super.updateLogicalState(tpf);
+ lastTpf = tpf;
+ }
+ @Override
+ public void updateGeometricState() {
super.updateGeometricState();
- if (updatePos && channel >= 0)
+ if (channel < 0) {
+ return;
+ }
+
+ Vector3f currentWorldTranslation = worldTransform.getTranslation();
+
+ if (Float.isNaN(previousWorldTranslation.x)
+ || !previousWorldTranslation.equals(currentWorldTranslation)) {
+
getRenderer().updateSourceParam(this, AudioParam.Position);
+
+ if (velocityFromTranslation) {
+ velocity.set(currentWorldTranslation).subtractLocal(previousWorldTranslation);
+ velocity.multLocal(1f / lastTpf);
+
+ getRenderer().updateSourceParam(this, AudioParam.Velocity);
+ }
+
+ previousWorldTranslation.set(currentWorldTranslation);
+ }
}
@Override
@@ -772,6 +802,7 @@ public class AudioNode extends Node implements AudioSource {
oc.write(outerAngle, "outer_angle", 360);
oc.write(positional, "positional", false);
+ oc.write(velocityFromTranslation, "velocity_from_translation", false);
}
@Override
@@ -806,6 +837,7 @@ public class AudioNode extends Node implements AudioSource {
outerAngle = ic.readFloat("outer_angle", 360);
positional = ic.readBoolean("positional", false);
+ velocityFromTranslation = ic.readBoolean("velocity_from_translation", false);
if (audioKey != null) {
try {
diff --git a/jme3-core/src/main/java/com/jme3/audio/Listener.java b/jme3-core/src/main/java/com/jme3/audio/Listener.java
index 8e59eac0c..afd08a730 100644
--- a/jme3-core/src/main/java/com/jme3/audio/Listener.java
+++ b/jme3-core/src/main/java/com/jme3/audio/Listener.java
@@ -36,9 +36,9 @@ import com.jme3.math.Vector3f;
public class Listener {
- private Vector3f location;
- private Vector3f velocity;
- private Quaternion rotation;
+ private final Vector3f location;
+ private final Vector3f velocity;
+ private final Quaternion rotation;
private float volume = 1;
private AudioRenderer renderer;
diff --git a/jme3-core/src/main/java/com/jme3/audio/openal/ALAudioRenderer.java b/jme3-core/src/main/java/com/jme3/audio/openal/ALAudioRenderer.java
index 0878e23fa..82c588d4d 100644
--- a/jme3-core/src/main/java/com/jme3/audio/openal/ALAudioRenderer.java
+++ b/jme3-core/src/main/java/com/jme3/audio/openal/ALAudioRenderer.java
@@ -904,11 +904,12 @@ public class ALAudioRenderer implements AudioRenderer, Runnable {
} else {
// Buffer finished playing.
if (src.isLooping()) {
- throw new AssertionError("Unexpected state: " +
- "A looping sound has stopped playing");
- } else {
- reclaimChannel = true;
+ // When a device is disconnected, all sources
+ // will enter the "stopped" state.
+ logger.warning("A looping sound has stopped playing");
}
+
+ reclaimChannel = true;
}
if (reclaimChannel) {
diff --git a/jme3-core/src/main/java/com/jme3/cinematic/MotionPath.java b/jme3-core/src/main/java/com/jme3/cinematic/MotionPath.java
index 9eef4b8d3..2a6325747 100644
--- a/jme3-core/src/main/java/com/jme3/cinematic/MotionPath.java
+++ b/jme3-core/src/main/java/com/jme3/cinematic/MotionPath.java
@@ -121,7 +121,8 @@ public class MotionPath implements Savable {
Material m = assetManager.loadMaterial("Common/Materials/RedColor.j3m");
for (IteratorTestFunction
specifies the testing function for stencil test
- * function and alpha test function.
+ * function.
*
- * The functions work similarly as described except that for stencil - * test function, the reference value given in the stencil command is - * the input value while the reference is the value already in the stencil - * buffer. + *
+ * The reference value given in the stencil command is the input value while
+ * the reference is the value already in the stencil buffer.
*/
public enum TestFunction {
@@ -118,7 +117,94 @@ public class RenderState implements Cloneable, Savable {
/**
* The test always passes
*/
- Always,}
+ Always
+ }
+
+ /**
+ * BlendEquation
specifies the blending equation to combine
+ * pixels.
+ */
+ public enum BlendEquation {
+ /**
+ * Sets the blend equation so that the source and destination data are
+ * added. (Default) Clamps to [0,1] Useful for things like antialiasing
+ * and transparency.
+ */
+ Add,
+ /**
+ * Sets the blend equation so that the source and destination data are
+ * subtracted (Src - Dest). Clamps to [0,1] Falls back to Add if
+ * supportsSubtract is false.
+ */
+ Subtract,
+ /**
+ * Same as Subtract, but the order is reversed (Dst - Src). Clamps to
+ * [0,1] Falls back to Add if supportsSubtract is false.
+ */
+ ReverseSubtract,
+ /**
+ * Sets the blend equation so that each component of the result color is
+ * the minimum of the corresponding components of the source and
+ * destination colors. This and Max are useful for applications that
+ * analyze image data (image thresholding against a constant color, for
+ * example). Falls back to Add if supportsMinMax is false.
+ */
+ Min,
+ /**
+ * Sets the blend equation so that each component of the result color is
+ * the maximum of the corresponding components of the source and
+ * destination colors. This and Min are useful for applications that
+ * analyze image data (image thresholding against a constant color, for
+ * example). Falls back to Add if supportsMinMax is false.
+ */
+ Max
+ }
+
+ /**
+ * BlendEquationAlpha
specifies the blending equation to
+ * combine pixels for the alpha component.
+ */
+ public enum BlendEquationAlpha {
+ /**
+ * Sets the blend equation to be the same as the one defined by
+ * {@link #blendEquation}.
+ *
+ */
+ InheritColor,
+ /**
+ * Sets the blend equation so that the source and destination data are
+ * added. (Default) Clamps to [0,1] Useful for things like antialiasing
+ * and transparency.
+ */
+ Add,
+ /**
+ * Sets the blend equation so that the source and destination data are
+ * subtracted (Src - Dest). Clamps to [0,1] Falls back to Add if
+ * supportsSubtract is false.
+ */
+ Subtract,
+ /**
+ * Same as Subtract, but the order is reversed (Dst - Src). Clamps to
+ * [0,1] Falls back to Add if supportsSubtract is false.
+ */
+ ReverseSubtract,
+ /**
+ * Sets the blend equation so that the result alpha is the minimum of
+ * the source alpha and destination alpha. This and Max are useful for
+ * applications that analyze image data (image thresholding against a
+ * constant color, for example). Falls back to Add if supportsMinMax is
+ * false.
+ */
+ Min,
+ /**
+ * sSets the blend equation so that the result alpha is the maximum of
+ * the source alpha and destination alpha. This and Min are useful for
+ * applications that analyze image data (image thresholding against a
+ * constant color, for example). Falls back to Add if supportsMinMax is
+ * false.
+ */
+ Max
+ }
/**
* BlendMode
specifies the blending operation to use.
@@ -276,19 +362,16 @@ public class RenderState implements Cloneable, Savable {
}
static {
- ADDITIONAL.applyPointSprite = false;
ADDITIONAL.applyWireFrame = false;
ADDITIONAL.applyCullMode = false;
ADDITIONAL.applyDepthWrite = false;
ADDITIONAL.applyDepthTest = false;
ADDITIONAL.applyColorWrite = false;
+ ADDITIONAL.applyBlendEquation = false;
+ ADDITIONAL.applyBlendEquationAlpha = false;
ADDITIONAL.applyBlendMode = false;
- ADDITIONAL.applyAlphaTest = false;
- ADDITIONAL.applyAlphaFallOff = false;
ADDITIONAL.applyPolyOffset = false;
}
- boolean pointSprite = false;
- boolean applyPointSprite = true;
boolean wireframe = false;
boolean applyWireFrame = true;
FaceCullMode cullMode = FaceCullMode.Back;
@@ -299,12 +382,12 @@ public class RenderState implements Cloneable, Savable {
boolean applyDepthTest = true;
boolean colorWrite = true;
boolean applyColorWrite = true;
+ BlendEquation blendEquation = BlendEquation.Add;
+ boolean applyBlendEquation = true;
+ BlendEquationAlpha blendEquationAlpha = BlendEquationAlpha.InheritColor;
+ boolean applyBlendEquationAlpha = true;
BlendMode blendMode = BlendMode.Off;
boolean applyBlendMode = true;
- boolean alphaTest = false;
- boolean applyAlphaTest = true;
- float alphaFallOff = 0;
- boolean applyAlphaFallOff = true;
float offsetFactor = 0;
float offsetUnits = 0;
boolean offsetEnabled = false;
@@ -315,10 +398,7 @@ public class RenderState implements Cloneable, Savable {
boolean applyLineWidth = false;
TestFunction depthFunc = TestFunction.LessOrEqual;
//by default depth func will be applied anyway if depth test is applied
- boolean applyDepthFunc = false;
- //by default alpha func will be applied anyway if alpha test is applied
- TestFunction alphaFunc = TestFunction.Greater;
- boolean applyAlphaFunc = false;
+ boolean applyDepthFunc = false;
StencilOperation frontStencilStencilFailOperation = StencilOperation.Keep;
StencilOperation frontStencilDepthFailOperation = StencilOperation.Keep;
StencilOperation frontStencilDepthPassOperation = StencilOperation.Keep;
@@ -331,15 +411,13 @@ public class RenderState implements Cloneable, Savable {
public void write(JmeExporter ex) throws IOException {
OutputCapsule oc = ex.getCapsule(this);
- oc.write(pointSprite, "pointSprite", false);
+ oc.write(true, "pointSprite", false);
oc.write(wireframe, "wireframe", false);
oc.write(cullMode, "cullMode", FaceCullMode.Back);
oc.write(depthWrite, "depthWrite", true);
oc.write(depthTest, "depthTest", true);
oc.write(colorWrite, "colorWrite", true);
oc.write(blendMode, "blendMode", BlendMode.Off);
- oc.write(alphaTest, "alphaTest", false);
- oc.write(alphaFallOff, "alphaFallOff", 0);
oc.write(offsetEnabled, "offsetEnabled", false);
oc.write(offsetFactor, "offsetFactor", 0);
oc.write(offsetUnits, "offsetUnits", 0);
@@ -352,38 +430,34 @@ public class RenderState implements Cloneable, Savable {
oc.write(backStencilDepthPassOperation, "backStencilDepthPassOperation", StencilOperation.Keep);
oc.write(frontStencilFunction, "frontStencilFunction", TestFunction.Always);
oc.write(backStencilFunction, "backStencilFunction", TestFunction.Always);
+ oc.write(blendEquation, "blendEquation", BlendEquation.Add);
+ oc.write(blendEquationAlpha, "blendEquationAlpha", BlendEquationAlpha.InheritColor);
oc.write(depthFunc, "depthFunc", TestFunction.LessOrEqual);
- oc.write(alphaFunc, "alphaFunc", TestFunction.Greater);
oc.write(lineWidth, "lineWidth", 1);
// Only "additional render state" has them set to false by default
- oc.write(applyPointSprite, "applyPointSprite", true);
oc.write(applyWireFrame, "applyWireFrame", true);
oc.write(applyCullMode, "applyCullMode", true);
oc.write(applyDepthWrite, "applyDepthWrite", true);
oc.write(applyDepthTest, "applyDepthTest", true);
oc.write(applyColorWrite, "applyColorWrite", true);
+ oc.write(applyBlendEquation, "applyBlendEquation", true);
+ oc.write(applyBlendEquationAlpha, "applyBlendEquationAlpha", true);
oc.write(applyBlendMode, "applyBlendMode", true);
- oc.write(applyAlphaTest, "applyAlphaTest", true);
- oc.write(applyAlphaFallOff, "applyAlphaFallOff", true);
oc.write(applyPolyOffset, "applyPolyOffset", true);
oc.write(applyDepthFunc, "applyDepthFunc", true);
- oc.write(applyAlphaFunc, "applyAlphaFunc", false);
oc.write(applyLineWidth, "applyLineWidth", true);
}
public void read(JmeImporter im) throws IOException {
InputCapsule ic = im.getCapsule(this);
- pointSprite = ic.readBoolean("pointSprite", false);
wireframe = ic.readBoolean("wireframe", false);
cullMode = ic.readEnum("cullMode", FaceCullMode.class, FaceCullMode.Back);
depthWrite = ic.readBoolean("depthWrite", true);
depthTest = ic.readBoolean("depthTest", true);
colorWrite = ic.readBoolean("colorWrite", true);
blendMode = ic.readEnum("blendMode", BlendMode.class, BlendMode.Off);
- alphaTest = ic.readBoolean("alphaTest", false);
- alphaFallOff = ic.readFloat("alphaFallOff", 0);
offsetEnabled = ic.readBoolean("offsetEnabled", false);
offsetFactor = ic.readFloat("offsetFactor", 0);
offsetUnits = ic.readFloat("offsetUnits", 0);
@@ -396,23 +470,22 @@ public class RenderState implements Cloneable, Savable {
backStencilDepthPassOperation = ic.readEnum("backStencilDepthPassOperation", StencilOperation.class, StencilOperation.Keep);
frontStencilFunction = ic.readEnum("frontStencilFunction", TestFunction.class, TestFunction.Always);
backStencilFunction = ic.readEnum("backStencilFunction", TestFunction.class, TestFunction.Always);
+ blendEquation = ic.readEnum("blendEquation", BlendEquation.class, BlendEquation.Add);
+ blendEquationAlpha = ic.readEnum("blendEquationAlpha", BlendEquationAlpha.class, BlendEquationAlpha.InheritColor);
depthFunc = ic.readEnum("depthFunc", TestFunction.class, TestFunction.LessOrEqual);
- alphaFunc = ic.readEnum("alphaFunc", TestFunction.class, TestFunction.Greater);
lineWidth = ic.readFloat("lineWidth", 1);
- applyPointSprite = ic.readBoolean("applyPointSprite", true);
applyWireFrame = ic.readBoolean("applyWireFrame", true);
applyCullMode = ic.readBoolean("applyCullMode", true);
applyDepthWrite = ic.readBoolean("applyDepthWrite", true);
applyDepthTest = ic.readBoolean("applyDepthTest", true);
applyColorWrite = ic.readBoolean("applyColorWrite", true);
+ applyBlendEquation = ic.readBoolean("applyBlendEquation", true);
+ applyBlendEquationAlpha = ic.readBoolean("applyBlendEquationAlpha", true);
applyBlendMode = ic.readBoolean("applyBlendMode", true);
- applyAlphaTest = ic.readBoolean("applyAlphaTest", true);
- applyAlphaFallOff = ic.readBoolean("applyAlphaFallOff", true);
applyPolyOffset = ic.readBoolean("applyPolyOffset", true);
applyDepthFunc = ic.readBoolean("applyDepthFunc", true);
- applyAlphaFunc = ic.readBoolean("applyAlphaFunc", false);
applyLineWidth = ic.readBoolean("applyLineWidth", true);
@@ -433,8 +506,8 @@ public class RenderState implements Cloneable, Savable {
}
/**
- * returns true if the given renderState is equall to this one
- * @param o the renderState to compate to
+ * returns true if the given renderState is equal to this one
+ * @param o the renderState to compare to
* @return true if the renderStates are equal
*/
@Override
@@ -446,9 +519,6 @@ public class RenderState implements Cloneable, Savable {
return false;
}
RenderState rs = (RenderState) o;
- if (pointSprite != rs.pointSprite) {
- return false;
- }
if (wireframe != rs.wireframe) {
return false;
@@ -475,23 +545,19 @@ public class RenderState implements Cloneable, Savable {
return false;
}
- if (blendMode != rs.blendMode) {
+ if (blendEquation != rs.blendEquation) {
return false;
}
- if (alphaTest != rs.alphaTest) {
+ if (blendEquationAlpha != rs.blendEquationAlpha) {
return false;
}
- if (alphaTest) {
- if (alphaFunc != rs.alphaFunc) {
- return false;
- }
- }
- if (alphaFallOff != rs.alphaFallOff) {
+ if (blendMode != rs.blendMode) {
return false;
}
+
if (offsetEnabled != rs.offsetEnabled) {
return false;
}
@@ -544,70 +610,30 @@ public class RenderState implements Cloneable, Savable {
}
/**
- * Enables point sprite mode.
- *
- *
When point sprite is enabled, any meshes
- * with the type of {@link Mode#Points} will be rendered as 2D quads
- * with texturing enabled. Fragment shaders can write to the
- * gl_PointCoord
variable to manipulate the texture coordinate
- * for each pixel. The size of the 2D quad can be controlled by writing
- * to the gl_PointSize
variable in the vertex shader.
- *
- * @param pointSprite Enables Point Sprite mode.
+ * @deprecated Does nothing. Point sprite is already enabled by default for
+ * all supported platforms. jME3 does not support rendering conventional
+ * point clouds.
*/
+ @Deprecated
public void setPointSprite(boolean pointSprite) {
- applyPointSprite = true;
- this.pointSprite = pointSprite;
- cachedHashCode = -1;
}
/**
- * Sets the alpha fall off value for alpha testing.
- *
- *
If the pixel's alpha value is greater than the
- * alphaFallOff
then the pixel will be rendered, otherwise
- * the pixel will be discarded.
- *
- * Note : Alpha test is deprecated since opengl 3.0 and does not exists in
- * openglES 2.0.
- * The prefered way is to use the alphaDiscardThreshold on the material
- * Or have a shader that discards the pixel when its alpha value meets the
- * discarding condition.
- *
- * @param alphaFallOff The alpha of all rendered pixels must be higher
- * than this value to be rendered. This value should be between 0 and 1.
- *
- * @see RenderState#setAlphaTest(boolean)
+ * @deprecated Does nothing. To use alpha test, set the
+ * AlphaDiscardThreshold
material parameter.
+ * @param alphaFallOff does nothing
*/
+ @Deprecated
public void setAlphaFallOff(float alphaFallOff) {
- applyAlphaFallOff = true;
- this.alphaFallOff = alphaFallOff;
- cachedHashCode = -1;
}
/**
- * Enable alpha testing.
- *
- *
When alpha testing is enabled, all input pixels' alpha are compared
- * to the {@link RenderState#setAlphaFallOff(float) constant alpha falloff}.
- * If the input alpha is greater than the falloff, the pixel will be rendered,
- * otherwise it will be discarded.
- *
- * @param alphaTest Set to true to enable alpha testing.
- *
- * Note : Alpha test is deprecated since opengl 3.0 and does not exists in
- * openglES 2.0.
- * The prefered way is to use the alphaDiscardThreshold on the material
- * Or have a shader that discards the pixel when its alpha value meets the
- * discarding condition.
- *
- *
- * @see RenderState#setAlphaFallOff(float)
+ * @deprecated Does nothing. To use alpha test, set the
+ * AlphaDiscardThreshold
material parameter.
+ * @param alphaTest does nothing
*/
+ @Deprecated
public void setAlphaTest(boolean alphaTest) {
- applyAlphaTest = true;
- this.alphaTest = alphaTest;
- cachedHashCode = -1;
}
/**
@@ -663,6 +689,61 @@ public class RenderState implements Cloneable, Savable {
cachedHashCode = -1;
}
+ /**
+ * Set the blending equation.
+ *
+ * When blending is enabled, (blendMode
is not
+ * {@link BlendMode#Off}) the input pixel will be blended with the pixel
+ * already in the color buffer. The blending equation is determined by the
+ * {@link BlendEquation}. For example, the mode {@link BlendMode#Additive}
+ * and {@link BlendEquation#Add} will add the input pixel's color to the
+ * color already in the color buffer:
+ *
+ * Result = Source Color + Destination Color
+ *
+ * However, the mode {@link BlendMode#Additive}
+ * and {@link BlendEquation#Subtract} will subtract the input pixel's color to the
+ * color already in the color buffer:
+ *
+ * Result = Source Color - Destination Color
+ *
+ * @param blendEquation The blend equation to use.
+ */
+ public void setBlendEquation(BlendEquation blendEquation) {
+ applyBlendEquation = true;
+ this.blendEquation = blendEquation;
+ cachedHashCode = -1;
+ }
+
+ /**
+ * Set the blending equation for the alpha component.
+ *
+ * When blending is enabled, (blendMode
is not
+ * {@link BlendMode#Off}) the input pixel will be blended with the pixel
+ * already in the color buffer. The blending equation is determined by the
+ * {@link BlendEquation} and can be overrode for the alpha component using
+ * the {@link BlendEquationAlpha} . For example, the mode
+ * {@link BlendMode#Additive} and {@link BlendEquationAlpha#Add} will add
+ * the input pixel's alpha to the alpha component already in the color
+ * buffer:
+ *
+ * Result = Source Alpha + Destination Alpha
+ *
+ * However, the mode {@link BlendMode#Additive} and
+ * {@link BlendEquationAlpha#Subtract} will subtract the input pixel's alpha
+ * to the alpha component already in the color buffer:
+ *
+ * Result = Source Alpha - Destination Alpha
+ *
+ * @param blendEquationAlpha The blend equation to use for the alpha
+ * component.
+ */
+ public void setBlendEquationAlpha(BlendEquationAlpha blendEquationAlpha) {
+ applyBlendEquationAlpha = true;
+ this.blendEquationAlpha = blendEquationAlpha;
+ cachedHashCode = -1;
+ }
+
/**
* Enable depth testing.
*
@@ -796,24 +877,10 @@ public class RenderState implements Cloneable, Savable {
}
/**
- * Sets the alpha comparision function to the given TestFunction
- * default is Greater (GL_GREATER)
- *
- * Note : Alpha test is deprecated since opengl 3.0 and does not exists in
- * openglES 2.0.
- * The prefered way is to use the alphaDiscardThreshold on the material
- * Or have a shader taht discards the pixel when its alpha value meets the
- * discarding condition.
- *
- * @see TestFunction
- * @see RenderState#setAlphaTest(boolean)
- * @see RenderState#setAlphaFallOff(float)
- * @param alphaFunc the alpha comparision function
+ * @deprecated
*/
- public void setAlphaFunc(TestFunction alphaFunc) {
- applyAlphaFunc = true;
- this.alphaFunc = alphaFunc;
- cachedHashCode = -1;
+ @Deprecated
+ public void setAlphaFunc(TestFunction alphaFunc) {
}
/**
@@ -991,6 +1058,24 @@ public class RenderState implements Cloneable, Savable {
return backStencilFunction;
}
+ /**
+ * Retrieve the blend equation.
+ *
+ * @return the blend equation.
+ */
+ public BlendEquation getBlendEquation() {
+ return blendEquation;
+ }
+
+ /**
+ * Retrieve the blend equation used for the alpha component.
+ *
+ * @return the blend equation for the alpha component.
+ */
+ public BlendEquationAlpha getBlendEquationAlpha() {
+ return blendEquationAlpha;
+ }
+
/**
* Retrieve the blend mode.
*
@@ -1001,25 +1086,22 @@ public class RenderState implements Cloneable, Savable {
}
/**
- * Check if point sprite mode is enabled
- *
- * @return True if point sprite mode is enabled.
- *
- * @see RenderState#setPointSprite(boolean)
+ * @return true
+ * @deprecated Always returns true since point sprite is always enabled.
+ * @see #setPointSprite(boolean)
*/
+ @Deprecated
public boolean isPointSprite() {
- return pointSprite;
+ return true;
}
/**
- * Check if alpha test is enabled.
- *
- * @return True if alpha test is enabled.
- *
- * @see RenderState#setAlphaTest(boolean)
+ * @deprecated To use alpha test, set the AlphaDiscardThreshold
+ * material parameter.
+ * @return false
*/
public boolean isAlphaTest() {
- return alphaTest;
+ return false;
}
/**
@@ -1111,14 +1193,12 @@ public class RenderState implements Cloneable, Savable {
}
/**
- * Retrieve the alpha falloff value.
- *
- * @return the alpha falloff value.
- *
- * @see RenderState#setAlphaFallOff(float)
+ * @return 0
+ * @deprecated
*/
+ @Deprecated
public float getAlphaFallOff() {
- return alphaFallOff;
+ return 0f;
}
/**
@@ -1133,14 +1213,12 @@ public class RenderState implements Cloneable, Savable {
}
/**
- * Retrieve the alpha comparison function
- *
- * @return the alpha comparison function
- *
- * @see RenderState#setAlphaFunc(com.jme3.material.RenderState.TestFunction)
+ * @return {@link TestFunction#Greater}.
+ * @deprecated
*/
+ @Deprecated
public TestFunction getAlphaFunc() {
- return alphaFunc;
+ return TestFunction.Greater;
}
/**
@@ -1153,16 +1231,17 @@ public class RenderState implements Cloneable, Savable {
}
- public boolean isApplyAlphaFallOff() {
- return applyAlphaFallOff;
+
+ public boolean isApplyBlendMode() {
+ return applyBlendMode;
}
- public boolean isApplyAlphaTest() {
- return applyAlphaTest;
+ public boolean isApplyBlendEquation() {
+ return applyBlendEquation;
}
- public boolean isApplyBlendMode() {
- return applyBlendMode;
+ public boolean isApplyBlendEquationAlpha() {
+ return applyBlendEquationAlpha;
}
public boolean isApplyColorWrite() {
@@ -1181,9 +1260,6 @@ public class RenderState implements Cloneable, Savable {
return applyDepthWrite;
}
- public boolean isApplyPointSprite() {
- return applyPointSprite;
- }
public boolean isApplyPolyOffset() {
return applyPolyOffset;
@@ -1197,9 +1273,6 @@ public class RenderState implements Cloneable, Savable {
return applyDepthFunc;
}
- public boolean isApplyAlphaFunc() {
- return applyAlphaFunc;
- }
public boolean isApplyLineWidth() {
return applyLineWidth;
@@ -1211,7 +1284,6 @@ public class RenderState implements Cloneable, Savable {
public int contentHashCode() {
if (cachedHashCode == -1){
int hash = 7;
- hash = 79 * hash + (this.pointSprite ? 1 : 0);
hash = 79 * hash + (this.wireframe ? 1 : 0);
hash = 79 * hash + (this.cullMode != null ? this.cullMode.hashCode() : 0);
hash = 79 * hash + (this.depthWrite ? 1 : 0);
@@ -1219,9 +1291,8 @@ public class RenderState implements Cloneable, Savable {
hash = 79 * hash + (this.depthFunc != null ? this.depthFunc.hashCode() : 0);
hash = 79 * hash + (this.colorWrite ? 1 : 0);
hash = 79 * hash + (this.blendMode != null ? this.blendMode.hashCode() : 0);
- hash = 79 * hash + (this.alphaTest ? 1 : 0);
- hash = 79 * hash + (this.alphaFunc != null ? this.alphaFunc.hashCode() : 0);
- hash = 79 * hash + Float.floatToIntBits(this.alphaFallOff);
+ hash = 79 * hash + (this.blendEquation != null ? this.blendEquation.hashCode() : 0);
+ hash = 79 * hash + (this.blendEquationAlpha != null ? this.blendEquationAlpha.hashCode() : 0);
hash = 79 * hash + Float.floatToIntBits(this.offsetFactor);
hash = 79 * hash + Float.floatToIntBits(this.offsetUnits);
hash = 79 * hash + (this.offsetEnabled ? 1 : 0);
@@ -1266,11 +1337,6 @@ public class RenderState implements Cloneable, Savable {
return this;
}
- if (additionalState.applyPointSprite) {
- state.pointSprite = additionalState.pointSprite;
- } else {
- state.pointSprite = pointSprite;
- }
if (additionalState.applyWireFrame) {
state.wireframe = additionalState.wireframe;
} else {
@@ -1302,27 +1368,22 @@ public class RenderState implements Cloneable, Savable {
} else {
state.colorWrite = colorWrite;
}
- if (additionalState.applyBlendMode) {
- state.blendMode = additionalState.blendMode;
+ if (additionalState.applyBlendEquation) {
+ state.blendEquation = additionalState.blendEquation;
} else {
- state.blendMode = blendMode;
+ state.blendEquation = blendEquation;
}
- if (additionalState.applyAlphaTest) {
- state.alphaTest = additionalState.alphaTest;
+ if (additionalState.applyBlendEquationAlpha) {
+ state.blendEquationAlpha = additionalState.blendEquationAlpha;
} else {
- state.alphaTest = alphaTest;
- }
- if (additionalState.applyAlphaFunc) {
- state.alphaFunc = additionalState.alphaFunc;
+ state.blendEquationAlpha = blendEquationAlpha;
+ }
+ if (additionalState.applyBlendMode) {
+ state.blendMode = additionalState.blendMode;
} else {
- state.alphaFunc = alphaFunc;
+ state.blendMode = blendMode;
}
- if (additionalState.applyAlphaFallOff) {
- state.alphaFallOff = additionalState.alphaFallOff;
- } else {
- state.alphaFallOff = alphaFallOff;
- }
if (additionalState.applyPolyOffset) {
state.offsetEnabled = additionalState.offsetEnabled;
state.offsetFactor = additionalState.offsetFactor;
@@ -1367,16 +1428,14 @@ public class RenderState implements Cloneable, Savable {
state.cachedHashCode = -1;
return state;
}
- public void set(RenderState state) {
- pointSprite = state.pointSprite;
+
+ public void set(RenderState state) {
wireframe = state.wireframe;
cullMode = state.cullMode;
depthWrite = state.depthWrite;
depthTest = state.depthTest;
colorWrite = state.colorWrite;
blendMode = state.blendMode;
- alphaTest = state.alphaTest;
- alphaFallOff = state.alphaFallOff;
offsetEnabled = state.offsetEnabled;
offsetFactor = state.offsetFactor;
offsetUnits = state.offsetUnits;
@@ -1389,30 +1448,27 @@ public class RenderState implements Cloneable, Savable {
backStencilDepthPassOperation = state.backStencilDepthPassOperation;
frontStencilFunction = state.frontStencilFunction;
backStencilFunction = state.backStencilFunction;
+ blendEquationAlpha = state.blendEquationAlpha;
+ blendEquation = state.blendEquation;
depthFunc = state.depthFunc;
- alphaFunc = state.alphaFunc;
lineWidth = state.lineWidth;
- applyPointSprite = true;
applyWireFrame = true;
applyCullMode = true;
applyDepthWrite = true;
applyDepthTest = true;
applyColorWrite = true;
- applyBlendMode = true;
- applyAlphaTest = true;
- applyAlphaFallOff = true;
+ applyBlendEquation = true;
+ applyBlendEquationAlpha = true;
+ applyBlendMode = true;
applyPolyOffset = true;
- applyDepthFunc = true;
- applyAlphaFunc = false;
+ applyDepthFunc = true;
applyLineWidth = true;
}
@Override
public String toString() {
return "RenderState[\n"
- + "pointSprite=" + pointSprite
- + "\napplyPointSprite=" + applyPointSprite
+ "\nwireframe=" + wireframe
+ "\napplyWireFrame=" + applyWireFrame
+ "\ncullMode=" + cullMode
@@ -1424,13 +1480,11 @@ public class RenderState implements Cloneable, Savable {
+ "\napplyDepthTest=" + applyDepthTest
+ "\ncolorWrite=" + colorWrite
+ "\napplyColorWrite=" + applyColorWrite
+ + "\nblendEquation=" + blendEquation
+ + "\napplyBlendEquation=" + applyBlendEquation
+ + "\napplyBlendEquationAlpha=" + applyBlendEquationAlpha
+ "\nblendMode=" + blendMode
+ "\napplyBlendMode=" + applyBlendMode
- + "\nalphaTest=" + alphaTest
- + "\nalphaFunc=" + alphaFunc
- + "\napplyAlphaTest=" + applyAlphaTest
- + "\nalphaFallOff=" + alphaFallOff
- + "\napplyAlphaFallOff=" + applyAlphaFallOff
+ "\noffsetEnabled=" + offsetEnabled
+ "\napplyPolyOffset=" + applyPolyOffset
+ "\noffsetFactor=" + offsetFactor
diff --git a/jme3-core/src/main/java/com/jme3/material/Technique.java b/jme3-core/src/main/java/com/jme3/material/Technique.java
index 5881adf9a..eda0205ed 100644
--- a/jme3-core/src/main/java/com/jme3/material/Technique.java
+++ b/jme3-core/src/main/java/com/jme3/material/Technique.java
@@ -183,8 +183,8 @@ public final class Technique {
* @return nothing.
*
* @deprecated Preset defines are precompiled into
- * {@link TechniqueDef#getShaderPrologue()}, whereas
- * dynamic defines are available via {@link #getParamDefines()}.
+ * {@link TechniqueDef#getShaderPrologue()}, whereas dynamic defines are
+ * available via {@link #getParamDefines()}.
*/
@Deprecated
public DefineList getAllDefines() {
diff --git a/jme3-core/src/main/java/com/jme3/material/TechniqueDef.java b/jme3-core/src/main/java/com/jme3/material/TechniqueDef.java
index f218809e6..4479e6642 100644
--- a/jme3-core/src/main/java/com/jme3/material/TechniqueDef.java
+++ b/jme3-core/src/main/java/com/jme3/material/TechniqueDef.java
@@ -155,13 +155,12 @@ public class TechniqueDef implements Savable {
*
* Used internally by the J3M/J3MD loader.
*
- * @param name The name of the technique, should be set to
* For example, maximum texture sizes or number of samples.
- *
+ *
* @author Kirill Vainer
*/
public enum Limits {
/**
- * Maximum number of vertex texture units, or number of textures
- * that can be used in the vertex shader.
+ * Maximum number of vertex texture units, or number of textures that can be
+ * used in the vertex shader.
*/
VertexTextureUnits,
-
/**
- * Maximum number of fragment texture units, or number of textures
- * that can be used in the fragment shader.
+ * Maximum number of fragment texture units, or number of textures that can
+ * be used in the fragment shader.
*/
FragmentTextureUnits,
-
- FragmentUniforms,
-
+ FragmentUniformVectors,
+ VertexUniformVectors,
VertexAttributes,
-
FrameBufferSamples,
-
FrameBufferAttachments,
-
FrameBufferMrtAttachments,
-
RenderBufferSize,
-
TextureSize,
-
CubemapSize,
-
- VertexCount,
-
- TriangleCount,
-
ColorTextureSamples,
-
DepthTextureSamples,
-
- VertexUniformVectors,
-
TextureAnisotropy,
}
diff --git a/jme3-core/src/main/java/com/jme3/renderer/RenderContext.java b/jme3-core/src/main/java/com/jme3/renderer/RenderContext.java
index 5be184c94..49f25240a 100644
--- a/jme3-core/src/main/java/com/jme3/renderer/RenderContext.java
+++ b/jme3-core/src/main/java/com/jme3/renderer/RenderContext.java
@@ -55,16 +55,6 @@ public class RenderContext {
*/
public boolean depthTestEnabled = false;
- /**
- * @see RenderState#setAlphaFallOff(float)
- */
- public float alphaTestFallOff = 0f;
-
- /**
- * @see RenderState#setAlphaTest(boolean)
- */
- public boolean alphaTestEnabled = false;
-
/**
* @see RenderState#setDepthWrite(boolean)
*/
@@ -111,14 +101,19 @@ public class RenderContext {
public RenderState.BlendMode blendMode = RenderState.BlendMode.Off;
/**
- * @see RenderState#setWireframe(boolean)
+ * @see RenderState#setBlendEquation(com.jme3.material.RenderState.BlendEquation)
*/
- public boolean wireframe = false;
+ public RenderState.BlendEquation blendEquation = RenderState.BlendEquation.Add;
+
+ /**
+ * @see RenderState#setBlendEquationAlpha(com.jme3.material.RenderState.BlendEquationAlpha)
+ */
+ public RenderState.BlendEquationAlpha blendEquationAlpha = RenderState.BlendEquationAlpha.InheritColor;
/**
- * @see RenderState#setPointSprite(boolean)
+ * @see RenderState#setWireframe(boolean)
*/
- public boolean pointSprite = false;
+ public boolean wireframe = false;
/**
* @see Renderer#setShader(com.jme3.shader.Shader)
@@ -261,7 +256,6 @@ public class RenderContext {
public void reset(){
cullMode = RenderState.FaceCullMode.Off;
depthTestEnabled = false;
- alphaTestFallOff = 0f;
depthWriteEnabled = false;
colorWriteEnabled = false;
clipRectEnabled = false;
@@ -270,6 +264,8 @@ public class RenderContext {
polyOffsetUnits = 0;
pointSize = 1;
blendMode = RenderState.BlendMode.Off;
+ blendEquation = RenderState.BlendEquation.Add;
+ blendEquationAlpha = RenderState.BlendEquationAlpha.InheritColor;
wireframe = false;
boundShaderProgram = 0;
boundShader = null;
diff --git a/jme3-core/src/main/java/com/jme3/renderer/RenderManager.java b/jme3-core/src/main/java/com/jme3/renderer/RenderManager.java
index 0860d69f5..ce8c7b13d 100644
--- a/jme3-core/src/main/java/com/jme3/renderer/RenderManager.java
+++ b/jme3-core/src/main/java/com/jme3/renderer/RenderManager.java
@@ -74,20 +74,19 @@ import java.util.logging.Logger;
public class RenderManager {
private static final Logger logger = Logger.getLogger(RenderManager.class.getName());
- private Renderer renderer;
- private UniformBindingManager uniformBindingManager = new UniformBindingManager();
- private ArrayList
diff --git a/jme3-core/src/main/java/com/jme3/renderer/opengl/GL.java b/jme3-core/src/main/java/com/jme3/renderer/opengl/GL.java
index 1b9c3f94d..a4a738152 100644
--- a/jme3-core/src/main/java/com/jme3/renderer/opengl/GL.java
+++ b/jme3-core/src/main/java/com/jme3/renderer/opengl/GL.java
@@ -45,142 +45,149 @@ import java.nio.ShortBuffer;
*/
public interface GL {
- public static final int GL_ALPHA = 0x1906;
- public static final int GL_ALWAYS = 0x207;
- public static final int GL_ARRAY_BUFFER = 0x8892;
- public static final int GL_BACK = 0x405;
- public static final int GL_BLEND = 0xBE2;
- public static final int GL_BYTE = 0x1400;
- public static final int GL_CLAMP_TO_EDGE = 0x812F;
- public static final int GL_COLOR_BUFFER_BIT = 0x4000;
- public static final int GL_COMPILE_STATUS = 0x8B81;
- public static final int GL_CULL_FACE = 0xB44;
- public static final int GL_DECR = 0x1E03;
- public static final int GL_DECR_WRAP = 0x8508;
- public static final int GL_DEPTH_BUFFER_BIT = 0x100;
- public static final int GL_DEPTH_COMPONENT = 0x1902;
- public static final int GL_DEPTH_COMPONENT16 = 0x81A5;
- public static final int GL_DEPTH_TEST = 0xB71;
- public static final int GL_DOUBLE = 0x140A;
- public static final int GL_DST_COLOR = 0x306;
- public static final int GL_DYNAMIC_DRAW = 0x88E8;
- public static final int GL_ELEMENT_ARRAY_BUFFER = 0x8893;
- public static final int GL_EQUAL = 0x202;
- public static final int GL_EXTENSIONS = 0x1F03;
- public static final int GL_FALSE = 0x0;
- public static final int GL_FLOAT = 0x1406;
- public static final int GL_FRAGMENT_SHADER = 0x8B30;
- public static final int GL_FRONT = 0x404;
- public static final int GL_FRONT_AND_BACK = 0x408;
- public static final int GL_GEQUAL = 0x206;
- public static final int GL_GREATER = 0x204;
- public static final int GL_GREEN = 0x1904;
- public static final int GL_INCR = 0x1E02;
- public static final int GL_INCR_WRAP = 0x8507;
- public static final int GL_INFO_LOG_LENGTH = 0x8B84;
- public static final int GL_INT = 0x1404;
- public static final int GL_INVALID_ENUM = 0x500;
- public static final int GL_INVALID_VALUE = 0x501;
- public static final int GL_INVALID_OPERATION = 0x502;
- public static final int GL_INVERT = 0x150A;
- public static final int GL_KEEP = 0x1E00;
- public static final int GL_LEQUAL = 0x203;
- public static final int GL_LESS = 0x201;
- public static final int GL_LINEAR = 0x2601;
- public static final int GL_LINEAR_MIPMAP_LINEAR = 0x2703;
- public static final int GL_LINEAR_MIPMAP_NEAREST = 0x2701;
- public static final int GL_LINES = 0x1;
- public static final int GL_LINE_LOOP = 0x2;
- public static final int GL_LINE_STRIP = 0x3;
- public static final int GL_LINK_STATUS = 0x8B82;
- public static final int GL_LUMINANCE = 0x1909;
- public static final int GL_LUMINANCE_ALPHA = 0x190A;
- public static final int GL_MAX_CUBE_MAP_TEXTURE_SIZE = 0x851C;
- public static final int GL_MAX_TEXTURE_IMAGE_UNITS = 0x8872;
- public static final int GL_MAX_TEXTURE_SIZE = 0xD33;
- public static final int GL_MAX_VERTEX_ATTRIBS = 0x8869;
- public static final int GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS = 0x8B4C;
- public static final int GL_MAX_VERTEX_UNIFORM_COMPONENTS = 0x8B4A;
- public static final int GL_MAX_VERTEX_UNIFORM_VECTORS = 0x8DFB;
- public static final int GL_MIRRORED_REPEAT = 0x8370;
- public static final int GL_NEAREST = 0x2600;
- public static final int GL_NEAREST_MIPMAP_LINEAR = 0x2702;
- public static final int GL_NEAREST_MIPMAP_NEAREST = 0x2700;
- public static final int GL_NEVER = 0x200;
- public static final int GL_NO_ERROR = 0x0;
- public static final int GL_NONE = 0x0;
- public static final int GL_NOTEQUAL = 0x205;
- public static final int GL_ONE = 0x1;
- public static final int GL_ONE_MINUS_DST_COLOR = 0x307;
- public static final int GL_ONE_MINUS_SRC_ALPHA = 0x303;
- public static final int GL_ONE_MINUS_SRC_COLOR = 0x301;
- public static final int GL_OUT_OF_MEMORY = 0x505;
- public static final int GL_POINTS = 0x0;
- public static final int GL_POLYGON_OFFSET_FILL = 0x8037;
- public static final int GL_RED = 0x1903;
- public static final int GL_RENDERER = 0x1F01;
- public static final int GL_REPEAT = 0x2901;
- public static final int GL_REPLACE = 0x1E01;
- public static final int GL_RGB = 0x1907;
- public static final int GL_RGB565 = 0x8D62;
- public static final int GL_RGB5_A1 = 0x8057;
- public static final int GL_RGBA = 0x1908;
- public static final int GL_RGBA4 = 0x8056;
- public static final int GL_SCISSOR_TEST = 0xC11;
- public static final int GL_SHADING_LANGUAGE_VERSION = 0x8B8C;
- public static final int GL_SHORT = 0x1402;
- public static final int GL_SRC_ALPHA = 0x302;
- public static final int GL_SRC_COLOR = 0x300;
- public static final int GL_STATIC_DRAW = 0x88E4;
- public static final int GL_STENCIL_BUFFER_BIT = 0x400;
- public static final int GL_STENCIL_TEST = 0xB90;
- public static final int GL_STREAM_DRAW = 0x88E0;
- public static final int GL_STREAM_READ = 0x88E1;
- public static final int GL_TEXTURE = 0x1702;
- public static final int GL_TEXTURE0 = 0x84C0;
- public static final int GL_TEXTURE1 = 0x84C1;
- public static final int GL_TEXTURE2 = 0x84C2;
- public static final int GL_TEXTURE3 = 0x84C3;
- public static final int GL_TEXTURE4 = 0x84C4;
- public static final int GL_TEXTURE5 = 0x84C5;
- public static final int GL_TEXTURE6 = 0x84C6;
- public static final int GL_TEXTURE7 = 0x84C7;
- public static final int GL_TEXTURE8 = 0x84C8;
- public static final int GL_TEXTURE9 = 0x84C9;
- public static final int GL_TEXTURE10 = 0x84CA;
- public static final int GL_TEXTURE11 = 0x84CB;
- public static final int GL_TEXTURE12 = 0x84CC;
- public static final int GL_TEXTURE13 = 0x84CD;
- public static final int GL_TEXTURE14 = 0x84CE;
- public static final int GL_TEXTURE15 = 0x84CF;
- public static final int GL_TEXTURE_2D = 0xDE1;
- public static final int GL_TEXTURE_CUBE_MAP = 0x8513;
- public static final int GL_TEXTURE_CUBE_MAP_POSITIVE_X = 0x8515;
- public static final int GL_TEXTURE_CUBE_MAP_NEGATIVE_X = 0x8516;
- public static final int GL_TEXTURE_CUBE_MAP_POSITIVE_Y = 0x8517;
- public static final int GL_TEXTURE_CUBE_MAP_NEGATIVE_Y = 0x8518;
- public static final int GL_TEXTURE_CUBE_MAP_POSITIVE_Z = 0x8519;
- public static final int GL_TEXTURE_CUBE_MAP_NEGATIVE_Z = 0x851A;
- public static final int GL_TEXTURE_BASE_LEVEL = 0x813C;
- public static final int GL_TEXTURE_MAG_FILTER = 0x2800;
- public static final int GL_TEXTURE_MAX_LEVEL = 0x813D;
- public static final int GL_TEXTURE_MIN_FILTER = 0x2801;
- public static final int GL_TEXTURE_WRAP_S = 0x2802;
- public static final int GL_TEXTURE_WRAP_T = 0x2803;
- public static final int GL_TRIANGLES = 0x4;
- public static final int GL_TRIANGLE_FAN = 0x6;
- public static final int GL_TRIANGLE_STRIP = 0x5;
- public static final int GL_TRUE = 0x1;
- public static final int GL_UNPACK_ALIGNMENT = 0xCF5;
- public static final int GL_UNSIGNED_BYTE = 0x1401;
- public static final int GL_UNSIGNED_INT = 0x1405;
- public static final int GL_UNSIGNED_SHORT = 0x1403;
- public static final int GL_UNSIGNED_SHORT_5_6_5 = 0x8363;
- public static final int GL_UNSIGNED_SHORT_5_5_5_1 = 0x8034;
- public static final int GL_VENDOR = 0x1F00;
- public static final int GL_VERSION = 0x1F02;
- public static final int GL_VERTEX_SHADER = 0x8B31;
- public static final int GL_ZERO = 0x0;
+ public static final int GL_ALPHA = 0x1906;
+ public static final int GL_ALWAYS = 0x207;
+ public static final int GL_ARRAY_BUFFER = 0x8892;
+ public static final int GL_BACK = 0x405;
+ public static final int GL_BLEND = 0xBE2;
+ public static final int GL_BYTE = 0x1400;
+ public static final int GL_CLAMP_TO_EDGE = 0x812F;
+ public static final int GL_COLOR_BUFFER_BIT = 0x4000;
+ public static final int GL_COMPILE_STATUS = 0x8B81;
+ public static final int GL_CULL_FACE = 0xB44;
+ public static final int GL_DECR = 0x1E03;
+ public static final int GL_DECR_WRAP = 0x8508;
+ public static final int GL_DEPTH_BUFFER_BIT = 0x100;
+ public static final int GL_DEPTH_COMPONENT = 0x1902;
+ public static final int GL_DEPTH_COMPONENT16 = 0x81A5;
+ public static final int GL_DEPTH_TEST = 0xB71;
+ public static final int GL_DOUBLE = 0x140A;
+ public static final int GL_DST_COLOR = 0x306;
+ public static final int GL_DYNAMIC_DRAW = 0x88E8;
+ public static final int GL_ELEMENT_ARRAY_BUFFER = 0x8893;
+ public static final int GL_EQUAL = 0x202;
+ public static final int GL_EXTENSIONS = 0x1F03;
+ public static final int GL_FALSE = 0x0;
+ public static final int GL_FLOAT = 0x1406;
+ public static final int GL_FRAGMENT_SHADER = 0x8B30;
+ public static final int GL_FRONT = 0x404;
+ public static final int GL_FUNC_ADD = 0x8006;
+ public static final int GL_FUNC_SUBTRACT = 0x800A;
+ public static final int GL_FUNC_REVERSE_SUBTRACT = 0x800B;
+ public static final int GL_FRONT_AND_BACK = 0x408;
+ public static final int GL_GEQUAL = 0x206;
+ public static final int GL_GREATER = 0x204;
+ public static final int GL_GREEN = 0x1904;
+ public static final int GL_INCR = 0x1E02;
+ public static final int GL_INCR_WRAP = 0x8507;
+ public static final int GL_INFO_LOG_LENGTH = 0x8B84;
+ public static final int GL_INT = 0x1404;
+ public static final int GL_INVALID_ENUM = 0x500;
+ public static final int GL_INVALID_VALUE = 0x501;
+ public static final int GL_INVALID_OPERATION = 0x502;
+ public static final int GL_INVERT = 0x150A;
+ public static final int GL_KEEP = 0x1E00;
+ public static final int GL_LEQUAL = 0x203;
+ public static final int GL_LESS = 0x201;
+ public static final int GL_LINEAR = 0x2601;
+ public static final int GL_LINEAR_MIPMAP_LINEAR = 0x2703;
+ public static final int GL_LINEAR_MIPMAP_NEAREST = 0x2701;
+ public static final int GL_LINES = 0x1;
+ public static final int GL_LINE_LOOP = 0x2;
+ public static final int GL_LINE_STRIP = 0x3;
+ public static final int GL_LINK_STATUS = 0x8B82;
+ public static final int GL_LUMINANCE = 0x1909;
+ public static final int GL_LUMINANCE_ALPHA = 0x190A;
+ public static final int GL_MAX = 0x8008;
+ public static final int GL_MAX_CUBE_MAP_TEXTURE_SIZE = 0x851C;
+ public static final int GL_MAX_FRAGMENT_UNIFORM_COMPONENTS = 0x8B49;
+ public static final int GL_MAX_FRAGMENT_UNIFORM_VECTORS = 0x8DFD;
+ public static final int GL_MAX_TEXTURE_IMAGE_UNITS = 0x8872;
+ public static final int GL_MAX_TEXTURE_SIZE = 0xD33;
+ public static final int GL_MAX_VERTEX_ATTRIBS = 0x8869;
+ public static final int GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS = 0x8B4C;
+ public static final int GL_MAX_VERTEX_UNIFORM_COMPONENTS = 0x8B4A;
+ public static final int GL_MAX_VERTEX_UNIFORM_VECTORS = 0x8DFB;
+ public static final int GL_MIRRORED_REPEAT = 0x8370;
+ public static final int GL_MIN = 0x8007;
+ public static final int GL_NEAREST = 0x2600;
+ public static final int GL_NEAREST_MIPMAP_LINEAR = 0x2702;
+ public static final int GL_NEAREST_MIPMAP_NEAREST = 0x2700;
+ public static final int GL_NEVER = 0x200;
+ public static final int GL_NO_ERROR = 0x0;
+ public static final int GL_NONE = 0x0;
+ public static final int GL_NOTEQUAL = 0x205;
+ public static final int GL_ONE = 0x1;
+ public static final int GL_ONE_MINUS_DST_COLOR = 0x307;
+ public static final int GL_ONE_MINUS_SRC_ALPHA = 0x303;
+ public static final int GL_ONE_MINUS_SRC_COLOR = 0x301;
+ public static final int GL_OUT_OF_MEMORY = 0x505;
+ public static final int GL_POINTS = 0x0;
+ public static final int GL_POLYGON_OFFSET_FILL = 0x8037;
+ public static final int GL_RED = 0x1903;
+ public static final int GL_RENDERER = 0x1F01;
+ public static final int GL_REPEAT = 0x2901;
+ public static final int GL_REPLACE = 0x1E01;
+ public static final int GL_RGB = 0x1907;
+ public static final int GL_RGB565 = 0x8D62;
+ public static final int GL_RGB5_A1 = 0x8057;
+ public static final int GL_RGBA = 0x1908;
+ public static final int GL_RGBA4 = 0x8056;
+ public static final int GL_SCISSOR_TEST = 0xC11;
+ public static final int GL_SHADING_LANGUAGE_VERSION = 0x8B8C;
+ public static final int GL_SHORT = 0x1402;
+ public static final int GL_SRC_ALPHA = 0x302;
+ public static final int GL_SRC_COLOR = 0x300;
+ public static final int GL_STATIC_DRAW = 0x88E4;
+ public static final int GL_STENCIL_BUFFER_BIT = 0x400;
+ public static final int GL_STENCIL_TEST = 0xB90;
+ public static final int GL_STREAM_DRAW = 0x88E0;
+ public static final int GL_STREAM_READ = 0x88E1;
+ public static final int GL_TEXTURE = 0x1702;
+ public static final int GL_TEXTURE0 = 0x84C0;
+ public static final int GL_TEXTURE1 = 0x84C1;
+ public static final int GL_TEXTURE2 = 0x84C2;
+ public static final int GL_TEXTURE3 = 0x84C3;
+ public static final int GL_TEXTURE4 = 0x84C4;
+ public static final int GL_TEXTURE5 = 0x84C5;
+ public static final int GL_TEXTURE6 = 0x84C6;
+ public static final int GL_TEXTURE7 = 0x84C7;
+ public static final int GL_TEXTURE8 = 0x84C8;
+ public static final int GL_TEXTURE9 = 0x84C9;
+ public static final int GL_TEXTURE10 = 0x84CA;
+ public static final int GL_TEXTURE11 = 0x84CB;
+ public static final int GL_TEXTURE12 = 0x84CC;
+ public static final int GL_TEXTURE13 = 0x84CD;
+ public static final int GL_TEXTURE14 = 0x84CE;
+ public static final int GL_TEXTURE15 = 0x84CF;
+ public static final int GL_TEXTURE_2D = 0xDE1;
+ public static final int GL_TEXTURE_CUBE_MAP = 0x8513;
+ public static final int GL_TEXTURE_CUBE_MAP_POSITIVE_X = 0x8515;
+ public static final int GL_TEXTURE_CUBE_MAP_NEGATIVE_X = 0x8516;
+ public static final int GL_TEXTURE_CUBE_MAP_POSITIVE_Y = 0x8517;
+ public static final int GL_TEXTURE_CUBE_MAP_NEGATIVE_Y = 0x8518;
+ public static final int GL_TEXTURE_CUBE_MAP_POSITIVE_Z = 0x8519;
+ public static final int GL_TEXTURE_CUBE_MAP_NEGATIVE_Z = 0x851A;
+ public static final int GL_TEXTURE_BASE_LEVEL = 0x813C;
+ public static final int GL_TEXTURE_MAG_FILTER = 0x2800;
+ public static final int GL_TEXTURE_MAX_LEVEL = 0x813D;
+ public static final int GL_TEXTURE_MIN_FILTER = 0x2801;
+ public static final int GL_TEXTURE_WRAP_S = 0x2802;
+ public static final int GL_TEXTURE_WRAP_T = 0x2803;
+ public static final int GL_TRIANGLES = 0x4;
+ public static final int GL_TRIANGLE_FAN = 0x6;
+ public static final int GL_TRIANGLE_STRIP = 0x5;
+ public static final int GL_TRUE = 0x1;
+ public static final int GL_UNPACK_ALIGNMENT = 0xCF5;
+ public static final int GL_UNSIGNED_BYTE = 0x1401;
+ public static final int GL_UNSIGNED_INT = 0x1405;
+ public static final int GL_UNSIGNED_SHORT = 0x1403;
+ public static final int GL_UNSIGNED_SHORT_5_6_5 = 0x8363;
+ public static final int GL_UNSIGNED_SHORT_5_5_5_1 = 0x8034;
+ public static final int GL_VENDOR = 0x1F00;
+ public static final int GL_VERSION = 0x1F02;
+ public static final int GL_VERTEX_SHADER = 0x8B31;
+ public static final int GL_ZERO = 0x0;
public void resetStats();
@@ -188,6 +195,7 @@ public interface GL {
public void glAttachShader(int program, int shader);
public void glBindBuffer(int target, int buffer);
public void glBindTexture(int target, int texture);
+ public void glBlendEquationSeparate(int colorMode, int alphaMode);
public void glBlendFunc(int sfactor, int dfactor);
public void glBufferData(int target, long data_size, int usage);
public void glBufferData(int target, FloatBuffer data, int usage);
diff --git a/jme3-core/src/main/java/com/jme3/renderer/opengl/GLDebugDesktop.java b/jme3-core/src/main/java/com/jme3/renderer/opengl/GLDebugDesktop.java
index fd18cc7ff..44dc3687a 100644
--- a/jme3-core/src/main/java/com/jme3/renderer/opengl/GLDebugDesktop.java
+++ b/jme3-core/src/main/java/com/jme3/renderer/opengl/GLDebugDesktop.java
@@ -100,4 +100,9 @@ public class GLDebugDesktop extends GLDebugES implements GL2, GL3, GL4 {
gl3.glFramebufferTextureLayer(param1, param2, param3, param4, param5);
checkError();
}
+
+ public void glBlendEquationSeparate(int colorMode, int alphaMode) {
+ gl.glBlendEquationSeparate(colorMode, alphaMode);
+ checkError();
+ }
}
diff --git a/jme3-core/src/main/java/com/jme3/renderer/opengl/GLDebugES.java b/jme3-core/src/main/java/com/jme3/renderer/opengl/GLDebugES.java
index 2348bd3cd..ed6b336f8 100644
--- a/jme3-core/src/main/java/com/jme3/renderer/opengl/GLDebugES.java
+++ b/jme3-core/src/main/java/com/jme3/renderer/opengl/GLDebugES.java
@@ -560,4 +560,9 @@ public class GLDebugES extends GLDebug implements GL, GLFbo, GLExt {
checkError();
return sync;
}
+
+ public void glBlendEquationSeparate(int colorMode, int alphaMode) {
+ gl.glBlendEquationSeparate(colorMode, alphaMode);
+ checkError();
+ }
}
diff --git a/jme3-core/src/main/java/com/jme3/renderer/opengl/GLRenderer.java b/jme3-core/src/main/java/com/jme3/renderer/opengl/GLRenderer.java
index 7ef77a2b6..70d25ccd4 100644
--- a/jme3-core/src/main/java/com/jme3/renderer/opengl/GLRenderer.java
+++ b/jme3-core/src/main/java/com/jme3/renderer/opengl/GLRenderer.java
@@ -90,6 +90,7 @@ public final class GLRenderer implements Renderer {
private final Statistics statistics = new Statistics();
private int vpX, vpY, vpW, vpH;
private int clipX, clipY, clipW, clipH;
+ private int defaultAnisotropicFilter = 1;
private boolean linearizeSrgbImages;
private HashSetnull
- * for default techniques.
+ * @param name The name of the technique
*/
public TechniqueDef(String name, int sortId){
this();
this.sortId = sortId;
- this.name = name == null ? TechniqueDef.DEFAULT_TECHNIQUE_NAME : name;
+ this.name = name;
}
/**
diff --git a/jme3-core/src/main/java/com/jme3/material/logic/StaticPassLightingLogic.java b/jme3-core/src/main/java/com/jme3/material/logic/StaticPassLightingLogic.java
index 49a15d3a4..48995ba4f 100644
--- a/jme3-core/src/main/java/com/jme3/material/logic/StaticPassLightingLogic.java
+++ b/jme3-core/src/main/java/com/jme3/material/logic/StaticPassLightingLogic.java
@@ -34,12 +34,12 @@ package com.jme3.material.logic;
import com.jme3.asset.AssetManager;
import com.jme3.light.DirectionalLight;
import com.jme3.light.Light;
-import com.jme3.light.Light.Type;
import com.jme3.light.LightList;
import com.jme3.light.PointLight;
import com.jme3.light.SpotLight;
import com.jme3.material.TechniqueDef;
import com.jme3.math.ColorRGBA;
+import com.jme3.math.Matrix4f;
import com.jme3.math.Vector3f;
import com.jme3.renderer.Caps;
import com.jme3.renderer.RenderManager;
@@ -72,6 +72,8 @@ public final class StaticPassLightingLogic extends DefaultTechniqueDefLogic {
private final ArrayListBoundingVolume bv;
- * Camera c;
- * int planeState = bv.getPlaneState();
- * bv.setPlaneState(0);
- * c.contains(bv);
- * bv.setPlaneState(plateState);
+ * BoundingVolume bv;
*
* @param bound the bound to check for culling
diff --git a/jme3-core/src/main/java/com/jme3/renderer/Limits.java b/jme3-core/src/main/java/com/jme3/renderer/Limits.java
index 81db88f5e..a7e737092 100644
--- a/jme3-core/src/main/java/com/jme3/renderer/Limits.java
+++ b/jme3-core/src/main/java/com/jme3/renderer/Limits.java
@@ -32,51 +32,34 @@
package com.jme3.renderer;
/**
- *
+ * Camera c;
+ * int planeState = bv.getPlaneState();
+ * bv.setPlaneState(0);
+ * c.contains(bv);
+ * bv.setPlaneState(plateState);
* Limits
allows querying the limits of certain features in
+ * Limits
allows querying the limits of certain features in
* {@link Renderer}.
* 1.0
since point size is
+ * determined in the vertex shader.
*
- * @return the size of points
+ * @return 1.0
*
* @see #setPointSize(float)
*/
+ @Deprecated
public float getPointSize() {
- return pointSize;
+ return 1.0f;
}
/**
- * Set the size of points for meshes of mode {@link Mode#Points}.
- * The point size is specified as on-screen pixels, the default
- * value is 1.0. The point size
- * does nothing if {@link RenderState#setPointSprite(boolean) point sprite}
- * render state is enabled, in that case, the vertex shader must specify the
- * point size by writing to gl_PointSize
.
+ * @deprecated Does nothing, since the size of {@link Mode#Points points} is
+ * determined via the vertex shader's gl_PointSize
output.
*
- * @param pointSize The size of points
+ * @param pointSize ignored
*/
+ @Deprecated
public void setPointSize(float pointSize) {
- this.pointSize = pointSize;
}
/**
diff --git a/jme3-core/src/main/java/com/jme3/scene/VertexBuffer.java b/jme3-core/src/main/java/com/jme3/scene/VertexBuffer.java
index 5652b9295..70d40a64c 100644
--- a/jme3-core/src/main/java/com/jme3/scene/VertexBuffer.java
+++ b/jme3-core/src/main/java/com/jme3/scene/VertexBuffer.java
@@ -108,8 +108,7 @@ public class VertexBuffer extends NativeObject implements Savable, Cloneable {
* Do not use.
*/
@Deprecated
- MiscAttrib,
-
+ Reserved0,
/**
* Specifies the index buffer, must contain integer data
* (ubyte, ushort, or uint).
diff --git a/jme3-core/src/main/java/com/jme3/scene/debug/WireBox.java b/jme3-core/src/main/java/com/jme3/scene/debug/WireBox.java
index 5d0577c5a..d4e4e1d58 100644
--- a/jme3-core/src/main/java/com/jme3/scene/debug/WireBox.java
+++ b/jme3-core/src/main/java/com/jme3/scene/debug/WireBox.java
@@ -101,14 +101,6 @@ public class WireBox extends Mesh {
);
updateBound();
}
-
- /**
- * Old method retained for compatibility: use makeGeometry instead.
- */
- @Deprecated
- public void fromBoundingBox(BoundingBox bbox) {
- updatePositions(bbox.getXExtent(), bbox.getYExtent(), bbox.getZExtent());
- }
/**
* Create a geometry suitable for visualizing the specified bounding box.
diff --git a/jme3-core/src/main/java/com/jme3/shadow/AbstractShadowRenderer.java b/jme3-core/src/main/java/com/jme3/shadow/AbstractShadowRenderer.java
index 891c3b402..d1b4586b3 100644
--- a/jme3-core/src/main/java/com/jme3/shadow/AbstractShadowRenderer.java
+++ b/jme3-core/src/main/java/com/jme3/shadow/AbstractShadowRenderer.java
@@ -330,12 +330,7 @@ public abstract class AbstractShadowRenderer implements SceneProcessor, Savable
public void initialize(RenderManager rm, ViewPort vp) {
renderManager = rm;
viewPort = vp;
- //checking for caps to chosse the appropriate post material technique
- if (renderManager.getRenderer().getCaps().contains(Caps.GLSL150)) {
- postTechniqueName = "PostShadow15";
- } else {
- postTechniqueName = "PostShadow";
- }
+ postTechniqueName = "PostShadow";
if(zFarOverride>0 && frustumCam == null){
initFrustumCam();
}
diff --git a/jme3-core/src/main/java/com/jme3/shadow/PssmShadowRenderer.java b/jme3-core/src/main/java/com/jme3/shadow/PssmShadowRenderer.java
index ed84f9f0c..a4f06df41 100644
--- a/jme3-core/src/main/java/com/jme3/shadow/PssmShadowRenderer.java
+++ b/jme3-core/src/main/java/com/jme3/shadow/PssmShadowRenderer.java
@@ -355,12 +355,7 @@ public class PssmShadowRenderer implements SceneProcessor {
public void initialize(RenderManager rm, ViewPort vp) {
renderManager = rm;
viewPort = vp;
- //checking for caps to chosse the appropriate post material technique
- if (renderManager.getRenderer().getCaps().contains(Caps.GLSL150)) {
- postTechniqueName = "PostShadow15";
- } else {
- postTechniqueName = "PostShadow";
- }
+ postTechniqueName = "PostShadow";
}
public boolean isInitialized() {
diff --git a/jme3-core/src/main/java/com/jme3/system/NullRenderer.java b/jme3-core/src/main/java/com/jme3/system/NullRenderer.java
index ae00386ee..293c5e2c7 100644
--- a/jme3-core/src/main/java/com/jme3/system/NullRenderer.java
+++ b/jme3-core/src/main/java/com/jme3/system/NullRenderer.java
@@ -39,6 +39,7 @@ import com.jme3.material.RenderState;
import com.jme3.math.ColorRGBA;
import com.jme3.math.Matrix4f;
import com.jme3.renderer.Caps;
+import com.jme3.renderer.Limits;
import com.jme3.renderer.Renderer;
import com.jme3.renderer.Statistics;
import com.jme3.scene.Mesh;
@@ -48,15 +49,25 @@ import com.jme3.shader.Shader.ShaderSource;
import com.jme3.texture.FrameBuffer;
import com.jme3.texture.Image;
import com.jme3.texture.Texture;
+import java.util.EnumMap;
public class NullRenderer implements Renderer {
- private static final EnumSet