187 Commits

Author SHA1 Message Date
Nehon
a3f9b75d0b Added proper naming of const in Optics.glsllib and some define tests to avoid name collision when importing several glsllib 2014-12-30 07:52:18 +01:00
Nehon
50ec3023d4 Fixed ScreenshotAppState, VideoRecorderAppSate, AwtPanel and TestRenderToMemory so the frameBuffer is read with an BGRA8 format 2014-12-29 00:17:59 +01:00
Nehon
05baf56130 The skyFactory now supports Equirectangular environment maps, as it's a pretty popular format.
It has been refactored to handle the 3 env map types : CubeMap, SphereMap, EquirectMap
2014-12-28 16:23:32 +01:00
Nehon
9f459af4e3 One can now call readFrameBuffer with a specific format, implementation has been done for the GLRenderer only.
For now only placeholders have been done for the renderers that are still not using URA (all except LWJGL).
2014-12-28 16:23:30 +01:00
iwgeric
a55aae21f9 Minor cleanup of mouse / keyboard methods for touch.
Depreciated InputManager.getSimluateMouse and replaced with InputManager.isSimulateMouse for consistancy.
Removed depreciated TouchInput.getSimulateMouse().
Added InputManager.isSimulateKeyboard() to keep consistancy with mouse methods.
2014-12-12 13:16:41 -05:00
iwgeric
a116389814 Forgot to add isSimulateKeyboard to TouchInput interface. 2014-12-12 13:00:05 -05:00
iwgeric
1ed1463476 Add support for enabling/disabling KeyEvent simulation for soft keyboards on Android similar to MouseEvents. 2014-12-12 12:48:25 -05:00
iwgeric
249f62fe95 remove showVirtualKeyboard from TouchInput 2014-12-12 12:16:45 -05:00
iwgeric
7040e32cc4 Add javadoc to JmeSystem.showSoftKeyboard 2014-12-12 12:04:16 -05:00
iwgeric
d42a777909 Add showSoftKeyboard(boolean show) to JmeSystem.
Includes empty implementations for now.  Android to be implemented in next commit.
2014-12-12 08:15:53 -05:00
shadowislord
ac2f765d5b Cleanup GL interface from unused calls
Also modify glGet***InfoLog a bit to be more compatible with Android
2014-12-09 18:22:14 -05:00
Paul Speed
44c860e2d2 Merge pull request #201 from Bebul/invalidateUpdateListOptimization
Fix invalidateUpdateList not to use both cycle and recursion traverse
2014-12-09 05:36:34 -05:00
Bebul
12d45dedc0 Fix invalidateUpdateList not to use both cycle and recursion traverse 2014-12-09 10:04:44 +01:00
Nehon
30f8ff4b81 added a MipMapImageRaster that can read and write to the different mipmaps of an image 2014-12-09 00:02:34 +01:00
Nehon
1e9d1dd29c ImageCodec and all implementations now take and additional offset in the read/writeComponent methods
DefaultImageRaster now have a setSlice method
2014-12-09 00:01:39 +01:00
Nehon
7c41355cca fixed an issue where calling setCursorVisible on the ChaseCameraAppstate before it's initialized was causing an NPE. 2014-12-09 00:00:08 +01:00
Nehon
505ebd0e6b extractVersion in GLRenderer now uses regexp 2014-12-07 21:36:18 +01:00
Paul Speed
05c6986492 Significantly changed the way updateLogicalState
works internally to avoid full-scene graph traversals
once per frame.
Random unrelated things first:

Spatial constructors were modified to be protected since it
is an abstract class and it's good practice.  I also flipped
them to be this(default values) instead of this() to delegate
constructors.

Geometry and Node constructors were modified in similar ways
to at least call the this(name) version of the constructor
everywhere.

removeControl(Class) was modified to do what it's javadoc
says and only remove the first encountered control.  Prior
to this change, it was removing all matching controls.

The meaty stuff:
Node.updateLogicalState() no longer traverses all children
and never traverses any children at all unless it is the root.
If it is the root node, it keeps a list of all Spatials that
require updates and only iterates that list.

Spatial was modified to have a package-private requiresUpdates()
method that returns true if the requiresUpdates flag is set
or the Spatial has controls.

The requiresUpdates flag can be set by subclasses that require
updateLogicalState() to be called even if they have no controls.
(BitmapText is such an example.)  By default, subclasses will
_always_ have this flag set to true, ie: default to the OLD behavior
and avoid silently breaking.

Subclasses that wish to have the new-hotness optimal behavior
must call setRequiresUpdates(false) in their constructors.
They can opt in to better performance rather than silently
breaking with an upgrade.

The only negative side effect of this change (other than
slightly increased complexity) is that for large scene
graphs with lots and lots of controls or children requiring
updates, a large list of spatials will be kept in the root
node.  This will never exceed "number of spatials in the
scene graph" and so already had a fairly small upper bound
with the old code due to performance.

I think I've captured all of the edge cases... but we'll
see. :)

Stress test example to follow.
2014-12-07 04:39:22 -05:00
shadowislord
bd318f5d1b Introduce the unified renderer architecture for the OpenGL renderer
* Similar to the OpenAL URA, OpenGL calls are now made to an interface
   which is implemented by the backends
 * Major cleanups in the texture util code to handle GLES2 texture formats
 * Split the GL interface into several interfaces depending on API and version:
   - GL (common denominator for all GL APIs)
   - GL2 (desktop GL2)
   - GL3 (desktop GL3)
   - GLFbo (framebuffer object functions)
   - GLExt (desktop GL and OpenGL ES extensions)
 * Added GLTracer class which traces OpenGL calls made by the engine when activated
2014-12-05 22:29:58 -05:00
shadowislord
d8b9c6dab5 Make Renderer.initialize() a standard method since everyone already uses it anyway 2014-12-05 22:15:40 -05:00
shadowislord
ad26e916ee Update renderer capabilities
* Add capabilities not normally supported by GLES2 for unified renderer
 * Remove ARBProgram since it isn't used by jME3
2014-12-05 22:13:28 -05:00
shadowislord
ae70667104 Deprecate WrapMode.BorderClamp since it is deprecated in OGL3+ 2014-12-05 22:07:30 -05:00
shadowislord
610ac6ae24 Make sure Mesh.isAnimated() works for hardware skinning 2014-12-05 22:04:26 -05:00
shadowislord
798ec94b11 Minor cleanup for previous merge 2014-12-05 21:09:55 -05:00
shadowislord
10ee96d839 Merge branch 'updateGeometricStateOptimization' of https://github.com/Bebul/jmonkeyengine 2014-12-05 18:46:55 -05:00
Bebul
c19842c55f clear RF_CHILD_LIGHTLIST even when there are no children 2014-12-04 15:17:39 +01:00
Bebul
a400cb1c58 Optimize updateGeometricState to not recurse all children when not necessary
Conflicts:
	jme3-core/src/main/java/com/jme3/scene/Node.java
2014-12-04 15:17:38 +01:00
Paul Speed
308e88fd21 Fixed what I'm pretty sure is a typo. I didn't test it
but I can see no reason to clear the refresh flag on these
methods but setting it seems entirely logical.
2014-12-01 03:12:38 -05:00
shadowislord
c7b6445a35 Fix exception when stopping non-cached audio stream 2014-11-27 11:51:45 -05:00
shadowislord
9e02ef0d5d Fixed various assertion errors in audio renderer
Added additional assertions and other checks where appropriate
2014-11-25 19:04:31 -05:00
shadowislord
595eb56f9b Throw exception if seeking a non-seekable audio stream 2014-11-25 18:51:23 -05:00
shadowislord
64b3be5334 Fix incorrect animation when dynamically switching from SW anim -> HW anim 2014-11-21 21:44:16 -05:00
shadowislord
be1f219f29 The old Android MediaPlayer based audio renderer is now deprecated 2014-11-20 20:33:30 -05:00
shadowislord
915b0b8c61 Replace AtomicBoolean with Object as the audio thread lock 2014-11-20 20:24:23 -05:00
shadowislord
2ec7366fde Initialize OpenAL context in the render thread
Also remove useless AndroidAudioRenderer from jme3-ios
2014-11-20 20:21:37 -05:00
shadowislord
9965d20c44 Make sure we copy the mipmap sizes when generating texture array from images 2014-11-18 21:12:15 -05:00
shadowislord
a5699e9d82 Streaming audio data now works in a similar way to buffered data.
It is possible to loop streaming sources, as well as play
them again after they finished playing. It is possible to stop()
and then play() a streaming source to start playing from the
beginning. Essentially the lifecycle of a streaming audio
is now completely controlled by the user, in the same fashion
as buffered data.
In addition, AudioNode status updates (when an audio stops playing)
now occur every frame rendered, as opposed to every 50 milliseconds.
2014-11-16 13:14:33 -05:00
shadowislord
3b384a7e58 Minor cleanup in ALC interface 2014-11-16 13:08:36 -05:00
shadowislord
ad2a5366e1 WAVLoader now implements SeekableStream (but only if seeking to time = 0) 2014-11-16 13:02:51 -05:00
shadowislord
91715c4a48 Add support for URA, or Unified Renderer Architecture for audio
* Unified all renderers into common class 'ALAudioRenderer'
 * LWJGL and Android now implement the AL / ALC / EFX interfaces to provide a common OpenAL backend for jME
 * Added support for OpenAL Soft "Pause Device" extension, which allows the engine to pause the context while running in the background (currently requires OpenAL soft 1.16 and thus is Android only feature)
2014-11-15 15:15:50 -05:00
Nehon
3bad91ef19 Single pass lighting now computes view dir in the appropriate space out of the lights loop as it's the same for all lights. 2014-11-15 11:11:11 +01:00
shadowislord
5f84147154 Fix issue where loading material parameters from J3O would fail 2014-11-11 17:55:47 -05:00
Nehon
603432790b Fixed Gaussian blur weighting thanks to http://hub.jmonkeyengine.org/forum/topic/gaussian-blur-shader-issue/ 2014-11-10 00:15:21 +01:00
shadowislord
4717e7006f Goodbye, OpenGL1 2014-11-09 12:29:28 -05:00
shadowislord
0c41d1725f Remove deprecated formats from Image (w/o changing enum ordinal) 2014-11-09 11:55:51 -05:00
shadowislord
62cfbc8a3e Remove usage of all deprecated image formats 2014-11-09 11:50:57 -05:00
shadowislord
bbd6c613f0 Reduce "Integer" class churn in rendering statistics
* Use IntMap instead of HashMap<Integer>
 * Cache last set shader to save hashmap lookup on every set uniform
2014-11-08 18:04:03 -05:00
shadowislord
b83603cd8f Added support for ETC1 compression (regular OGL only for now) 2014-11-07 21:04:55 -05:00
Nehon
81fe180713 Better Single pass test 2014-11-07 23:19:59 +01:00
shadowislord
3992ed89af Fix point sprite on Android. Fixes issue #82. 2014-11-05 23:50:09 -05:00