1256 Commits

Author SHA1 Message Date
Riccardo Balbo
d109e4739e Fix last query not closed in profiler 2020-04-10 22:52:19 +02:00
Stephen Gold
b8287a2d0d correct some typographic errors in Billboard100.frag comments 2020-04-07 16:23:22 -07:00
Stephen Gold
51022fd521 elimiate incidental hard tabs from jme3-core 2020-04-07 10:51:33 -07:00
MeFisto94
0115616652 UBO: Re-order the caps detection for a more clean code. 2020-04-04 17:19:10 +02:00
MeFisto94
64797f9bff UBO: GL_INVALID_ENUM on Mesa 2020-04-04 16:19:56 +02:00
MeFisto94
21b7a71cf8 Fixes SSBO causing GL_INVALID_ENUM in Debug Mode 2020-04-04 15:41:36 +02:00
MeFisto94
646e6741b9 GLSLCompat: The Matrix3 Sub-Constructor is called mat3_sub and defers to the builtin mat3 if available. 2020-04-04 14:07:58 +02:00
MeFisto94
2276197a2b Fixing PBR on <= GLSL 130:
- GLSLCompat now implements mat3(mat4) and determinant() and inverse() for mat2 and mat3
 - PBR.glslib uses this functions again instead of one-off workarounds
2020-04-04 13:44:10 +02:00
MeFisto94
2379cfba77
Merge pull request #1276 from MeFisto94/fix-gldebug
Fixes #1272 - Improve GLDebugDesktop by reducing manual overrides
2020-04-04 03:09:19 +02:00
MeFisto94
df39677381 GLDebug: Throw an IllegalArgumentException instead of an IllegalStateException 2020-04-04 02:50:31 +02:00
MeFisto94
461227bdef Fixes #1304 - Don't use mat3() constructor to keep compatibility with GLSL110 2020-04-02 23:07:33 +02:00
Riccardo Balbo
728a05c4f3 lambda 🎉 2020-04-02 14:56:49 +02:00
Ali-RS
0c6f240222
Check culling on the instanced geometries. (#1315) 2020-04-02 10:47:11 +04:30
MeFisto94
4d81d00f45 GLDebug: Throw an unchecked exception instead of returning null to enforce a crash when glGetError is not present. 2020-04-01 19:45:37 +02:00
MeFisto94
312fb5bb57 GLDebug: Use a method handle instead of a string comparison to increase the performance 2020-04-01 14:23:01 +02:00
Daniel Perano
0aa50a0f15 Expose ViewPorts
This commit allows EnvironmentCamera users to access the ViewPorts used
for rendering the snapshots. This allows incorporating screenspace and other
SceneProcessor-based effects into the snapshots as well as the scene geometry.
2020-03-16 00:28:44 -07:00
Lou Hamersly
c1d359ca59
Fix #1289 Matrix3f/Matrix4f equals() should require an exact class match (#1302) 2020-02-25 15:14:03 -08:00
Stephen Gold
8e334aa756
BufferUtils: resolve issue #1288 (rewrite isDirect()) (#1299) 2020-02-24 08:40:02 -08:00
Stephen Gold
f652591281
remove unnecessary casts and tests for null, discovered using NetBeans (#1285)
* remove unnecessary tests for null, discovered using NetBeans

* jme3-core: remove unnecessary casts

* jme3-examples: remove unnecessary casts

* jme3-vr: remove unnecessary casts

* jme-plugins: remove unnecessary casts

* jme3-terrain: remove unnecessary casts

* jme3-desktop: remove unnecessary casts

* jme3-android: remove unnecessary casts

* remove unnecessary casts, discovered using NetBeans

* TerrainQuad: back out one casting delta that's not a removal

* TerrainPatch: simplify generateLodEntropies() after removal of the cast

* TerrainPatch: simplify reIndexGeometry() after removal of the cast
2020-02-13 10:21:51 -08:00
MeFisto94
12481c08f6 Use a reflection-based approach to call checkError() after every call to the openGL API to reduce Code Duplication and increase Maintainability, while also fixing the regression caused by GLDebugDesktop extending from GLDebugES and thus making the Renderer think it is on mobile. 2020-02-12 23:56:06 +01:00
MeFisto94
ab96460853
Fix small things (#1287)
* JmeVersion: Don't throw a NullPointerException when version.properties can't be found.

* ImplHandler: Reduce Code-Duplication by using a multi-catch statement
2020-02-12 10:48:46 -08:00
Stephen Gold
f268d00222 Fixes issue #1286 2020-02-10 05:35:59 -08:00
Paul Speed
5584c93d4a
Merge pull request #1282 from stephengold/master
re-assign Simsilica LLC copyrights with Paul's permission (issue #1001)
2020-02-07 17:09:12 -05:00
MeFisto94
8219d7fc02
Add two convenience flags to AppSettings: GraphicsTrace and GraphicsTiming. (#1279) 2020-02-03 17:56:36 -08:00
Stephen Gold
dde0906963 re-assign Simsilica LLC copyrights with Paul's permission (issue #1001) 2020-02-02 23:27:43 -08:00
MeFisto94
acbddc2763
Merge pull request #1252 from MeFisto94/add-opengl31-lwjgl
Fixes #1251 - Support OpenGL3.1 on LWJGL2 and LWJGL3
2020-02-01 14:29:51 +01:00
Stephen Gold
0fd70b81c9
Add missing @Override annotations (#1270)
* jme3-core: add the missing @Override annotations

* jme3-desktop: add the missing @Override annotations

* jme3-bullet and jme3-jbullet: add the missing @Override annotations

* jme3-effects: add the missing @Override annotations

* jme3-terrain: add the missing @Override annotations

* jme3-examples: add the missing @Override annotations

* jme3-android: add the missing @Override annotations

* jme3-blender: add the missing @Override annotations

* jme3-ios: add the missing @Override annotations

* jme3-jogg and jme3-jogl: add the missing @Override annotations

* jme3-plugind: add the missing @Override annotations

* jme3-lwjgl and jme3-lwjgl3: add the missing @Override annotations

* jme3-networking: add the missing @Override annotations

* jme3-vr: add the missing @Override annotations
2020-01-30 09:16:47 -08:00
Ali-RS
2023440acf
Removed extra PostShadow Technique from PBRLighting.j3md (#1273) 2020-01-29 01:31:22 -08:00
Toni Helenius
867e46190e Issue 801 (#1269)
* Test case for issue #801

* Reset the context with the initial values
2020-01-28 10:35:17 -08:00
MeFisto94
eee37022f2 Fixes #1241 - Add a convenient Graphics Debug Option for the AppSettings (#1256) 2020-01-27 10:52:36 -08:00
Ryan McDonough
233bc6f0da PreShadow & PostShadow Support for PBRLighting.j3md (#1265)
* Update PBRLighting.j3md

* Create PreShadowPBR.frag

* Create PostShadowPBR.frag
2020-01-27 10:12:52 +03:30
MeFisto94
04e7bed5e7 Fixes #1251 - Support OpenGL3.1 on LWJGL2 and LWJGL3 2020-01-12 15:22:26 +01:00
Riccardo Balbo
b059c7c0dd
Fix #1236 non-lvalue cannot be out parameter 2019-12-30 18:41:54 +01:00
joliver82
68fb1afe5d GLRenderer.modifyTexture on GLES fix (#1235)
* Update GLImageFormats.java

* First implementation to solve the glTexSubImage issue

* Setting proper format to the image

* Removed the Image.convertToFormat method and its usage from GLRenderer.modifyTexture. Added a warning instead for the potential failing cases
Fixing the issue in JmeBatchRenderBackend.loadImage transforming it to RGBA8 if required
2019-12-22 21:23:31 -08:00
Stephen Gold
cdcf0512d9
com.jme3.scene.shape.Line: protect the no-argument constructor (#1234) 2019-12-14 21:12:00 -08:00
Stephen Gold
6b7dd5b325
AnimControl: correct javadoc for the no-arg constructor (#1233) 2019-12-11 23:43:05 -08:00
Stephen Gold
8d9d091576
Mesh: avoid NPE in getMorphTargets() when there are no targets (#1231) 2019-12-09 07:39:30 -08:00
Stephen Gold
98f6d326e1
re-publicize InstancedGeometry no-arg constructor, correct erroneous javadoc (#1230)
* re-publicize 3 no-arg constructors, correct/remove erroneous javadoc

* re-protect 2 no-arg constructors, restore javadoc
2019-12-04 12:01:40 -08:00
Stephen Gold
9d2d393fc3
protect 47 no-arg constructors in the jme3-core library (#1228) 2019-12-01 14:35:52 -08:00
Paul Speed
c73fd99dd6 Fixed the null child check to throw IllegalArgumentException instead of NullPointerException
because user code should never throw NullPointerException.
Also made trying to add a child to itself an error instead of a no-op.  Attempting
to do something like guiNode.attachChild(guiNode) will now throw an IllegalArgumentException.
2019-11-28 15:56:15 -05:00
Paul Speed
c23f28b51c Modified Line to keep its own start/end instances. This is less of a surprise if
a user later chooses to call updatePoints() after having created the line with
JME constants... since updatePoints() would actually call set() instead of just
replacing the references.  The constructor and updatePoints() should match and I chose
to err on the side of caution and make them both operate on local instances.
2019-11-26 04:08:16 -05:00
Paul Speed
45b1908906 Added an app state that will verify some of the JME constants (easy to expand later)
to see if they've changed in the current frame.  SimpleApplication will configure
this by default to use asserts but the application is free to change it to throw
regular exceptions or just log the error as desired.
2019-11-26 03:34:55 -05:00
joliver82
30df2f1b87 Android morph fix (#1221)
* Fixed MorphAnim.glsllib to compile on android and avoid enabling GL_VERTEX_PROGRAM_POINT_SIZE in android as it's not supported
2019-11-24 09:20:09 +03:30
Matthew Universe
48f28974f9 Closes #1210 Quaternion.lookAt now has a return value (#1223) 2019-11-23 10:43:00 -08:00
Riccardo Balbo
b07a11c9d4 Improve support for subimage copying. Allow to copy a part of an image to a texture2D. 2019-11-20 11:02:20 +01:00
joliver82
663c9776e8 Android openGL ES 3 support (#1147)
* Update GLImageFormats.java

* Added basic support for openGL ES 3.0 and GLSL300 for android

Added instancing support for android which is core feature in GLES3.0

Added fix for shadows in android

* Fixed required types of GLES30.glDrawElementsInstanced

* Properly check GLES3 version and setting precision for shaders for all GLSL ES versions

* Added support for Opengl ES 3.1 and 3.2 and their shader versions
Added proper checkings for new OpenGL ES versions
Fixed some issues with shadow rendering in GLES 3.0 or better (strict type checking, OpenGL ES specific extensions and percision definition)
Added GLSL320 and GLSL300 to Unshaded and Lighting materials

* Added depth texture 24bit for OpenGL ES

* Added geometry shaders and tessellation to GLES 3.1 as extension and GLES 3.2 as core
Modified test materials to use GLSL310

* Added FB blit for android GLES30

* Added GlSL300 or better to all effects not able to run in GLSL100
Mods on Shadows.glsllib to try to fix android shadow rendering
Fixed ssaoBlur.frag that was using a reserved word
Fixed precision type missmatch from vertex to fragment shader

* Partial multisample support
Framebuffer MRT support

* Temporarily removed texture multisampling (not being able to compile using GLES31)

* Updated android.jar to api28
Enabled multisampling

* Better checking for GLES3

* Removed insert precision for all shaders. This avoided some random precision missmatch error but created rendering issues

* Removed border check for GLES, caused filtered shadows not to render on GLES2.0 devices

Added texture compare mode for GLES3.0 and better to be able to use sampler2DShadow

Modified base materials (Lighting and Unshaded) to use only GLSL100 for post shadow pass

* Corrected texture comparison function that were incorrectly changed

* Added precision to samplers for GLESSL300 also

* Created a subclass of Glsl150ShaderGenerator (Glsl300ShaderGenerator) to support ShaderNodes in GLES SL30 and included it's usage in DesktopAssetManager. Nowadays just copied and overwrote the version string. Needs a full review
Added image format RGB16F to be used as texture format only in GLES30 (cannot be used as FB format)
Added GLSL300 and/or GLSL310 to different materials

* Cleaned GLSL300 generator
Fixed shadows glsl lib removing use of GL_EXT_gpu_shaders5

* Fixed usag of textureCubeLod in fragment shader of envMapping which is unsupported in GLES2.0
Modified PBRLighting frag to properly compile on GLES3

* Added GLSL300 and 310 to PostShadowFilter material definition

* Make post shadow filter use GLSL100 for GLSL300
Set highp as default precision to fix glitched shadows caused because not enough precision

* Changed water_normalmap.dds to uncompressed RGB8 because DXT1 is mostly unsupported in GLES

* Fixed GLES30 compilation issues in Water shaders and added GLSL300 to LightScattering material. ** Not fully tested

* Added RGB8 dds formatted FullskiesSunset to be used in any platform. Previous file moved to _dtx1.dds

* Set GL_TEXTURE_MAX_LEVEL in GLES30 contexts fixing issue with not fully mipmapped images and PBR rendering

* Fixed compilation of jme3-android-examples and upgraded sdk version to use

* Fixed Geometry Shader and Tessellation Shaders in testdata package to properly compile on GLES320

* Added non-compressed textures to be able to run all examples on android

Enabled texture arrays and 3d textures on opengl es 3.0. Peding to implement wrappers to android gl functions (currently getting NullPointerException)

* More GLES30 functions included to properly support texture arrays, 3d textures and multisampling matching jme core code

* Fixed 3D texture tests for GLES30
Fixed texture 3D and texture array example shader compilation on GLES30
Fixed some random missing precision compilation errors on GLES30

* Fixed TestTextureArray for GLES30

* Some multisample additions and removal of GLES3 multisampling enable caps
Added RGBA16F as valid format for GLES32 and using it by default in env camera instead of RGB16F. kept fall back to RGB8

* added float and half float formats for gles30
added rgb10a2 format for gles30
fixed usage of glTexImage2D
removed EnvironmentCamera fallback image format as it's useless now

* Added more image formats for GLES30
Fixed rgb8 if having Caps.Rgba8

* Enabled RadialBlur for gles30

* Fixed luminance texture formats for gles

* Added more depth image formats for gles3

* Enabled multisampling in gles3

* Added GLES30 functions to GLDebugES
Reverted TestTexture3D and TestTextureArray to use RGB8 format
Updated EnvMapping100.frag to use EXT_shader_texture_lod in gles sl 100 if available

* Removed all aditional not used compressed dds files
Removed also Pond and rock png files previously used in TestTextureArray

* Removed compressed water_normalmap_dxt1.dds

* Changed GLES_30 and AndroidGL implementing GL2 to avoid duplicated code checking GL2 vs GLES30

* Added aditional checking to avoid gles30 calls from gles20 only devices
2019-11-16 08:24:30 +03:30
Ali-RS
7ae1ff23af
Fixed a typo 2019-11-09 15:54:27 +03:30
Stephen Gold
92b161f38e fix issue #1202 2019-11-02 10:52:17 -07:00
Ali-RS
2c6161ecd8 Added AnimComposer.hasAnimClip() 2019-10-24 10:43:19 +03:30
Ali-RS
d4c9a9ad1e
Added Joint.getInitialTransform() (#1206) 2019-10-24 10:32:42 +03:30