Hi Frederik,
Frederik Didden wrote:
> Hi,
>
> I've got 2 viewports in my application. One of them covers the entire
> window, the other only covers a small portion of the screen. Is it possible
> to make the small viewport transparent, so it inherits the background of
> its
> "parent"?
do you want the background to be fully transparent or do you want
translucency ? In the former case you can use a PassiveBackground which
does clear neither frame nor depth buffer - to only clear the depth
buffer there is DepthClearBackground. For translucency your
PolygonBackground should do the trick.
> I've tried to set a PolygonBackground on the small viewport with a
> transparent material, but I get this runtime error during execution:
>
> WARNING: PolygonBackground::clear: positions and texcoords have
> different/invalid sizes (0 vs. 0)!
the PolygonBackground wants to draw a single polygon so you need to
specify some positions (and tex coords) for it. Since you want the
polygon to fill the whole port, I guess using
beginEditCP(pb, PolygonBackground::PositionsFieldMask);
pb->getPostions().push_back(Vec2f(0.0f, 0.0f));
pb->getPostions().push_back(Vec2f(1.0f, 0.0f));
pb->getPostions().push_back(Vec2f(1.0f, 1.0f));
pb->getPostions().push_back(Vec2f(1.0f, 1.0f));
endEditCP(pb, PolygonBackground::PositionsFieldMask);
and something similar for tex coords should result in the whole viewport
being filled with the material.
Hope it helps,
Carsten
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users