Hi,
As you said I did'nt used the chunks :
// 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);

So it looks like that : (geo is the geometry of my object)
  outlineMat = SimpleMaterial::create();

  PolygonChunkPtr backfaceCullingChunk = PolygonChunk::create();
  beginEditCP(backfaceCullingChunk);
    backfaceCullingChunk->setCullFace(GL_FRONT);
    backfaceCullingChunk->setOffsetFill(true);
    backfaceCullingChunk->setOffsetFactor(0.4);
    backfaceCullingChunk->setOffsetBias(-10.0);
  endEditCP(backfaceCullingChunk);

  beginEditCP(outlineMat);
    outlineMat->addChunk(backfaceCullingChunk);
    outlineMat->setDiffuse(Color3f(0.5, 0.5, 0.5));
  endEditCP(outlineMat);

  beginEditCP(geo);
    geo->setMaterial(outlineMat);
  endEditCP(geo);
But it don't work, I have only a black shape.
What I would like is to have the extern border of my object drawn (the outline),
but not draw the inside part of it, so that I see the others objects behind.

Any idea?

Thanks,
Adrien

Stefano wrote:
hi,
Utils::getFile() is just a simple method i wrote to read ascii data from a file. It's not that important for the "outline" problem. You can even use SimpleMaterials instead of ChunkMaterials, if you find it easier ;)

cheers,
stefano

2007/6/29, Adrien <[EMAIL PROTECTED]>:
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...


------------------------------------------------------------------------- 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

Reply via email to