Discussion:
[Opensg-users] OpenSG 2: overriding of chunks
Johannes Brunen
2015-10-26 12:57:56 UTC
Permalink
Hello,



I'm using a MaterialChunkOverrideGroup core in my render tree in order
to define some global state. For instance, I manage clip planes in that
way. Now, I have the rather obscure situation that I need to render a
part of my tree with a material state that does not need some of the
corresponding chunks. The overriding process is currently additively
defined. Is it possible to a allow a subtractive
MaterialChunkOverrideGroup core.



To be more clear what I mean. Suppose that I have the following render
tree:



parent-tree

|

MaterialChunk-

OverrideGroup 1

|

...

|

+--------+---------+

| |

MaterialChunk- |

OverrideGroup 2 |

| |

MaterialGroup A MaterialGroup B

| |

Geometry A Geometry B



What I wish to have is that the material chunks that are defined by
MaterialChunkOverrideGroup 2 should be removed from the state chunks
defined at this place, so actually negating some of the chunks that I
have defined by MaterialChunkOverrideGroup 1.

The special behavior of MaterialChunkOverrideGroup 2 could be either
activated by an additional boolean flag, or the MCOG could take an
additional material that is subtracted when it is defined.



Is that possible and can I get some support in realizing that?



I think that beside of changing MaterialChunkOverrideGroup the parent
class ChunkOverrideGroup would have to be adapted.



Is there something that I'm missing with that?



Best,

Johannes




------------------------------------------------------------------------------
Johannes
2015-10-27 12:19:40 UTC
Permalink
Hello Gerrit and/or Carsten,
Post by Johannes Brunen
Is it possible to a allow a subtractive
MaterialChunkOverrideGroup core.
Is that possible and can I get some support in realizing that?
I have made a first implementation of what I have in mind. Attached you
can find my solution. Could you take a look at it and give me some
feedback. I would like to see something like this in OpenSG 2 :-)

Best,
Johannes

P.S.: Files.azip is just a simple zip file. I uses this extension
because the mail server filters *.zip files :-(
Carsten Neumann
2015-10-29 00:12:15 UTC
Permalink
Hello Johannes,
Post by Johannes
Post by Johannes Brunen
Is it possible to a allow a subtractive
MaterialChunkOverrideGroup core.
Is that possible and can I get some support in realizing that?
I have made a first implementation of what I have in mind. Attached you
can find my solution. Could you take a look at it and give me some
feedback. I would like to see something like this in OpenSG 2 :-)
looks good to me. I think for consistency with most of the rest of the
API (and symmetry with addOverride) it should be subOverride instead of
removeOverride.
Could you also please add a comment to the new bool removeOverride field
describing what it does.
I'm wondering if it would be better to have a separate collection of
chunks to "remove" instead of changing the semantics of the group based
on a bool flag? But given that this is driven by your needs I don't feel
strongly one way or the other :)

Cheers,
Carsten

------------------------------------------------------------------------------
Johannes
2015-11-02 10:22:09 UTC
Permalink
Post by Carsten Neumann
I think for consistency with most of the rest of the
API (and symmetry with addOverride) it should be subOverride instead of
removeOverride.
Yes, you are right.
Post by Carsten Neumann
Could you also please add a comment to the new bool removeOverride field
describing what it does.
Yes.
Post by Carsten Neumann
I'm wondering if it would be better to have a separate collection of
chunks to "remove" instead of changing the semantics of the group based
on a bool flag? But given that this is driven by your needs I don't feel
strongly one way or the other :)
Personally, I think that it would be a kind of code bloat to introduce
new classes specifically for that matter.

Below you can find the patch file and the modified source files.

Thanks for taking your time to look at this issue.

Best,
Johannes
Johannes
2015-11-09 13:00:28 UTC
Permalink
Post by Johannes
Post by Carsten Neumann
I think for consistency with most of the rest of the
API (and symmetry with addOverride) it should be subOverride instead of
removeOverride.
Yes, you are right.
Post by Carsten Neumann
Could you also please add a comment to the new bool removeOverride field
describing what it does.
Yes.
Post by Carsten Neumann
I'm wondering if it would be better to have a separate collection of
chunks to "remove" instead of changing the semantics of the group based
on a bool flag? But given that this is driven by your needs I don't feel
strongly one way or the other :)
Personally, I think that it would be a kind of code bloat to introduce
new classes specifically for that matter.
Below you can find the patch file and the modified source files.
Thanks for taking your time to look at this issue.
Best,
Johannes
------------------------------------------------------------------------------
_______________________________________________
Opensg-users mailing list
https://lists.sourceforge.net/lists/listinfo/opensg-users
ping :-)

Loading...