Hello Johannes,
On 03/06/2013 09:17 AM, Johannes Brunen wrote:
> NodeRefPtr scene = Node::create();
> GeometryRefPtr cylgeo = makeCylinderGeo( 1.4f, .3f, 8, true, true, true
> );
>
> scene->setCore(cylgeo);
> mgr = SimpleSceneManager::create();
>
> NodeRefPtr node = Node::create();
> MaterialChunkOverrideGroupRefPtr group =
> MaterialChunkOverrideGroup::create();
> node->setCore(group);
>
> SimpleMaterialRefPtr mat = SimpleMaterial::create();
> mat->setDiffuse(Color3f(1.0f, 0.0f, 0.0f));
>
> group->setMaterial(mat);
> node->addChild(scene);
>
> // tell the manager what to manage
> mgr->setWindow(gwin );
> mgr->setRoot (node);
>
> This does not work, i.e. the cylinder is not diffusely red. If I change
> the code to use the ChunkMaterial it is working fine. But the
> SimpleMaterial is kind of a ChunkMaterial. So my expectation is that the
> above code should seamlessly work. Do I expect too much here?
not sure, depends on where the commitChanges() calls (if any?) are. The
SimpleMaterial must have a chance to build the Chunks to populate the
parent ChunkMaterial. This is triggered by PrimeMaterial::changed()
(PrimeMaterial is ChunkMaterial's parent class) calling rebuildState(),
and the changed() calls are of course a side effect of commitChanges().
If there *is* a commitChanges() call in the code, this sounds like a bug
and I'll need a moment to write a test and investigate what goes wrong.
Cheers,
Carsten
------------------------------------------------------------------------------
Symantec Endpoint Protection 12 positioned as A LEADER in The Forrester
Wave(TM): Endpoint Security, Q1 2013 and "remains a good choice" in the
endpoint security space. For insight on selecting the right partner to
tackle endpoint security challenges, access the full report.
http://p.sf.net/sfu/symantec-dev2dev
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users