Fix several more apps for the 'center-of-matrix-effects-in-screen-center' change.
Merge branch 'master' into empty-matrix-effects-in-the-center
Bugfix: default, MAX region cannot be of Float.MAX_VALUE radius - then in the shader we can have an overflow. Make it 1000000 in radius.
Move the defualt state of an Object to be in the center of the screen (rather than the bottom-left like before)
1) new 'Rubik' app (skeleton)2) MeshCubes: add support for custom texture mappings on each side (Rubik needs that!)
Some improvements to the Wind app - still does not look very realistic though :(
Correct Distort.
Make Distort truly 3D.
Fixes for some stuff discovered while making the Distort effect fully 3D:
- make MeshSphere's normal lengths be 1 (used to be 0.5)- make the Effect3D app display precise values of the Center and Region vars.
Relax requirements on when we can call DistortedEffects.setMax().
Before this change one had to call it before creation of shaders and before any of the DistortedEffects classes got created.This commit removes the second requirement so now with setMax it's just like with enabling effects: it's best done in onSurfaceCreated.
Massive: make the coordinate system agree with that of OpenGL (i.e. invert the Y axis).
Make the Sink effect fully 3D.
Correct the z-axis of the center of fragment effects (it was inverted)
Progress with the Earth app.
Make the Fragment effects truly 3D: change their 4D 'region' into a 3D 'center' (a point in 3D) and 3D 'region' (which is now a set of 3 radii defining an ellipsoid around the center)
Also corresponding changes to the applications.
Further fixes for the new fully 3D vertex region.
Redefine the Vertex Region from (x,y,r,unused) to (x,y,z,r). This takes into account the 'Z', which makes it possible to warp only one side of a 3D Mesh like Sphere.
Also corresponding changes in applications.
Simplify MeshSphere by deriving it not from a regular icosahedron (which has a problem of a wiggly seam line at the 'change of date' in the back of the sphere) but something that at the back has a straight vertical border between triangles: a diamond-like 16-faced solid.
Make Matrix effects Rotate and Quaternion actually correct when it comes to the Z-axis. Also corresponding adjustments in apps.
Sphere: map the texture a bit better around the seam and the poles.
Fix (hopefully the last!) probelm with texturing the Sphere: the seam in the back.
One more improvement with texturing the Sphere.
Still one problem with texturing remains.
Further fix for the Sphere. Now hopefully only the texture mapping is wrong.
Some fixes for Sphere; still not completely ok though.
Add support for MeshSphere (add ability to display it in the 'Effects3D' and 'Inflate' apps).Still a bit buggy!
Minor.
New MeshQuad class.
- new icon for the GLOW app- rename the BitmapTree app to ObjectTree
Fix the bug where the postprocessed GLOW halo of a Cube would be of different colors depending on the order of rendring of the cube sides. (one needed to switch off BLENDing while preprocessing )
Fix the bug where the postprocessed halo would not work for the first few frames of each quality level (before this commit the bug was visible in the 'GLOW' app).
Minor cleanups.
Properly clean up static varaibles in the Effect classes!
Improve computation of the thickness of the postprocessing halo - should be independent of the size of underlying object now.Still it is not completely ok, it appears to depend on the ModelView matrix (use the Effects3D app to rotate the object around Z-axis to see this)
MeshCubes: Correct texturing of side walls. Everything should be correct now.
MeshCubes: Correct texturing of side walls. (still not everything is right there)
Make the Effects3D app a bit more user-friendly.
Bugfix: make the Inflate distances equal in all 3 dimensions regardless of dimensions of the Mesh. (still MeshFlat's Z dim needs to be corrected)
Bugfix for the situation when we would be BLURring an object, then we remove the BLUR and apply a GLOW, then remove the GLOW and apply BLUR again - the second BLUR would assume the color of the GLOW.
Important bugfix in MeshCubes for the Inflate vectors.
Translate the size of the Halo around postprocessed objects from 'number pixels around the object' (as held in the Effects themselves) to a float suitable for Inflating the underlying Mesh with the per-vertex Inflate vectors.
Progress with the Inflate vector in MeshCubes.
Pretty much works now - what remains is calibration.
Progress with Inflate (building block of postprocessing effects: the proper way of marking a halo around a Mesh)'Inflate' app testing the machanism. MeshFlat appears to be working, now we only need to fill up the per-vertex Inflate vector in the MeshCubes.
Minor simplifications in Mesh.
Added a new attribute to vertices of a MeshBase object: the vec3 'inflate' vector.This vector describes the direction where the vertex needs to be moved when we 'inflate' the whole mesh.If the mesh is locally smooth, this is simply the normal vector; otherwise (for example in the corners of the MeshCubes) - not....
Some simplifications in Meshes. Hide stuff inside MeshBase.
Fix the preprocess shader. This makes the 'Postprocess Tree' app look good again.
Small things.
Move EffectMessageSender to the 'message' package (duh!)
Rename MeshObject to MeshBase.
Fully move the Meshes to their own package.
Beginnings of a separate package only with Meshes.
Progress with Effects3D app - merge Matrix effects
Postprocessing: adjust the Projection of the postprocessing buffers to match the Projection of the surface we are supposed to be rendering to.
Correct the way we display Normals (didn't work in case rendering was of OIT type)
More progress with Effects3D app.
Progress with thr Glow effect - moving glow app looks ok now.
More progress with a more generic 'preprocess' stage of Postprocessing Effects.
Progress with a more generic 'preprocess' stage of Postprocessing Effects.
1. Hide internalQuality inside Postprocess effects.2. First step to turn markStencilAndDepth into a more generic Postprocessing 'preprocess'.
Hide the FBO_QUEUE thing inside the library. The queue is running internally now, without public setAsOutputFBO() thing (simplifies writing postprocess effects)
Partially 'fix' Glow effect for the case when FBO_QUEUE_SIZE > 1 (come back to pre-FBO_QUEUE_SIZE level of functionality).Still, Glow needs to actually get implemented correctly.
Simplify Main OIT shader.
a mix of two changes:
1) remove the DistortedInputSurface interface (now every Surface is Input)2) make the OIT SSBO self-adjustable in size
Make the OIT SSBO size independent of screen size.
Remove the redundant DistortedNode.onPause()
Largely fix the non-postprocessed OIT. Still, one problem remains: back-facing surfaces seem to disappear (visible in 'Cubes')
Some progress with not-postprocessed OIT.
Progress with non-postprocessed OIT.
Status: compiles, but fails to work on both Adreno and Mali. Crashes the app (Adreno) or the whole system (Mali)
In Distorted.onCreate(), catch and re-throw exceptions, so that even is some Program fails to compile, others will still compile.
Standarize GLSL version across the whole library.
Correct a recently introduced bug.
Give users API to render OutputSerfaces and attached Nodes in either the 'normal' way of OIT way.
Start merging master and OIT.
Correct the way we delay FBOs in DistortedScreen.
Port the Mali flash fix to the OIT branch.
I am pretty sure this time the flashing issues on Mali T880 r12 driver are finally fixed.
The fix: a queue of FBOs render to, just like before, but this time in DistortedScreen we blit not the current FBO, but the one computed several frames ago.
This of course introduces a delay and uses more memory, but it appears to work and does not seem to have any effects on speed.
Port another commit from master.
I spoke too soon, the ARM Mali flashing is of course not fixed yet. The previous commit fixed Triblur, but the bug is still reproducible elsewhere (only in the 'postprocessed' apps though).
This commit introduces a circular queue in case of the postprocessing FBOs - with little success though.
Port a commit from the master branch.
Finally properly fix the flashing on ARM Mali T880 GPU.
The flashing is caused by a 'full pipeline flush' (see DarkPhoton, https://www.opengl.org/discussion_boards/showthread.php/200754-Flashes-on-ARM-Mali?p=1291679&viewfull=1#post1291679 ). In order to combat it, first introduce the possibility that a single DistortedOutputSurface is backed up by more than one FBO. Then make DistortedScreen be derived from DistortedFramebuffer (which itself is derived from DistortedOutputSurface) and make it contain 3 FBOs, render to them in a circular queue fashion, and blit from a given FBO to the system FBO. The 'more than 1 intermediate FBO' queue prevents the pipeline flush....
Revert last changes to the postprocessing FBO.
This reverts commit 2dbed690bdbee80d9bfb22c800073855eb5d0946.
Try and avoid re-sorting the children by buckets (if we can!). This makes change in rendering order in the 'Transparency' app actually work.
In an attempt to contain the flashes on Mali GPU, re-structure the post-processing FBOs from 1 FBO with 2 color attachments + combined depth-stencil to 2 separate FBOs sharing a depth-stencil texture.
Result: this appears to make the flashes slightly worse.
Minor
OIT: fixes for Mali: fix a broken loop in the oitRender fragment shader that resulted in flashing.
OIT: fix for 'out of memory' crash on Mali GPUs.
~The thing still does not fully work there - there are still strange flashes in apps that innvolve OIT, for example in 'Triblur'.
OIT: more fixes
OIT: fixes. Everything looks correct now except for the curious return of the 'dancing lower-left corner' small glitch in the 'Transparency' app.
OIT: move towards 4 passes ( clear - build - collapse - render )
correct oitRender again: we need to disable stencil reading and writing and restore after
correct oitRenddr again; correct coming to paused state (we could crash)
Make sure we don't create a feedback loop in oitRender
Make us read only the DEPTH part of a DEPTH24_STENCIL8 attachment.