>> Dear All! >> >> I have a simple scene with a single geometry and material loaded from a >> VRML file >> with the SceneFileHandler class. >> I want to chnage the transparency of the object with the >> MakeTransparentGraphOp class, but unfortunatly it doesn't work >> properly for transparency values > 0 and < 1. >> (This issue has been discussed before Vol 6, Issue 47 Msg:2, without a >> solution). >> I use OpenSG 1.8. >> >> MakeTransparentGraphOp *op = new MakeTransparentGraphOp(); >> float alpha = 0.5; >> std::ostringstream str; >> str << "transparency=" << alpha; >> op->setParams ( str.str() ); >> graphOperator->addGraphOp(op); >> >> Could anyone give some hints, how to solve this problem
> hm, for me it seems to work, I just used the testSingleOp test program > (Source/System/GraphOp/testSingleOp.cpp) to make a semi-transparent tie > model (Tutorial/Data/tie.wrl). > I called the test program like this: > ./testSingleOp MakeTransparent transparency=0.5 tie.wrl tie.trans.osb > Loading the model with, e.g. testNavigator tie.trans.osb gives me > translucent tie. Could you please compare your code with the > testSingleOp program to see if there is any difference ? >> and how to >> change the sorting sequnce within a single node to get rid if the >> artefacts. > Now that is a more difficult problem which in general would require at > least polygon level depth sorting of the transparent polygons. OpenSG > does not do this, as it would be extremely slow, but depending on your > needs you can often get away with using a different blend function. If > you use one that is independent of the destination fragments the > transparency might not look as nice, but it becomes independent of the > rendering order. > Hope it helps, > Carsten Hi! Thanks for the great help. It seemed that my 1.8 OpenSG Version was too old - an update did the trick ;) Now I use the blend functions GL_ONE and GL_SRC_ALPHA, which do a good job. Robert ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ Opensg-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/opensg-users
