Wireframe shader

Software: Away3D 4.x

Avatar
Luca, Sr. Member
Posted: 30 July 2013 01:41 PM   Total Posts: 230   [ # 16 ]

for example:
http://en.wikipedia.org/wiki/Altitude_(triangle)

 

   

John Brookes, Moderator
Posted: 30 July 2013 01:43 PM   Total Posts: 732   [ # 17 ]

The way I see it. (May be wrong)

private function vertexToEdgeDistance(v1:Vector3Dv2:Vector3Dv3:Vector3D) : Number
{
 
var vA:Vector3D v2.subtract(v1);
 var 
vB:Vector3D v3.subtract(v1);
 var 
vC:Vector3D v3.subtract(v2);
 return 
vA.crossProduct(vB).length vC.length;
}


a0 
vertexToEdgeDistance(Vertex1Vertex2Vertex3);
b0 vertexToEdgeDistance(Vertex2Vertex1Vertex3);
c0 vertexToEdgeDistance(Vertex3Vertex1Vertex2); 

That then makes the edge thickness of the triangle sides equal for any triangle and thickness.

 

   

Avatar
Luca, Sr. Member
Posted: 30 July 2013 01:55 PM   Total Posts: 230   [ # 18 ]

Hey seems to be really ok…

Thanks for your help ... John

Now we have a Wireframe shader smile

but…

 

   

Avatar
Luca, Sr. Member
Posted: 30 July 2013 02:00 PM   Total Posts: 230   [ # 19 ]

Hey, you have read right…. raspberry

 

   

Avatar
Luca, Sr. Member
Posted: 30 July 2013 02:01 PM   Total Posts: 230   [ # 20 ]

I love you smile !!!!

 

   

Avatar
Luca, Sr. Member
Posted: 30 July 2013 02:05 PM   Total Posts: 230   [ # 21 ]

You publish the right ( corrected ) source ?

 

   

beers, Member
Posted: 30 July 2013 07:22 PM   Total Posts: 53   [ # 22 ]

Does this wireframe shader actually work in away3d? If so…AWESOME! 

I hope this shader (and the method that auto creates the extra vertex distance buffer) can be included in the next release of Away3D.

I’ll keep my fingers crossed,
beers

 

   

Avatar
Luca, Sr. Member
Posted: 31 July 2013 06:00 AM   Total Posts: 230   [ # 23 ]

Hi beers smile

Since Away3D must always work ... smile

Have you tested this shader with complex geometries, different camara distance, ecc
( today i will try debugging it with NVidia Shader Debugger or http://software.intel.com/en-us/articles/igpa-getting-started-guide-for-windows or PIX ) ?

I hope you have time the help us like JohnBrookes ( thanks again ) that have correct my erronous interpretation of the formula that give the distance between vertex and opposite edge of the triangle in question.

The thickness of the line seem to be ok.
The color also.

This method comes from NVidia, and, this is frome the original NVidia paper:

The method was presented in the SIGGRAPH 2006 sketch “Single-Pass Wireframe Rendering”

http://www.scratchapixel.com/

Do you whant to be a beta tester ? I enjoy smile

 

   

Avatar
Luca, Sr. Member
Posted: 31 July 2013 07:46 AM   Total Posts: 230   [ # 24 ]

PIX “attached” to Flash Player Debugger:

http://northwaygames.com/?p=1109

http://tomtech999.wordpress.com/2011/09/07/debugging-directx-applications-with-pix-for-windows/

https://www.youtube.com/watch?v=lRQyMEF1W50

 

   

Avatar
Luca, Sr. Member
Posted: 31 July 2013 08:44 AM   Total Posts: 230   [ # 25 ]

Intel GPA “attached” to Flash Player Debugger:

 

   

Avatar
Luca, Sr. Member
Posted: 31 July 2013 01:12 PM   Total Posts: 230   [ # 26 ]

damn, damn, damn, GEOMETRY SHADER WHERE ARE YOU ?

http://www.adobe.com/devnet/flashplayer/articles/vertex-fragment-shaders.html

 

   

Avatar
Luca, Sr. Member
Posted: 02 August 2013 07:27 AM   Total Posts: 230   [ # 27 ]

No one has taken a look in the folder PB ?

Away3D\pb

....

hey we have Pixel Bender…

i’m working on Games maker AWD Exporter but what do you think .... ?

 

   
   
‹‹ CrystalAtf

X

Away3D Forum

Member Login

Username

Password

Remember_me



X