Excerpts from Jesse van den Kieboom's message of Thu Dec 23 10:28:11 +0000 2010: > Hello everyone,
Hi Jesse, sorry for the delay in replying to you; a lot of us have been on holiday of christmas. > > I'm very new to clutter and I'm having some questions related to what I > would like to do with it (but don't know what would be the best way to > do it). > > What I would like to do is to make an actor which renders some kind of > 3d scene/geometry using cogl. As I understand this is quite simple with > the VBO support in cogl. What I do not directly understand is if and how > it is possible to change the projection and modelview of the geometry > that I render. Is it correct that I can consider an actor as a sort of > viewport in which I could render my 3d geometry, or is that not really > how it works? As well as the CoglVertexBuffer API you may be interested in playing with the experimental CogelVertexArray/CoglVertexAttribute/CoglPrimitive APIs (Certainly we'd love to get feedback for these APIs since we found some limitations of the original CoglVertexBuffer design which these APIs are meant to improve on) You have to define COGL_ENABLE_EXPERIEMENTAL_API to access it. If you want more details about this API feel free to ask and I'll try to help (It's not yet well documented). Cogl associates a viewport transform, projection matrix and modelview matrix-stack with each framebuffer. The framebuffer can either be the onscreen framebuffer that is created by Clutter or offscreen framebuffers created via cogl_offscreen_new_to_texture(). If you are creating your own offscreen framebuffers then you are completely free to control the viewport, projection and modelview transforms via cogl_set_viewport, cogl_set_projection_matrix and cogl_set_modelview_matrix. Since we maintain a stack of matrices for the modelview you have operations like cogl_push/pop_matrix() and also there are convenience functions like cogl_rotate and cogl_translate that can be used to modify the top matrix. For the projection there are convenience functions cogl_ortho and cogl_frustum for defining orthographic or perspective projections respectively. One convenience we are missing is cogl_lookat (like gluLookAt which would be a useful addition at some point.) > > My second question is how I could achieve an antialiasing effect for 3d > geometry. As I understand, cogl/clutter does currently not support > directly opengl multisampling. I also read that the proposed solution is > to use supersampling. My question is now what the best way would be to > achieve this. Ideally I would like to implement some kind of generic > actor that automatically does this for whatever is inside, or if > possible implement this as some kind of ClutterEffect. Antialiasing with GPUs is a very thorny subject, there are so many different approaches with different pros and cons for different situations (typically with performance vs quality tradeoffs) At some point we will no doubt expose multisampling - probably by default even - in Clutter which would be one useful approach when supported by the hardware. Supersampling can look good but it is quite expensive. If you search the mailinglist I think one outline for manually implementing this has been described before. Also I'm fairly sure Chris Lord once implemented a supersampling actor of some kind though I don't know if that code landed in Mx or if it's just on his laptop. Writing a supersampling CluterEffect would probably be the way to go if you want to use this technique. It would probably even be worthwhile having in Clutter proper. There is currently some progress being made on separating Clutter and Cogl into separate libraries and as part of that work the GL window system parts of the Clutter backends are moving down into Cogl. My hope is that we'll expose multisampling as part of this work. In the shorter term though someone could look at patching e.g the glx clutter backend to try looking for multisampling config when creating a context. The only fiddly bit I think will be ensuring multisampling is disabled when picking. I hope that helps, kind regards, - Robert > > > Jesse _______________________________________________ clutter-app-devel-list mailing list [email protected] http://lists.clutter-project.org/listinfo/clutter-app-devel-list
