Re: [Cogl] Using Clutter color paint node with cogl primititives ignores depth test



Hi Reza,

I'm afraid we only ever aimed to provide backwards compatibility for
cogl_set_depth_test_enabled() not forwards compatibility for using it
in conjunction with new drawing apis like the primitives api. When we
flush the state for drawing primitives we have an internal flag that
says to ignore "legacy state" which includes the global depth testing
state that you are trying to use.

I'm afraid it's only possible to draw rectangles using that state,
which is all that was possible up until the point that we deprecated
that api.

If you have access to the CoglPrimitive itself then you can setup the
depth state via the cogl_depth_state_ api and
cogl_pipeline_set_depth_state()

You should maybe also be aware that Clutter was never really designed
with depth-testing use cases in mind so you may hit some other gotchas
intermixing primitives with depth testing with Clutter's usual
rendering.

good luck,
Robert


On Thu, Nov 14, 2013 at 7:23 PM, Reza Ghassemi <reza robin1 gmail com> wrote:
Hi,
We wanted a color gradient actor so we added a new implementation of
ClutterContent.  In its paint_content routine, it creates a
ClutterColorNode, then creates a CoglPrimitive of a triangle strip with the
desired colors at the vertices and adds the primitive to the paint node.

This works fine in most cases.  However when cogl_set_depth_test_enabled is
set to true (yes, I know this is the deprecated call now, but it was written
with an older version of cogl) and other actors are in front of the actor
with the gradient, the gradient content shows on top ignoring the depth.
Note that I am using the COGL_EXPERIMENTAL_API here.

Does anyone know why this is happening or what I'm doing wrong or how to fix
this problem?

Thanks,

Reza


_______________________________________________
Cogl mailing list
Cogl lists freedesktop org
http://lists.freedesktop.org/mailman/listinfo/cogl



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]