Merge: gamnit: new services and a lot of bug fixes and performance improvements
authorJean Privat <jean@pryen.org>
Wed, 29 Nov 2017 15:40:53 +0000 (10:40 -0500)
committerJean Privat <jean@pryen.org>
Wed, 29 Nov 2017 15:40:53 +0000 (10:40 -0500)
This PR groups small fixes to gamnit and related packages. It is a general cleanup in preparation for optimizations to the gamnit depth 3D API.

Intro a few new services:
* `ParticleSystem::clear` to remove all live particles.
* `CustomTexture` can be modified and reloaded in GPU memory after the first call to `load`.
* Don't apply dynamic resolution to UI sprites as they are usually lightweight and any change in resolution is easily noticable.

Optimizations:
* Matrix creation and manipulation, in both gamnit and the matrix package.
* Free pixel data from both Nit and Java memory after loading them from the assets folder into the GPU memory.
* Avoids using mallocs in `realtime` services.

Fixes:
* Fix the left and right anchors of the `UICamera`.
* Fix a constant used to ask for antialiasing in the `egl` package.
* Avoid long attribute names in Blinn-Phong shader in case their name is truncated or the attribute is optimized out.
* Fix pointer to the parent GPU texture name in subtextures.
* Improve a few API doc.

Pull-Request: #2586
Reviewed-by: Romain Chanoir <romain.chanoir@viacesi.fr>
Reviewed-by: Jean Privat <jean@pryen.org>

1  2 
contrib/asteronits/src/asteronits.nit
lib/gamnit/depth/depth.nit
lib/gamnit/depth/depth_core.nit
lib/gamnit/depth/more_materials.nit
lib/gamnit/depth/shadow.nit
lib/gamnit/dynamic_resolution.nit
lib/gamnit/flat/flat_core.nit
lib/gamnit/textures.nit

Simple merge
Simple merge
Simple merge
@@@ -93,11 -96,9 +96,11 @@@ class SmoothMateria
                else
                        glDrawElements(mesh.draw_mode, mesh.indices.length, gl_UNSIGNED_SHORT, mesh.indices_c.native_array)
                end
 +
 +              assert glGetError == gl_NO_ERROR
        end
  
-       private fun setup_lights(actor: Actor, model: LeafModel, camera: Camera, program: BlinnPhongProgram)
+       private fun setup_lights(camera: Camera, program: BlinnPhongProgram)
        do
                # TODO use a list of lights
  
Simple merge
Simple merge
Simple merge
Simple merge