Hi,
I am wondering if separating a ChunkMaterial into two parts might be possible:
The first containing a SimpleSHLChunk for several childs:
OSG::SimpleSHLChunkUnrecPtr shl = OSG::SimpleSHLChunk::create();
shl->setVertexProgram (_vp_program);
shl->setFragmentProgram(_fp_program);
// common parameters:
shl->addUniformVariable("texScale0",
OSG::Vec2f(1.0f/OSG::Real32(numTiles), 1.0f/OSG::Real32(numTiles)));
shl->addUniformVariable("texScale1", OSG::Vec2f(1.0f, 1.0f));
// uniform sampler2D
shl->addUniformVariable("tex_alpha", 0);
shl->addUniformVariable("tex_ground", 1);
shl->addUniformVariable("tex_detail1", 2);
shl->addUniformVariable("tex_height", 3);
shl->addUniformVariable("tex_gradient", 4);
and a second containing special variables (scalings, coords) for a specific
child node:
OSG::SimpleSHLVariableChunkUnrecPtr shlparam =
OSG::SimpleSHLVariableChunk::create();
shlparam->addUniformVariable("texOrigin0",
OSG::Vec2f(tx/OSG::Real32(numTiles),ty/OSG::Real32(numTiles)));
shlparam->addUniformVariable("tileCoord", OSG::Pnt2f(tx, ty));
shlparam->addUniformVariable("tileOrigin", OSG::Pnt2f(-skySize, -skySize));
shlparam->addUniformVariable("decimate", 10.0f);
Is this possible or intended with an ChunkOverrideGroup containing the first?
Does it have benefits to do so?
Thanks,
Christoph
--
Empfehlen Sie GMX DSL Ihren Freunden und Bekannten und wir
belohnen Sie mit bis zu 50,- Euro! https://freundschaftswerbung.gmx.de
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users