Hi,
thanks, I tried this way, now I see the outline of my object :
http://farm2.static.flickr.com/1295/715403834_b2cb845d85.jpg?v=0
But there's still one problem, inside this outline, it's drawn in black
(or any color) by
modelMt :
SimpleMaterialPtr modelMT = SimpleMaterial::create();
modelMT->setDiffuse(Color3f(0,0,0));
And if instead of this material I put a transparent one, then I have all
the shape in green
due to the inkSHL chunk.
Is there any way to have the outline drawn, and the part inside the
contour transparent?
Regards,
Adrien
Stefano wrote:
> Hi Adrien,
> here i'm posting you the full node.. hope this can helps:
>
> NodePtr Effects::makeScene() {
>
> SHLChunkPtr inkSHL = SHLChunk::create();
> beginEditCP(inkSHL);
> inkSHL->setVertexProgram("void main(void) {gl_Position =
> gl_ModelViewProjectionMatrix * (gl_Vertex + vec4(0.05 * gl_Normal,
> 0.0));}");
> inkSHL->setFragmentProgram("void main(void){gl_FragColor =
> vec4(0,0,0,1);}");
> endEditCP(inkSHL);
>
> PolygonChunkPtr backfaceCullingChunk = PolygonChunk::create();
> beginEditCP(backfaceCullingChunk);
> backfaceCullingChunk->setCullFace(GL_FRONT);
> endEditCP(backfaceCullingChunk);
>
> ChunkMaterialPtr inkMT = ChunkMaterial::create();
> beginEditCP(inkMT);
> inkMT->addChunk(inkSHL);
> inkMT->addChunk(backfaceCullingChunk);
> endEditCP(inkMT);
>
> SimpleMaterialPtr modelMT = SimpleMaterial::create();
> beginEditCP(modelMT);
> modelMT->setDiffuse(Color3f(1,0,0));
> endEditCP(modelMT);
>
> MultiPassMaterialPtr mp = MultiPassMaterial::create();
> beginEditCP(mp);
> mp->addMaterial(inkMT);
> mp->addMaterial(modelMT);
> endEditCP(mp);
>
> MaterialGroupPtr mg = MaterialGroup::create();
> beginEditCP(mg);
> mg->setMaterial(mp);
> endEditCP(mg);
>
> NodePtr n = Node::create();
> beginEditCP(n);
> n->setCore(mg);
> n->addChild(SceneFileHandler::the().read( "dinopet.3ds" ));
> endEditCP(n);
>
> return n;
> }
> ------------------------------------------------------------------------
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by DB2 Express
> Download DB2 Express C - the FREE version of DB2 express and take
> control of your XML. No limits. Just data. Click to get it now.
> http://sourceforge.net/powerbar/db2/
> ------------------------------------------------------------------------
>
> _______________________________________________
> Opensg-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/opensg-users
>
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users