Thanks for the answers.
Obviously every answer contains inside at least another question,
so...
so i'll get down into business:
1) I was very interested hearing about Functors. It looks like they are
the facilities i was looking for. Now the question is simple: where can
i find some paper explaining how to manage the functors? As for now i've
just found some little examples in the tutorial 09, traversegraph.cpp.
I am especially interested about the possibility of customizing the
rendering pipeline for every mesh i display. I meant that when i talked
about specifying "custom parameters". For example, if i want to use a
dynamic reflection cubemap, i want to be able to tell in the functor
that i need additional rendering passes *just* for the interested
meshes. I don't think i can be clearer than this.
2) i'd like to set up a small material library, using GLSL also shaders.
I planned about building the materials ad hoc over the shader, but for
doing that i need to pass from the MaterialChunk to the SHLChunkPtr the
various parameters. Is there a way to shrink those parameters inside the
material chunks?
A little example: think that i want a non perfectly reflective material,
and i want to be able of manipulating the reflectancy of the mesh. In my
shader i need to have an external parameter, called "reflectivity" that
tells my card how to mix the reflection with the diffuse color. Usually
i'd set up a real32 value and then i'd tell OSG something like
shl->setUniformParameter("reflectivity", reflectivity). Is there a way
to put that inside the material so i'll have the latter call in the form
of shl->setUniformParameter("reflectivity", MyCMaterial->reflectivity)?
Il ven, 2004-09-17 alle 13:15, Carsten Neumann (D. Stricker) ha scritto:
> Hi Enrico,
>
> I'll first make some comments on how OpenSG handles rendering in general:
> The central is the RenderAction (Source/System/Action/RenderAction) that
> holds the necessary state and builds the so called DrawTree while it
> traverses the scenegraph. To allow for high flexibility & extendability
> the RenderAction more or less knows nothing about the different NodeCore
> types, but instead these register (in their ::initMethod() usually)
> Functors with the Action and these are called when a node with a node
> core of the respective type is encountered. The Functors contain code
> that "does the right thing" for the type of node core - often it
> suffices to call some helper methods of the RenderAction.
> After the scenegraph traversal the built DrawTree (it's intended to
> minimize state (especially material) changes) is rendered.
> Enrico Borrione wrote:
> > hiya all,
> > this sunny morning I came up with more questions about OpenSG:
> >
> > 1) is there a callback function that is called every time an object is
> > displayed? It could be handy to supply the OGL pipeline with some custom
> > parameters.
>
> Hm, you can register a Functor with the RenderAction, but what do you
> mean by passing "custom parameters" ? If you want to change some OGL
> state that's not covered by an existing StateChunk, you could add one of
> these.
>
> > 2) how many texture units does OpenSG supports for every material?
> >
> > 3) how may vertex stream does OpenSG supports? I'd like to pass to my
> > shaders the tangent, normal, binormal stuff and i was trying to find a
> > *smart* way to do the trick.
>
> sorry, somebody else will have to jump in with answers here.
>
> > even if i know I should become soon a pain, i re-post my latest
> > (unanswered) questions:
> >
> > 1_bis) how many rendering passes supports OpenSG? I mean like the good
> > ole multi-texturing tecnique that required two different renderings on
> > the same target with different alphas...
>
> sorry for answering this late. As long as you mean passes over a single
> object, you can do as many as you like inside the Functor called by
> RenderAction. If on the other hand, you want multiple passes over a
> subtree, then there is no direct support with the current Actions and
> I'm not sure if it can be done with trickery.
> I'm working on a replacement for the Actions and just added the ability
> to have multiple passes over a subtree - testing is about to start right
> away.
>
> > 2_bis) The rendering pipeline can be customized to satisfy some
> > application request? For example: i want my app to support dynamic
> > shadows, for some meshes, so i need to pilot the rendering cycle
> > depending on the geometry processed.
>
> Hm, I don't think I can answer this without more details on what you
> mean by "piloting the render cycle". There are a number of ways to
> influence rendering, but usually there are limitations as well, as the
> Actions (new and old) should be fast in the general case, while still
> supporting most corner cases...
>
> Regards,
> Carsten
>
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170
> Project Admins to receive an Apple iPod Mini FREE for your judgement on
> who ports your project to Linux PPC the best. Sponsored by IBM.
> Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php
> _______________________________________________
> Opensg-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/opensg-users
-------------------------------------------------------
This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170
Project Admins to receive an Apple iPod Mini FREE for your judgement on
who ports your project to Linux PPC the best. Sponsored by IBM.
Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users