Merge remote-tracking branch 'upstream/master'
This commit is contained in:
commit
d3da4a7266
@ -48,6 +48,7 @@ import com.jme3.math.Vector3f;
|
|||||||
import com.jme3.scene.CollisionData;
|
import com.jme3.scene.CollisionData;
|
||||||
import com.jme3.scene.Mesh;
|
import com.jme3.scene.Mesh;
|
||||||
import com.jme3.scene.Mesh.Mode;
|
import com.jme3.scene.Mesh.Mode;
|
||||||
|
import com.jme3.scene.VertexBuffer;
|
||||||
import com.jme3.scene.VertexBuffer.Type;
|
import com.jme3.scene.VertexBuffer.Type;
|
||||||
import com.jme3.scene.mesh.IndexBuffer;
|
import com.jme3.scene.mesh.IndexBuffer;
|
||||||
import com.jme3.scene.mesh.VirtualIndexBuffer;
|
import com.jme3.scene.mesh.VirtualIndexBuffer;
|
||||||
@ -114,8 +115,13 @@ public class BIHTree implements CollisionData {
|
|||||||
|
|
||||||
bihSwapTmp = new float[9];
|
bihSwapTmp = new float[9];
|
||||||
|
|
||||||
FloatBuffer vb = (FloatBuffer) mesh.getBuffer(Type.Position).getData();
|
VertexBuffer vBuffer = mesh.getBuffer(Type.Position);
|
||||||
|
if(vBuffer == null){
|
||||||
|
throw new IllegalArgumentException("A mesh should at least contain a Position buffer");
|
||||||
|
}
|
||||||
IndexBuffer ib = mesh.getIndexBuffer();
|
IndexBuffer ib = mesh.getIndexBuffer();
|
||||||
|
FloatBuffer vb = (FloatBuffer) vBuffer.getData();
|
||||||
|
|
||||||
if (ib == null) {
|
if (ib == null) {
|
||||||
ib = new VirtualIndexBuffer(mesh.getVertexCount(), mesh.getMode());
|
ib = new VirtualIndexBuffer(mesh.getVertexCount(), mesh.getMode());
|
||||||
} else if (mesh.getMode() != Mode.Triangles) {
|
} else if (mesh.getMode() != Mode.Triangles) {
|
||||||
|
@ -401,7 +401,7 @@ public class GLRenderer implements Renderer {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (hasExtension("GL_ARB_draw_buffers")) {
|
if (hasExtension("GL_ARB_draw_buffers") || gl3 != null) {
|
||||||
limits.put(Limits.FrameBufferMrtAttachments, getInteger(GLExt.GL_MAX_DRAW_BUFFERS_ARB));
|
limits.put(Limits.FrameBufferMrtAttachments, getInteger(GLExt.GL_MAX_DRAW_BUFFERS_ARB));
|
||||||
if (limits.get(Limits.FrameBufferMrtAttachments) > 1) {
|
if (limits.get(Limits.FrameBufferMrtAttachments) > 1) {
|
||||||
caps.add(Caps.FrameBufferMRT);
|
caps.add(Caps.FrameBufferMRT);
|
||||||
@ -1080,6 +1080,7 @@ public class GLRenderer implements Renderer {
|
|||||||
if (linearizeSrgbImages) {
|
if (linearizeSrgbImages) {
|
||||||
stringBuf.append("#define SRGB 1\n");
|
stringBuf.append("#define SRGB 1\n");
|
||||||
}
|
}
|
||||||
|
stringBuf.append("#define ").append(source.getType().name().toUpperCase()).append("_SHADER 1\n");
|
||||||
|
|
||||||
stringBuf.append(source.getDefines());
|
stringBuf.append(source.getDefines());
|
||||||
stringBuf.append(source.getSource());
|
stringBuf.append(source.getSource());
|
||||||
|
@ -90,6 +90,8 @@ final class TextureUtil {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public GLImageFormat getImageFormatWithError(Format fmt, boolean isSrgb) {
|
public GLImageFormat getImageFormatWithError(Format fmt, boolean isSrgb) {
|
||||||
|
//if the passed format is one kind of depth there isno point in getting the srgb format;
|
||||||
|
isSrgb = isSrgb && fmt != Format.Depth && fmt != Format.Depth16 && fmt != Format.Depth24 && fmt != Format.Depth24Stencil8 && fmt != Format.Depth32 && fmt != Format.Depth32F;
|
||||||
GLImageFormat glFmt = getImageFormat(fmt, isSrgb);
|
GLImageFormat glFmt = getImageFormat(fmt, isSrgb);
|
||||||
if (glFmt == null && isSrgb) {
|
if (glFmt == null && isSrgb) {
|
||||||
glFmt = getImageFormat(fmt, false);
|
glFmt = getImageFormat(fmt, false);
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
#import "Common/ShaderLib/GLSL150Compat.glsllib"
|
||||||
|
|
||||||
#if defined(HAS_GLOWMAP) || defined(HAS_COLORMAP) || (defined(HAS_LIGHTMAP) && !defined(SEPARATE_TEXCOORD))
|
#if defined(HAS_GLOWMAP) || defined(HAS_COLORMAP) || (defined(HAS_LIGHTMAP) && !defined(SEPARATE_TEXCOORD))
|
||||||
#define NEED_TEXCOORD1
|
#define NEED_TEXCOORD1
|
||||||
#endif
|
#endif
|
||||||
|
@ -54,8 +54,8 @@ MaterialDef Unshaded {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Technique {
|
Technique {
|
||||||
VertexShader GLSL100: Common/MatDefs/Misc/Unshaded.vert
|
VertexShader GLSL150: Common/MatDefs/Misc/Unshaded.vert
|
||||||
FragmentShader GLSL100: Common/MatDefs/Misc/Unshaded.frag
|
FragmentShader GLSL150: Common/MatDefs/Misc/Unshaded.frag
|
||||||
|
|
||||||
WorldParameters {
|
WorldParameters {
|
||||||
WorldViewProjectionMatrix
|
WorldViewProjectionMatrix
|
||||||
@ -76,6 +76,25 @@ MaterialDef Unshaded {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Technique {
|
Technique {
|
||||||
|
VertexShader GLSL100: Common/MatDefs/Misc/Unshaded.vert
|
||||||
|
FragmentShader GLSL100: Common/MatDefs/Misc/Unshaded.frag
|
||||||
|
|
||||||
|
WorldParameters {
|
||||||
|
WorldViewProjectionMatrix
|
||||||
|
ViewProjectionMatrix
|
||||||
|
ViewMatrix
|
||||||
|
}
|
||||||
|
|
||||||
|
Defines {
|
||||||
|
INSTANCING : UseInstancing
|
||||||
|
SEPARATE_TEXCOORD : SeparateTexCoord
|
||||||
|
HAS_COLORMAP : ColorMap
|
||||||
|
HAS_LIGHTMAP : LightMap
|
||||||
|
HAS_VERTEXCOLOR : VertexColor
|
||||||
|
HAS_COLOR : Color
|
||||||
|
NUM_BONES : NumberOfBones
|
||||||
|
DISCARD_ALPHA : AlphaDiscardThreshold
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Technique PreNormalPass {
|
Technique PreNormalPass {
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
#import "Common/ShaderLib/GLSL150Compat.glsllib"
|
||||||
#import "Common/ShaderLib/Skinning.glsllib"
|
#import "Common/ShaderLib/Skinning.glsllib"
|
||||||
#import "Common/ShaderLib/Instancing.glsllib"
|
#import "Common/ShaderLib/Instancing.glsllib"
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#if _VERSION_ >= 150
|
#if __VERSION__ >= 130
|
||||||
out vec4 outFragColor;
|
out vec4 outFragColor;
|
||||||
# define texture1D texture
|
# define texture1D texture
|
||||||
# define texture2D texture
|
# define texture2D texture
|
||||||
|
Loading…
x
Reference in New Issue
Block a user