iwgeric 10 years ago
commit 1a19c4291a
  1. 8
      jme3-blender/src/main/java/com/jme3/scene/plugins/blender/textures/TextureHelper.java
  2. 6
      jme3-jogl/build.gradle
  3. 10
      jme3-jogl/src/main/java/com/jme3/input/jogl/NewtMouseInput.java
  4. 22
      jme3-jogl/src/main/java/com/jme3/renderer/jogl/JoglRenderer.java
  5. 19
      jme3-jogl/src/main/java/com/jme3/renderer/jogl/TextureUtil.java
  6. 28
      jme3-jogl/src/main/java/com/jme3/system/jogl/JoglAbstractDisplay.java
  7. 2
      jme3-jogl/src/main/java/com/jme3/system/jogl/JoglCanvas.java
  8. 6
      jme3-jogl/src/main/java/com/jme3/system/jogl/JoglContext.java
  9. 2
      jme3-jogl/src/main/java/com/jme3/system/jogl/JoglDisplay.java
  10. 26
      jme3-jogl/src/main/java/com/jme3/system/jogl/JoglNewtAbstractDisplay.java
  11. 2
      jme3-jogl/src/main/java/com/jme3/system/jogl/JoglNewtCanvas.java
  12. 4
      jme3-jogl/src/main/java/com/jme3/system/jogl/JoglNewtDisplay.java
  13. 12
      jme3-jogl/src/main/java/com/jme3/system/jogl/JoglOffscreenBuffer.java

@ -232,7 +232,7 @@ public class TextureHelper extends AbstractBlenderHelper {
LOGGER.log(Level.FINE, "Fetching texture with OMA = {0}", imageStructure.getOldMemoryAddress()); LOGGER.log(Level.FINE, "Fetching texture with OMA = {0}", imageStructure.getOldMemoryAddress());
Texture result = null; Texture result = null;
Image im = (Image) blenderContext.getLoadedFeature(imageStructure.getOldMemoryAddress(), LoadedDataType.FEATURE); Image im = (Image) blenderContext.getLoadedFeature(imageStructure.getOldMemoryAddress(), LoadedDataType.FEATURE);
if (im == null) { // if (im == null) { HACK force reaload always, as constructor in else case is destroying the TextureKeys!
if ("ID".equals(imageStructure.getType())) { if ("ID".equals(imageStructure.getType())) {
LOGGER.fine("Loading texture from external blend file."); LOGGER.fine("Loading texture from external blend file.");
result = (Texture) this.loadLibrary(imageStructure); result = (Texture) this.loadLibrary(imageStructure);
@ -253,9 +253,9 @@ public class TextureHelper extends AbstractBlenderHelper {
result = new Texture2D(new ImageLoader().loadImage(blenderContext.getInputStream(), dataFileBlock.getBlockPosition(), true)); result = new Texture2D(new ImageLoader().loadImage(blenderContext.getInputStream(), dataFileBlock.getBlockPosition(), true));
} }
} }
} else { //} else {
result = new Texture2D(im); // result = new Texture2D(im);
} // }
if (result != null) {// render result is not being loaded if (result != null) {// render result is not being loaded
blenderContext.addLoadedFeatures(imageStructure.getOldMemoryAddress(), LoadedDataType.STRUCTURE, imageStructure); blenderContext.addLoadedFeatures(imageStructure.getOldMemoryAddress(), LoadedDataType.STRUCTURE, imageStructure);

@ -5,7 +5,7 @@ if (!hasProperty('mainClass')) {
dependencies { dependencies {
compile project(':jme3-core') compile project(':jme3-core')
compile project(':jme3-desktop') compile project(':jme3-desktop')
compile 'org.jogamp.gluegen:gluegen-rt-main:2.2.0' compile 'org.jogamp.gluegen:gluegen-rt-main:2.3.1'
compile 'org.jogamp.jogl:jogl-all-main:2.2.0' compile 'org.jogamp.jogl:jogl-all-main:2.3.1'
compile 'org.jogamp.joal:joal-main:2.2.0' compile 'org.jogamp.joal:joal-main:2.3.1'
} }

@ -45,11 +45,11 @@ import com.jogamp.newt.opengl.GLWindow;
import java.nio.ByteBuffer; import java.nio.ByteBuffer;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.logging.Logger; import java.util.logging.Logger;
import javax.media.nativewindow.util.Dimension; import com.jogamp.nativewindow.util.Dimension;
import javax.media.nativewindow.util.DimensionImmutable; import com.jogamp.nativewindow.util.DimensionImmutable;
import javax.media.nativewindow.util.PixelFormat; import com.jogamp.nativewindow.util.PixelFormat;
import javax.media.nativewindow.util.PixelRectangle; import com.jogamp.nativewindow.util.PixelRectangle;
import javax.media.nativewindow.util.Point; import com.jogamp.nativewindow.util.Point;
public class NewtMouseInput implements MouseInput, MouseListener { public class NewtMouseInput implements MouseInput, MouseListener {

@ -70,15 +70,15 @@ import java.util.EnumSet;
import java.util.List; import java.util.List;
import java.util.logging.Level; import java.util.logging.Level;
import java.util.logging.Logger; import java.util.logging.Logger;
import javax.media.nativewindow.NativeWindowFactory; import com.jogamp.nativewindow.NativeWindowFactory;
import javax.media.opengl.GL; import com.jogamp.opengl.GL;
import javax.media.opengl.GL2; import com.jogamp.opengl.GL2;
import javax.media.opengl.GL2ES1; import com.jogamp.opengl.GL2ES1;
import javax.media.opengl.GL2ES2; import com.jogamp.opengl.GL2ES2;
import javax.media.opengl.GL2ES3; import com.jogamp.opengl.GL2ES3;
import javax.media.opengl.GL2GL3; import com.jogamp.opengl.GL2GL3;
import javax.media.opengl.GL3; import com.jogamp.opengl.GL3;
import javax.media.opengl.GLContext; import com.jogamp.opengl.GLContext;
import jme3tools.converters.MipMapGenerator; import jme3tools.converters.MipMapGenerator;
import jme3tools.shader.ShaderDebug; import jme3tools.shader.ShaderDebug;
@ -1800,7 +1800,7 @@ public class JoglRenderer implements Renderer {
if (samples > 1) { if (samples > 1) {
return GL3.GL_TEXTURE_2D_MULTISAMPLE_ARRAY; return GL3.GL_TEXTURE_2D_MULTISAMPLE_ARRAY;
} else { } else {
return GL.GL_TEXTURE_2D_ARRAY; return GL2ES3.GL_TEXTURE_2D_ARRAY;
} }
case ThreeDimensional: case ThreeDimensional:
return GL2ES2.GL_TEXTURE_3D; return GL2ES2.GL_TEXTURE_3D;
@ -2014,7 +2014,7 @@ public class JoglRenderer implements Renderer {
for (int i = 0; i < 6; i++) { for (int i = 0; i < 6; i++) {
TextureUtil.uploadTexture(img, GL.GL_TEXTURE_CUBE_MAP_POSITIVE_X + i, i, 0, linearizeSrgbImages); TextureUtil.uploadTexture(img, GL.GL_TEXTURE_CUBE_MAP_POSITIVE_X + i, i, 0, linearizeSrgbImages);
} }
} else if (target == GL.GL_TEXTURE_2D_ARRAY) { } else if (target == GL2ES3.GL_TEXTURE_2D_ARRAY) {
if (!caps.contains(Caps.TextureArray)) { if (!caps.contains(Caps.TextureArray)) {
throw new RendererException("Texture arrays not supported by graphics hardware"); throw new RendererException("Texture arrays not supported by graphics hardware");
} }

@ -36,14 +36,17 @@ import com.jme3.renderer.RendererException;
import com.jme3.texture.Image; import com.jme3.texture.Image;
import com.jme3.texture.Image.Format; import com.jme3.texture.Image.Format;
import com.jme3.texture.image.ColorSpace; import com.jme3.texture.image.ColorSpace;
import java.nio.ByteBuffer; import java.nio.ByteBuffer;
import java.util.logging.Level; import java.util.logging.Level;
import java.util.logging.Logger; import java.util.logging.Logger;
import javax.media.opengl.GL;
import javax.media.opengl.GL2; import com.jogamp.opengl.GL;
import javax.media.opengl.GL2ES2; import com.jogamp.opengl.GL2;
import javax.media.opengl.GL2GL3; import com.jogamp.opengl.GL2ES2;
import javax.media.opengl.GLContext; import com.jogamp.opengl.GL2ES3;
import com.jogamp.opengl.GL2GL3;
import com.jogamp.opengl.GLContext;
public class TextureUtil { public class TextureUtil {
@ -124,9 +127,9 @@ public class TextureUtil {
setFormat(Format.RGB32F, GL.GL_RGB32F, GL.GL_RGB, GL.GL_FLOAT, false); setFormat(Format.RGB32F, GL.GL_RGB32F, GL.GL_RGB, GL.GL_FLOAT, false);
// Special RGB formats // Special RGB formats
setFormat(Format.RGB111110F, GL.GL_R11F_G11F_B10F, GL.GL_RGB, GL.GL_UNSIGNED_INT_10F_11F_11F_REV, false); setFormat(Format.RGB111110F, GL2ES3.GL_R11F_G11F_B10F, GL.GL_RGB, GL.GL_UNSIGNED_INT_10F_11F_11F_REV, false);
setFormat(Format.RGB9E5, GL2GL3.GL_RGB9_E5, GL.GL_RGB, GL2GL3.GL_UNSIGNED_INT_5_9_9_9_REV, false); setFormat(Format.RGB9E5, GL2GL3.GL_RGB9_E5, GL.GL_RGB, GL2GL3.GL_UNSIGNED_INT_5_9_9_9_REV, false);
setFormat(Format.RGB16F_to_RGB111110F, GL.GL_R11F_G11F_B10F, GL.GL_RGB, GL.GL_HALF_FLOAT, false); setFormat(Format.RGB16F_to_RGB111110F, GL2ES3.GL_R11F_G11F_B10F, GL.GL_RGB, GL.GL_HALF_FLOAT, false);
setFormat(Format.RGB16F_to_RGB9E5, GL2.GL_RGB9_E5, GL.GL_RGB, GL.GL_HALF_FLOAT, false); setFormat(Format.RGB16F_to_RGB9E5, GL2.GL_RGB9_E5, GL.GL_RGB, GL.GL_HALF_FLOAT, false);
// RGBA formats // RGBA formats
@ -346,7 +349,7 @@ public class TextureUtil {
glFmt.format, glFmt.format,
glFmt.dataType, glFmt.dataType,
data); data);
}else if (target == GL.GL_TEXTURE_2D_ARRAY){ }else if (target == GL2ES3.GL_TEXTURE_2D_ARRAY){
// prepare data for 2D array // prepare data for 2D array
// or upload slice // or upload slice
if (index == -1){ if (index == -1){

@ -45,20 +45,20 @@ import java.awt.GraphicsDevice;
import java.awt.GraphicsEnvironment; import java.awt.GraphicsEnvironment;
import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicBoolean;
import java.util.logging.Logger; import java.util.logging.Logger;
import javax.media.opengl.DebugGL2; import com.jogamp.opengl.DebugGL2;
import javax.media.opengl.DebugGL3; import com.jogamp.opengl.DebugGL3;
import javax.media.opengl.DebugGL3bc; import com.jogamp.opengl.DebugGL3bc;
import javax.media.opengl.DebugGL4; import com.jogamp.opengl.DebugGL4;
import javax.media.opengl.DebugGL4bc; import com.jogamp.opengl.DebugGL4bc;
import javax.media.opengl.DebugGLES1; import com.jogamp.opengl.DebugGLES1;
import javax.media.opengl.DebugGLES2; import com.jogamp.opengl.DebugGLES2;
import javax.media.opengl.GL; import com.jogamp.opengl.GL;
import javax.media.opengl.GLAutoDrawable; import com.jogamp.opengl.GLAutoDrawable;
import javax.media.opengl.GLCapabilities; import com.jogamp.opengl.GLCapabilities;
import javax.media.opengl.GLEventListener; import com.jogamp.opengl.GLEventListener;
import javax.media.opengl.GLProfile; import com.jogamp.opengl.GLProfile;
import javax.media.opengl.GLRunnable; import com.jogamp.opengl.GLRunnable;
import javax.media.opengl.awt.GLCanvas; import com.jogamp.opengl.awt.GLCanvas;
public abstract class JoglAbstractDisplay extends JoglContext implements GLEventListener { public abstract class JoglAbstractDisplay extends JoglContext implements GLEventListener {

@ -35,7 +35,7 @@ package com.jme3.system.jogl;
import com.jme3.system.JmeCanvasContext; import com.jme3.system.JmeCanvasContext;
import java.awt.Canvas; import java.awt.Canvas;
import java.util.logging.Logger; import java.util.logging.Logger;
import javax.media.opengl.GLAutoDrawable; import com.jogamp.opengl.GLAutoDrawable;
public class JoglCanvas extends JoglAbstractDisplay implements JmeCanvasContext { public class JoglCanvas extends JoglAbstractDisplay implements JmeCanvasContext {

@ -47,9 +47,9 @@ import java.nio.IntBuffer;
import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicBoolean;
import java.util.logging.Level; import java.util.logging.Level;
import java.util.logging.Logger; import java.util.logging.Logger;
import javax.media.opengl.GL; import com.jogamp.opengl.GL;
import javax.media.opengl.GL2GL3; import com.jogamp.opengl.GL2GL3;
import javax.media.opengl.GLContext; import com.jogamp.opengl.GLContext;
public abstract class JoglContext implements JmeContext { public abstract class JoglContext implements JmeContext {

@ -45,7 +45,7 @@ import java.lang.reflect.InvocationTargetException;
import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicBoolean;
import java.util.logging.Level; import java.util.logging.Level;
import java.util.logging.Logger; import java.util.logging.Logger;
import javax.media.opengl.GLAutoDrawable; import com.jogamp.opengl.GLAutoDrawable;
import javax.swing.JFrame; import javax.swing.JFrame;
import javax.swing.SwingUtilities; import javax.swing.SwingUtilities;

@ -44,19 +44,19 @@ import com.jogamp.opengl.util.AnimatorBase;
import com.jogamp.opengl.util.FPSAnimator; import com.jogamp.opengl.util.FPSAnimator;
import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicBoolean;
import java.util.logging.Logger; import java.util.logging.Logger;
import javax.media.opengl.DebugGL2; import com.jogamp.opengl.DebugGL2;
import javax.media.opengl.DebugGL3; import com.jogamp.opengl.DebugGL3;
import javax.media.opengl.DebugGL3bc; import com.jogamp.opengl.DebugGL3bc;
import javax.media.opengl.DebugGL4; import com.jogamp.opengl.DebugGL4;
import javax.media.opengl.DebugGL4bc; import com.jogamp.opengl.DebugGL4bc;
import javax.media.opengl.DebugGLES1; import com.jogamp.opengl.DebugGLES1;
import javax.media.opengl.DebugGLES2; import com.jogamp.opengl.DebugGLES2;
import javax.media.opengl.GL; import com.jogamp.opengl.GL;
import javax.media.opengl.GLAutoDrawable; import com.jogamp.opengl.GLAutoDrawable;
import javax.media.opengl.GLCapabilities; import com.jogamp.opengl.GLCapabilities;
import javax.media.opengl.GLEventListener; import com.jogamp.opengl.GLEventListener;
import javax.media.opengl.GLProfile; import com.jogamp.opengl.GLProfile;
import javax.media.opengl.GLRunnable; import com.jogamp.opengl.GLRunnable;
public abstract class JoglNewtAbstractDisplay extends JoglContext implements GLEventListener { public abstract class JoglNewtAbstractDisplay extends JoglContext implements GLEventListener {

@ -35,7 +35,7 @@ package com.jme3.system.jogl;
import com.jme3.system.JmeCanvasContext; import com.jme3.system.JmeCanvasContext;
import com.jogamp.newt.awt.NewtCanvasAWT; import com.jogamp.newt.awt.NewtCanvasAWT;
import java.util.logging.Logger; import java.util.logging.Logger;
import javax.media.opengl.GLAutoDrawable; import com.jogamp.opengl.GLAutoDrawable;
public class JoglNewtCanvas extends JoglNewtAbstractDisplay implements JmeCanvasContext { public class JoglNewtCanvas extends JoglNewtAbstractDisplay implements JmeCanvasContext {

@ -42,8 +42,8 @@ import java.util.List;
import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicBoolean;
import java.util.logging.Level; import java.util.logging.Level;
import java.util.logging.Logger; import java.util.logging.Logger;
import javax.media.nativewindow.util.Dimension; import com.jogamp.nativewindow.util.Dimension;
import javax.media.opengl.GLAutoDrawable; import com.jogamp.opengl.GLAutoDrawable;
public class JoglNewtDisplay extends JoglNewtAbstractDisplay { public class JoglNewtDisplay extends JoglNewtAbstractDisplay {

@ -41,12 +41,12 @@ import com.jogamp.newt.NewtVersion;
import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicBoolean;
import java.util.logging.Level; import java.util.logging.Level;
import java.util.logging.Logger; import java.util.logging.Logger;
import javax.media.opengl.GL; import com.jogamp.opengl.GL;
import javax.media.opengl.GLCapabilities; import com.jogamp.opengl.GLCapabilities;
import javax.media.opengl.GLContext; import com.jogamp.opengl.GLContext;
import javax.media.opengl.GLDrawableFactory; import com.jogamp.opengl.GLDrawableFactory;
import javax.media.opengl.GLOffscreenAutoDrawable; import com.jogamp.opengl.GLOffscreenAutoDrawable;
import javax.media.opengl.GLProfile; import com.jogamp.opengl.GLProfile;
public class JoglOffscreenBuffer extends JoglContext implements Runnable { public class JoglOffscreenBuffer extends JoglContext implements Runnable {

Loading…
Cancel
Save