1212 Commits

Author SHA1 Message Date
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
Ali-RS
3b8665fe93
Fixed an issue with BlendableAction.setTransitionLength()... (#1205)
...which was not setting new length to transition tween and causing the new length to have no effect.
2019-10-23 13:43:56 +03:30
Ali-RS
5c75af1d38 AnimComposer: added getTime() and setTime() methods (#1201)
Resolves #1200
2019-10-13 10:52:40 -07:00
Stephen Gold
3e89cd1377
define 2 new Platform values for Linux ARM, register BulletJme lib paths (#1182) 2019-09-18 20:50:45 -07:00
Stephen Gold
5eaf653de9
address issue #1119 (serialization with protected/private constructor) (#1181)
* address issue #1119 (serialization with protected/private constructor)

* remove an unnecessary step in findNoArgConstructor()

* use getDeclaredConstructor() in place of the for-loop

* simplify by throwing the exception in findNoArgContructor()
2019-09-17 17:58:44 -07:00
Stephen Gold
3c74fe539c
test and fix for issue #1138 (#1177) 2019-09-17 08:53:19 -07:00
Paul Speed
1ffd11fae4 Added a basic unit test for some of the AppStateManager functionality.
(Specifically the stuff that deals with IDs.)
Also added the ability to use groovy tests for those who like a little
testing but aren't complete masochists.
2019-09-15 20:54:53 -04:00
Paul Speed
36afe829c6 Part 2 of the small AppState refactoring: added methods to AppStateManager
for retrieving an AppState by ID.  Also modified attach() to throw an
IllegalArgumentException if the ID is already registered.
Updated TestAppStateLifeCycle to add a small ID demonstration.
2019-09-15 20:27:46 -04:00
Paul Speed
3b8314a36f Part 1 of small refactoring to give AppState a unique ID for lookup purposes.
This is a breaking change for direct implementers of AppState as they must
add a getId() method.  (Which is also a good time to evaluate if they should
be extending AbstractAppState or BaseAppState and/or if their life cycle is
implemented correctly. e.g.: BulletAppState is breaking the AppState contract
a bit.)
2019-09-15 19:38:50 -04:00
Riccardo Balbo
a9afcecc41
Recognize .glsl files as glsllib. 2019-09-02 09:25:41 +02:00
Ali-RS
467d7b2f0f Modified TransformTrack.jmeClone() return type to TransformTrack (#1155) 2019-07-30 06:33:08 -07:00
Trevor Flynn
57db8f618f Add support for gltf morph names. (#1100)
* Add support for gltf morph names.

* Fix formatting stuff

* Add morph name to be saved

* Testing changes to gltf plugin

* Review changes

* Fix comments

* Fixes for review

* Remove getMorphNames from Geometry class
2019-07-11 09:51:25 +04:30
Riccardo Balbo
7058439e7d
Merge pull request #1132 from riccardobl/fixfspace
Fix forced colorspace in matdefs working only once.
2019-07-08 09:33:27 +02:00
Sebastian Teumert
0ffc612bfb jme-core: IndexBuffer fixes & API improvements (#1136)
* jme-core: IndexBuffer fixes & API improvements

As discussed in:
https://hub.jmonkeyengine.org/t/indexbuffer-suggestions-improvements-consistency/42022/4

* [Fix] createIndexBuffer(int, int): return IndexByteBuffer as well for
	vertexCount < 128
* [Enhancement] Make put(int i, int value) fluid interface
* [Enhancement] Add relative put(int i) to allow easier chaining (parity
	with other buffer implementations)
* [Enhancement] Add getFormat() to allow setting an IndexBuffer to a
	Mesh directly without type inspection.
* [Fix] Fix WrappedIndexBuffer
	API changes make it possible that IndexByteBuffer is now a valid  type
for outBuf, leverage the new getFormat() method to set the buffer to the
mesh regardless of its type.

* Update VirtualIndexBuffer to @72f8019566fa4d1379caa820c0c9dc000f489444
2019-07-07 20:42:18 -07:00
Riccardo Balbo
e603845fa5 Fix forced colorspace in materials when a matparamtexture value is changed. + unit test 2019-06-26 23:10:18 +02:00
Remy
adb88dcaeb when the image object has a ColorSpace value we pass it on, else we leave it at the default value. fix for #1106 (#1110) 2019-06-26 09:26:28 -07:00
Lou H
1687d34eb7 #1107 - Javadoc warning cleanup & Fix for JDK 11 Javadoc NPE (#1118)
* Fixed "broken" @see tags causing Javadoc NPE in JDK 11

* Updated comments to clear Javadoc warnings in JDK 11

* Added @Deprecated annotations to clear JDK 11 Javadoc warnings
2019-06-18 09:06:48 -07:00
Lou H
1f3245b237 #1121-updateBound() call for PQTorus geometry updates (#1122)
* #1121-updateBound() call for PQTorus geometry updates

* World bounds test added for #1121

* World bounds test enhancements for #1121

* Updated test comment
2019-06-18 09:04:26 -07:00
richardTingle
04f771f7f9 Issue 1113. Allow for Particle emitters that constantly have their particlesPerSec set to still emit (#1114)
Previously if particlesPerSec was constantly set timeDifference could never grow large enough to emit a particle as timeDifference was reset to zero each time. This fixes that problem while still ensuring that timeDifference can't have grown very very large (leading to huge numbers of particles being emitted) by capping the timeDifference at the point where its just about to emit a particle.

Discussed at https://hub.jmonkeyengine.org/t/particle-emitter-cannot-emit-particles-if-its-emissions-per-second-is-updated-every-frame/41930/2
2019-06-08 17:12:04 -07:00
Lou H
f8dae05a52 #1107-Fix Javadoc warnings in OpenJDK 9+ (#1112) 2019-06-08 17:06:23 -07:00
Karan Nehra
9dff704a82 Attempt to fixing 1074 (#1093)
* Attempt to fixing 1074

* Added method implementations in GlRenderer

* Added test.

* Added test to jme-examples

* Some changes to resolve merge conficts

* Fixes

* Indent-fixes

* Documented the class and added stop()

* Fixed a minor error

* Fixed build gradles

* Removed line ending
2019-06-05 08:23:32 -07:00
Riccardo Balbo
97049630eb
Merge pull request #1109 from karanehra/fix-1051
Fix for 1051
2019-06-04 09:21:14 +02:00
Karan Nehra
ddeb4549a2 Fix for 1051 2019-06-03 23:11:56 +05:30
Lou H
930090dfa0 #1097-Fixed inconsistent OpenGL version constants (#1099) 2019-06-03 09:35:12 +02:00
James Khan
82faaca87c Add unInterpolateLinear to FastMath class 2019-06-01 12:39:13 +01:00
James Khan
1116df31c9 Add fog to Single-Pass lighting. 2019-05-30 15:31:18 +01:00
James Khan
4f47e5602b Add support for fog in materials. 2019-05-23 20:49:18 +01:00
James Khan
b9b4a2d75b Reference the joystick that changed state instead of the ID.
Use separate connection methods (onConnected/onDisconnected).
2019-05-13 09:59:49 +01:00
James Khan
2f6185b5cf Remove JoystickState enum and replace with boolean value. 2019-05-12 08:31:14 +01:00
James Khan
d3be2f332f Use enum constants instead of integer ID's 2019-05-11 20:19:44 +01:00
James Khan
76fcc2c497 Remove magic number translations and remove uppercase names. 2019-05-11 20:18:56 +01:00
James Khan
318d6d0e89 Add support for listening to joystick connection/disconnection.
Fixes bug causing NullPointerException when removing joysticks.
Allows adding joysticks after the application has started.
2019-05-11 15:25:11 +01:00
Ali-RS
c4d2de1656
AnimComposer: updated to save globalSpeed on export and fixed issue with Layer cloning (#1080)
* AnimComposer: save globalSpeed on export

* Updated TestModelExportingCloning to test AnimComposer.globalSpeed

* Fixed issue with AnimComposer.Layer cloning
2019-04-30 08:22:09 +04:30
Ali-RS
36ddb5b0ce
Added ambient light support in PBR shader (#1077)
* Added ambient light support in PBR shader

* Updated to auto inject the define value if ambient light found
2019-04-27 14:56:45 +04:30
Remy
8d3980bbe9 Refactor collection to set in anim composer (#1076)
* returns an unmodifiable set when retrieving the available animation names and available animation clips instead of an unmodifiable collection. fixes: #1070

* remove unnecessary set wrapper.

* Remove the unnecessary creation of a new hashset everytime getAnimClips() is called.
2019-04-24 16:11:51 -07:00
Stephen Gold
0bf931bf79 revert integration of PR #1071 which wasn't ready 2019-04-22 03:15:04 -07:00
Greg Hoffman
0bc060d474 Added an easy way to add sub steps to the profiler (#1067)
* Added an easy way to add sub steps to the profiler and enhanced the App State Manager to profile the update method of each app state

* Added the profiler step to the android profiler

* Fixed missing profiler extensions
2019-04-22 01:41:40 -07:00
Remy
ffa1df2aff returns unmodifiable sets (#1071)
* returns an unmodifiable set when retrieving the available animation names and available animation clips instead of an unmodifiable collection. fixes: #1070

* remove unnecessary set wrapper.
2019-04-22 01:39:43 -07:00
Remy Van Doosselaer
988537987a calculate the total line height before aligning the letters, calculate the total line height from the font line height and total line count. Include a test case with alignment examples. fixes: #363 2019-04-15 18:42:03 +02:00
Remy Van Doosselaer
9a80f013fc fixed wrong reference check 2019-04-09 19:24:10 +02:00
Riccardo Balbo
3b24067a3c Add RGTC format 2019-04-07 10:22:18 -07:00
Stephen Gold
235b9db2ca publicize Joint.applyBindPose(), add DynamicAnimControl & related stuff 2019-04-03 08:07:52 -07:00
Paul Speed
54b812ca71 Standardized the XBox controller mappings to one XBOX set of entries
and remapped all .*xbox.* names to it.  All of the specific XBOX remappings
have been commented out for now.  They can be removed once it is confirmed
that old working functionality is not newly broken.
2019-03-31 20:33:32 -04:00
Paul Speed
5901a95363 Added new JoystickAxis.LEFT_TRIGGER/RIGHT_TRIGGER.
Updated JoystickCompatibilityMappings to support normalizing joystick names
based on a regex.  For example:
XBOX.regex=(?i).*xbox.*
...will allow configuring all joysticks with xbox in the name with one
XBOX configuration.
2019-03-31 20:18:11 -04:00
Stephen Gold
27bd16979c
Armature.java: correct a typo in the javadoc 2019-03-29 18:32:31 -07:00