It looks like you just want a cartoony effect by drawing a big black line around your mesh. Why not use useOwnContainer and then add a GlowFilter to it's container with black and strength at 100?<br><br><div class="gmail_quote">
2008/12/1 Boris Munser <span dir="ltr"><<a href="mailto:boris@unvoll.com">boris@unvoll.com</a>></span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
I'm trying to create a new papervision material for my needs: OutlineMaterial (not only a silhouette).<br>
what I did:<br>
- added Boolean var "culledOnLastframe" to Vertex3D.as<br>
- duplicated and modified WireframeMaterial.as to OutlineMaterial.as<br>
modifications of OutlineMaterial:<br>
override public function drawTriangle(face3D:Triangle3D, graphics:Graphics, renderSessionData:RenderSessionData, altBitmap:BitmapData = null, altUV:Matrix = null):void<br>
{<br>
//linewidth based on face parent screenZ:........<br>
distToCam = face3D.Instance.screenZ;<br>
lineWidth = Math.min( Math.max(1000/distToCam, 1), 3);<br>
graphics.lineStyle( lineWidth, lineColor, lineAlpha );<br>
<br>
if( face3D.v0.culledOnLastframe && face3D.v1.culledOnLastframe )<br>
{<br>
graphics.moveTo( face3D.v0.vertex3DInstance.x, face3D.v0.vertex3DInstance.y );<br>
graphics.lineTo( face3D.v1.vertex3DInstance.x, face3D.v1.vertex3DInstance.y );<br>
<br>
}<br>
if( face3D.v1.culledOnLastframe && face3D.v2.culledOnLastframe )<br>
{<br>
graphics.moveTo( face3D.v1.vertex3DInstance.x, face3D.v1.vertex3DInstance.y );<br>
graphics.lineTo( face3D.v2.vertex3DInstance.x, face3D.v2.vertex3DInstance.y );<br>
}<br>
if( face3D.v2.culledOnLastframe && face3D.v0.culledOnLastframe )<br>
{<br>
graphics.moveTo( face3D.v2.vertex3DInstance.x, face3D.v2.vertex3DInstance.y );<br>
graphics.lineTo( face3D.v0.vertex3DInstance.x, face3D.v0.vertex3DInstance.y );<br>
}<br>
//renderSessionData.renderStatistics.triangles++;<br>
graphics.moveTo( face3D.v0.vertex3DInstance.x, face3D.v0.vertex3DInstance.y );<br>
graphics.lineStyle();<br>
<br>
}<br>
<br>
- changed TriangleMash3D.as "project" function to set all vertices' culledOnLastframe.value to false before render<br>
- within modified TriangleMash3D.as, all faces' vertices are set to culledOnLastframe=true if culled;<br>
<br>
Result: <a href="http://unvoll.com/schrottplatz/outlineshaderwoes.jpg" target="_blank">http://unvoll.com/schrottplatz/outlineshaderwoes.jpg</a><br>
<br>
- what you see there is a compositeMaterial (bitmap+OutlineMaterial)...<br>
- what the material does: draw lines between everly vertex of a TriangleMesh3D which is part of a triangle that was culled during the last rendering process...<br>
- the problem is the BAD lines that are drawn when there is not enough geometry between opposite edges of the lowpoly mesh (a well-subdivided sphere would render fine because of a "notCulled" vertex avoiding the linedraw)<br>
- I'm trying to keep this cheap on calculations. (thinking of vertex.connectedFaces.dictionary..compare, diff vertex face.normals to camera normal.. ouch)<br>
- how can I "cull" the BAD lines?<br>
- am I missing something?<br>
<br>
I.m stuck,<br>
Boris<br>
<br>
<br>
-<br>
<br>
<br>
<br>
<br>
<br>
<br>
_______________________________________________<br>
Papervision3D mailing list<br>
<a href="mailto:Papervision3D@osflash.org" target="_blank">Papervision3D@osflash.org</a><br>
<a href="http://osflash.org/mailman/listinfo/papervision3d_osflash.org" target="_blank">http://osflash.org/mailman/listinfo/papervision3d_osflash.org</a><br>
</blockquote></div><br>