Merge lp:~smspillaz/compiz/compiz.animationaddon-returns into lp:compiz/0.9.12
| Status: | Merged |
|---|---|
| Approved by: | Marco Trevisan (Treviño) on 2016-06-28 |
| Approved revision: | 4030 |
| Merged at revision: | 4062 |
| Proposed branch: | lp:~smspillaz/compiz/compiz.animationaddon-returns |
| Merge into: | lp:compiz/0.9.12 |
| Diff against target: |
1931 lines (+594/-428) 27 files modified
debian/compiz-dev.install (+1/-0) debian/compiz-plugins.install (+2/-0) debian/compiz-plugins.install.armel (+2/-0) debian/compiz-plugins.install.armhf (+2/-0) plugins/CMakeLists.txt (+0/-1) plugins/animation/include/animation/animeffect.h (+5/-2) plugins/animation/include/animation/grid.h (+0/-1) plugins/animation/include/animation/multi.h (+19/-9) plugins/animation/src/animation.cpp (+17/-24) plugins/animation/src/glide.cpp (+1/-1) plugins/animation/src/grid.cpp (+0/-6) plugins/animation/src/private.h (+1/-1) plugins/animationaddon/CMakeLists.txt (+1/-4) plugins/animationaddon/include/animationaddon/animationaddon.h (+17/-11) plugins/animationaddon/src/airplane.cpp (+47/-36) plugins/animationaddon/src/animationaddon.cpp (+2/-2) plugins/animationaddon/src/dissolve.cpp (+11/-2) plugins/animationaddon/src/particle.cpp (+52/-40) plugins/animationaddon/src/polygon.cpp (+259/-250) plugins/animationaddon/src/private.h (+3/-2) plugins/opengl/include/opengl/matrix.h (+27/-0) plugins/opengl/include/opengl/opengl.h (+6/-0) plugins/opengl/include/opengl/vertexbuffer.h (+20/-2) plugins/opengl/src/paint.cpp (+1/-10) plugins/opengl/src/privatevertexbuffer.h (+6/-2) plugins/opengl/src/vertexbuffer.cpp (+77/-22) plugins/opengl/src/window.cpp (+15/-0) |
| To merge this branch: | bzr merge lp:~smspillaz/compiz/compiz.animationaddon-returns |
| Related bugs: |
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Marco Trevisan (Treviño) | Approve on 2016-06-28 | ||
| Eleni Maria Stea | 2016-05-23 | Approve on 2016-05-26 | |
| PS Jenkins bot | continuous-integration | Pending | |
|
Review via email:
|
|||
Commit Message
animationaddon: Port the animationaddon plugin to use modern GL API.
This involved a lot of changes:
- Removal of glPush/glPop. State is assumed to be off in newer versions
of compiz, so switch off whatever gets switched on.
- Switch from glVertexPointer
- Changes in primitive assembly: GL_POLYGON doesn't exist in GLES
so switch to using GL_TRIANGLES. This meant that the indices
for all the animatons needed to be re-tesselated. That was done
by hand using a winding rule which just duplicates the first and
third vertex around the fourth.
- Dropping of glTexEnv calls.
- Reworking of the depth test, since writes to the depth buffer
have been disabled by default.
Description of the Change
animationaddon: Port the animationaddon plugin to use modern GL API.
This involved a lot of changes:
- Removal of glPush/glPop. State is assumed to be off in newer versions
of compiz, so switch off whatever gets switched on.
- Switch from glVertexPointer
- Changes in primitive assembly: GL_POLYGON doesn't exist in GLES
so switch to using GL_TRIANGLES. This meant that the indices
for all the animatons needed to be re-tesselated. That was done
by hand using a winding rule which just duplicates the first and
third vertex around the fourth.
- Dropping of glTexEnv calls.
- Reworking of the depth test, since writes to the depth buffer
have been disabled by default.
Some things still don't work:
- Anything depending on clipping planes: glClipPlane and friends
were removed on GLES20 and they are quite difficult to implement
using other methods.
- Drawing of decoration textures - these appear to be stretched
and skewed incorrectly.
- Lighting. This will require special shaders.
| Sam Spilsbury (smspillaz) wrote : | # |
Thanks for the review and for the catch!
| Sam Spilsbury (smspillaz) wrote : | # |
Do you have any ideas as to how we could re-implement clipping planes? I remember when I did it for the expo plugin we had to resort to using the stencil buffer which feels like overkill.
| Eleni Maria Stea (hikiko) wrote : | # |
I believe you mean clipping that is gles2 compatible. I needed that for the 3d windows but never had the time to implement it properly. Here's the shader you can use (look at the 3d.cpp) It's tested and it works well:
How it works:
The trick is done in the pixel shader. You first calculate which pixels would be clipped if you could support clipping and then you discard them in the pixel shader.
The reason I never merged that change was that compiz shader class needed some additions before it works. https:/
It will be great if you have the time to get a look at it and make compiz use the shader because many plugins will work in ES2! (+thanks a lot!!! :D)
| Sam Spilsbury (smspillaz) wrote : | # |
Interesting. That's the other solution that I've seen posted in various places online. I guess if you have to discard individual fragments then its going to be just as expensive or more expensive than using the stencil buffer (though I suppose using the stencil buffer means that the pipeline is blocked on the stencil buffer update).
| Marco Trevisan (Treviño) (3v1n0) wrote : | # |
Ah, even for this please, include animationaddons in debian/
| Eleni Maria Stea (hikiko) wrote : | # |
The stencil buffer is used for 2d clipping, to achieve a visual result similar to the glScissors. We usually use it when we need to clip more complex 2d shapes than those that Scissors can clip.
The shaders above perform clipping in 3d space (to clip some garbage around the rotating 3d cube for example).
I don't know if the pipeline is blocked during the update, to be honest. The redbook says that "clearing the buffer is one of the most expensive operations", though.
So, the decision depends on the visual result you want to achieve: you need 2d or 3d clipping? are your shapes so complex that you really need to make use of the stencil buffer?
Also, note that the 3d clipping in the shaders above might be a bit slow in some opengl implementations (but it's fine for most cases).
| Sam Spilsbury (smspillaz) wrote : | # |
> The stencil buffer is used for 2d clipping, to achieve a visual result similar
> to the glScissors. We usually use it when we need to clip more complex 2d
> shapes than those that Scissors can clip.
>
> The shaders above perform clipping in 3d space (to clip some garbage around
> the rotating 3d cube for example).
>
> I don't know if the pipeline is blocked during the update, to be honest. The
> redbook says that "clearing the buffer is one of the most expensive
> operations", though.
>
> So, the decision depends on the visual result you want to achieve: you need 2d
> or 3d clipping? are your shapes so complex that you really need to make use of
> the stencil buffer?
For the expo plugin we were able to get away with 2D clipping. I imagine that for the 3D windows plugin you needed 3D clipping for instance.
I'm actually not sure why animationaddon used clip planes. I suspect clip planes may have fixed the issues I was seeing with decorations being rendered incorrectly during polygon animations.
>
> Also, note that the 3d clipping in the shaders above might be a bit slow in
> some opengl implementations (but it's fine for most cases).
Indeed - I remember that was my main concern as I looked into doing something similar for expo - it was going to be an additional fragment shader pass with a loop and if statements (quite slow at the time!)
| Sam Spilsbury (smspillaz) wrote : | # |
> Ah, even for this please, include animationaddons in debian/compiz-
> plugins.install now that is built by default
Done - (though there's going to be "conflicts, conflicts everywhere" after three plugins starting with animation* are merged in ;-))
| Eleni Maria Stea (hikiko) wrote : | # |
sorry, I think top approved the branch before the 4024 change...
| Marco Trevisan (Treviño) (3v1n0) wrote : | # |
Ouch, some problems when building the debian package.
Please apply this: http://
| Sam Spilsbury (smspillaz) wrote : | # |
Ah, thanks - I'll apply it ASAP.
Are the CI bots for merge requests disabled at the moment?
| Marco Trevisan (Treviño) (3v1n0) wrote : | # |
Yeah, CI has to be reimplemented in a different way, but I'm not sure this will happen for the unity7 stack, since we've to prioritize the new one.
| Marco Trevisan (Treviño) (3v1n0) wrote : | # |
Better, but we still fail in armhf as this doesn't build there for missing dependency.
Can you please get rid of the lines in debian/
Sorry for the hassle, but... You know :)
| Sam Spilsbury (smspillaz) wrote : | # |
Heh, no worries.
This should work fine on GLES, though as it turns out gluProject isn't available there. I've re-implemented the same thing in matrix.h and removed the dependency, so it should compile fine this time.
- 4026. By Sam Spilsbury <email address hidden> on 2016-06-01
- 4027. By Sam Spilsbury <email address hidden> on 2016-06-01
-
animationaddon: Completely remove clip planes
(Until a different solution can be found)
- 4028. By Sam Spilsbury <email address hidden> on 2016-06-04
-
animationaddon: Don't use glClearDepth on GLES (use glClearDepthf)
| Sam Spilsbury (smspillaz) wrote : | # |
Marco - I've added a new commit and done a local build-test with BUILD_GLES. Hopefully this should pass ci-train now. Sorry about that hassle!
| Marco Trevisan (Treviño) (3v1n0) wrote : | # |
Not sure why this includes 'plugins/
| Marco Trevisan (Treviño) (3v1n0) wrote : | # |
Hey, can you check these set of branches again? I'd like them to be merged...
I can do that if you're busy.
| Sam Spilsbury (smspillaz) wrote : | # |
Yeah I was going to have a look at them yesterday and ran out of time.
I'll take a look today. Sorry about the breakage!
Sam.
On 21 Jun 2016 02:40, "Marco Trevisan (Treviño)" <mail@3v1n0.net> wrote:
> Hey, can you check these set of branches again? I'd like them to be
> merged...
>
> I can do that if you're busy.
> --
>
> https:/
> You are the owner of lp:~smspillaz/compiz/compiz.animationaddon-returns.
>
| Sam Spilsbury (smspillaz) wrote : | # |
That should fix the issue
| Sam Spilsbury (smspillaz) wrote : | # |
Yay! I guess I need to update the .install files for the other branches too?
On Tue, Jun 28, 2016 at 9:34 AM, Marco Trevisan (Treviño)
<mail@3v1n0.net> wrote:
> The proposal to merge lp:~smspillaz/compiz/compiz.animationaddon-returns into lp:compiz has been updated.
>
> Status: Needs review => Approved
>
> For more details, see:
> https:/
> --
> You are the owner of lp:~smspillaz/compiz/compiz.animationaddon-returns.
--
Sam Spilsbury


good work! but you missed an else in one of your render functions (see comment in the code), you either use glDrawArrays or glDrawElements.