1092 Commits

Author SHA1 Message Date
Yan
66a46920b9 Fix typo in logger
Fix typo in logger.
Change "WeakRefAssetCache" to "WeakRefCloneAssetCache"
2018-12-21 12:35:52 -08:00
Nehon
631794f7d6 Fixes mat param override reading null integenr params as 0 2018-05-19 00:22:47 +02:00
Yan
01d0725a78 [taken]Fix issue #764
Fix infinity loop in EmitterSphereShape. issue #764

I test on both method:

    public void getRandomPoint1(Vector3f store) {
        float l = FastMath.pow(FastMath.nextRandomFloat(), 1f / 3f);
        float u = FastMath.nextRandomFloat() * 2f - 1f;
        float o = FastMath.nextRandomFloat() * FastMath.TWO_PI;

        store.z = l * u;
        u = 1f / FastMath.fastInvSqrt(1f - u * u);
        store.x = l * u * FastMath.cos(o);
        store.y = l * u * FastMath.sin(o);
        store.multLocal(radius);
        store.addLocal(center);
    }

    public void getRandomPoint2(Vector3f store) {
        do {
            store.x = (FastMath.nextRandomFloat() * 2f - 1f);
            store.y = (FastMath.nextRandomFloat() * 2f - 1f);
            store.z = (FastMath.nextRandomFloat() * 2f - 1f);
        } while (store.lengthSquared() > 1);
        store.multLocal(radius);
        store.addLocal(center);
    }
    // Test
    public void testGetRandomPoint() {
        int n = 1000000;
        long start = System.nanoTime();
        for (int i = 0; i < n; i++) {
            getRandomPoint1(store);
        }
        long time1 = System.nanoTime() - start;

        start = System.nanoTime();
        for (int i = 0; i < n; i++) {
            getRandomPoint2(store);
        }
        long time2 = System.nanoTime() - start;

        System.out.println("t1:" + time1);
        System.out.println("t2:" + time2);
        System.out.println("t1/t2:" + (float) time1 / time2);
    }

Result:

    t1:352272158
    t2:94436324
    t1/t2:3.7302613

Method2 seems nearly 4 times faster than method1.
2018-01-21 09:58:32 +01:00
demoth
8ef1f2ef3b Fix #694 Reduce the logging level for OpenCLObjectManager 2018-01-21 09:57:24 +01:00
MeFisto94
5aef90da47 Fix Shadow Filters not having a default constructor and hence not being deserializable. 2018-01-21 09:57:06 +01:00
Domenic Cassisi
d36bbcf26c Adds missing key code for Print Screen (#682) (#806)
* Adds missing key code for Print Screen and update javadoc (#682)
2018-01-21 09:56:47 +01:00
Stephen Gold
8f1ee0ec9a initialize InputManager.cursorPos to fix issue #792 for LWJGL2 2018-01-21 09:53:06 +01:00
Ali-RS
e87eeb20a5 Fix javadoc for Quaternion.toAngles() method (#802)
* Fix javadoc for Quaternion toAngles and fromAngles

JME treats Z as the main direction or look direction so x is pitch, y is yaw, and z is roll,
2018-01-21 09:52:43 +01:00
Stephen Gold
ad2cb1a469 correct javadoc typo in AppSettings.java 2018-01-21 09:51:27 +01:00
Nehon
12004217d1 Ao map now only attenuates indirect lighting in PBR shader 2018-01-04 16:53:48 +01:00
Rémy Bouquet
a6b86ad24d Fixes Lightmap handling in PBR shader 2018-01-01 14:12:00 +01:00
Stephen Gold
950721f926 Uniform.java: avoid ClassCastException when overriding Vector4 params 2017-12-27 20:51:40 +01:00
Nehon
0d8b86b66f Add default config for glb loader 2017-12-24 22:16:18 +01:00
Nehon
fc8135412f Fixes normal lighting in world space for PBR 2017-12-18 17:43:57 +01:00
Nehon
435f2d4d05 Prevents NaN time when animation length is 0 (case of a pose) 2017-12-17 18:46:46 +01:00
Nehon
1b2cc6a63b SkeletonControl now falls back to software skinning when there are more than 255 bones instead of crashing when the shader compiles. 2017-12-10 19:56:32 +01:00
Remy Van Doosselaer
683bf632f6 add an empty constructor to Grid mesh (#747)
* add an empty constructor with logical values for serialization purposes. eg. the BinaryImporter has issues instantiating the Grid mesh.

* empty constructor for serialization purposes
2017-12-02 13:29:10 +01:00
Stephen Gold
e0230a4b12 roll back PR 746 (worldTransform to identity) in master branch 2017-12-02 09:04:06 +01:00
Nehon
5c9ef17e73 Fixes ReflectionAllocator for android 2017-12-01 08:41:59 +01:00
Nehon
96836de6e8 Prevents attachement nodes to have the NumBone parameter set 2017-11-28 08:48:09 +01:00
javasabr
06599d1eac fixed the constructor. 2017-11-28 08:25:41 +01:00
javasabr
6e07a214c6 Added a lit bit improvements for SafeArrayList:
1. improved comparing a SafeArrayList with another SafeArrayList.
2. improved the constructor by other collection
3. added a new constructor with init capacity.
2017-11-28 08:25:41 +01:00
javasabr
43b52cb77c Fixed finding definitions during material loading. 2017-11-27 11:37:37 +01:00
javasabr
a717a5e50f fixed NPE during loading shader node material without vertex nodes. 2017-11-27 08:42:34 +01:00
javasabr
24e467a871 fixed the problem with the reference to light, when we had incorrect reference to the light after loading/cloning spatial of this control. 2017-11-26 15:28:17 +01:00
javasabr
8674d8af4b fixed detecting varyings during loading shader nodes in the case, when we have several output parameters with the same name but with different name spaces. 2017-11-26 13:20:00 +01:00
Rickard Edén
74f2f703b3 Several changes to load cinematics
Cinematic:
	* Reattach CameraNode to scene
	* Set CameraNode's camera to be app's camera
AnimationEvent:
	* Save modelName
	* Use modelName and try to replace scene's model in initEvent
2017-11-26 13:19:33 +01:00
Rickard Edén
ae97614c83 Trying to make Cinematic serialization work.
This way at least it doesn't crash: Removed anonymous inner class and made new class; CameraEvent
Added a bunch of default constructors for other related classes in the process.
2017-11-26 13:19:33 +01:00
Nehon
2120c9d334 Attempt to fix a direct memory deallocation crash on android 2017-11-26 10:35:33 +01:00
Nehon
87cfae6d7b Fixed InstancedGeometry shadow mode 2017-11-25 15:03:00 +01:00
javasabr
9578b0410e extended some things from shader node system. 2017-11-12 19:01:24 +01:00
javasabr
839ffdd4f2 fixed the problem with saving/loading light probes. 2017-11-07 18:56:40 +01:00
Stephen Gold
47a46a8250
Merge pull request #763 from stephengold/master
fix issue #762 (WireSphere generates parallels with wrong radii)
2017-11-07 09:50:00 -08:00
Nehon
e4b6bf82a2 Better PBR env map generation 2017-11-05 23:52:22 +01:00
Stephen Gold
3328f2a3a7 fix issue #762 (WireSphere generates parallels with wrong radii) 2017-11-04 16:54:50 -07:00
Nehon
171007693b De duplicate imports when generating a shader from shader nodes 2017-10-28 18:16:17 +02:00
javasabr
ec121f025f simplified version. 2017-10-13 08:08:55 +02:00
javasabr
b9e3788ffa fixed NPE when you try to remove an unused asset loader. 2017-10-13 08:08:55 +02:00
Alexandr Brui
556e3de1c0 fixed asset linked node to reuse shared data between loaded models. (#739)
* fixed asset linked node to reuse shared data between loaded models.
* updated implementation of binary loader.
2017-10-01 20:48:38 -04:00
Stephen Gold
2632c3227c fix issue #749: NPE in CollideIgnoreTransformTest 2017-10-01 00:12:43 -07:00
Stephen Gold
083f21d6a2 FlyByCamera: comments, annotations, & imports; address GitHub issue #697 2017-09-27 21:26:59 -07:00
Stephen Gold
8a5da0eb0e Geometry: set worldTransform to identity if ignoreTranform is true 2017-09-23 14:36:01 -07:00
Kirill Vainer
ad2a9e6230 Revert "Resolving issue in ticket #661. Creating skelton debugger that allows bones to be extended in any direction instead of only the Y direction. (#681)"
This reverts commit 989c7926df8d1bccb635b97f55da7c05bfad60ad.
2017-09-22 13:51:49 -04:00
Stephen Gold
e4bfe8a80d testcase & fix for issue #744: collideWith() versus setIgnoreTransform() 2017-09-22 09:36:52 -07:00
Nehon
37e4d4d564 PBR: Applied band factor to sh coefficient.
Regenrerated the default probe in test data
better gloss / spec pipeline
2017-09-22 17:58:29 +02:00
Alexandr Brui
66137d53b8 added auto closing readers. (#738) 2017-09-21 15:33:12 -04:00
Bekreth
989c7926df Resolving issue in ticket #661. Creating skelton debugger that allows bones to be extended in any direction instead of only the Y direction. (#681) 2017-09-21 15:30:58 -04:00
Alexandr Brui
fb99ca90b1 fixed NPE. (#737)
* fixed NPE.
* changed the if condition.
2017-09-21 15:27:18 -04:00
Nehon
97fe9cc49c PBR properly normalize tangent frame 2017-09-20 07:59:38 +02:00
Nehon
c00407da33 PBR : Removed specularColor contribution from direct lighting specular. 2017-09-18 23:00:57 +02:00