hi,
I tried that but I have some problem with the Utils::getFile.
What are these methods and the files, did you made them because
I can't find them in the OpenSG source...
Stefano wrote:
> hi,
> you cannot draw a single line, but you can simulate the effect using
> backface culling.. here's a tip:
>
> // all black material --> line material
> SHLChunkPtr inkSHL = SHLChunk::create();
> beginEditCP(inkSHL);
> inkSHL->setVertexProgram(Utils::getFile("ink.vert"));
> inkSHL->setFragmentProgram(Utils::getFile("ink.frag"));
> endEditCP(inkSHL);
>
> // model material -- here i wanted to archive a "toon" effect, thus
> the "posterization" :)
> SHLChunkPtr posterizeSHL = SHLChunk::create();
> beginEditCP(posterizeSHL);
> posterizeSHL->setVertexProgram(Utils::getFile("posterize.vert"));
> posterizeSHL->setFragmentProgram(Utils::getFile("
> posterize.frag"));
> endEditCP(posterizeSHL);
>
> // important!
> PolygonChunkPtr backfaceCullingChunk = PolygonChunk::create();
> beginEditCP(backfaceCullingChunk);
> backfaceCullingChunk->setCullFace(GL_FRONT);
> backfaceCullingChunk->setOffsetFill(true);
> backfaceCullingChunk->setOffsetFactor(0.4);
> backfaceCullingChunk->setOffsetBias(-10.0);
> endEditCP(backfaceCullingChunk);
>
> ChunkMaterialPtr inkMT = ChunkMaterial::create();
> beginEditCP(inkMT);
> inkMT->addChunk(inkSHL);
> inkMT->addChunk(backfaceCullingChunk);
> endEditCP(inkMT);
>
> ChunkMaterialPtr posterizeMT = ChunkMaterial::create();
> beginEditCP(posterizeMT);
> posterizeMT->addChunk(posterizeSHL);
> endEditCP(posterizeMT);
>
> // multipass --> to draw both the model and the "lines"
> MultiPassMaterialPtr mp = MultiPassMaterial::create();
> beginEditCP(mp);
> mp->addMaterial(inkMT);
> mp->addMaterial(posterizeMT);
> 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);
>
> hope this helps!
>
>
> 2007/6/28, Adrien <[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>>:
>
> Hi again,
> one more question.
>
> Is there a simple way to only draw the outline of an object?
> If a use a PolygonChunk it draws all the lines of all the triangles of
> my object§.
> I'd like to have just one line drawing the outer line of my object
> depending on
> the camera viewport.
>
> Is it possible easily?
>
> Thanks,
> Adrien
>
>
> -------------------------------------------------------------------------
> 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/
> <http://sourceforge.net/powerbar/db2/>
> _______________________________________________
> Opensg-users mailing list
> [email protected]
> <mailto:[email protected]>
> https://lists.sourceforge.net/lists/listinfo/opensg-users
>
>
>
>
> --
> Stefano Verna
> mail/gtalk: [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>
> skype: steffoz
> ------------------------------------------------------------------------
>
> -------------------------------------------------------------------------
> 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