Hi,
Is there a way to get old school flat shading when using stage3d? Seems like the opengl smooths everything out.
Thanks
Ben
Stage3D opengl : Flat shadingSoftware: Away3D 4.x |
||
highrise, Newbie
Posted: 05 April 2012 10:32 AM Total Posts: 9 Hi, Is there a way to get old school flat shading when using stage3d? Seems like the opengl smooths everything out. Thanks Ben |
||
Fabrice Closier, Administrator
Posted: 05 April 2012 10:39 AM Total Posts: 1265 [ # 1 ] Just ensure your faces are not sharing normals.
|
||
|
||
|
||
|
||
|
||
|
||
Fabrice Closier, Administrator
Posted: 05 May 2012 01:43 PM Total Posts: 1265 [ # 7 ] @highrise what you want to achieve can be done in both “exploded” or “welded” state. The problem (shape breaks) is caused by the way you loop over the vertices for your updates. In welded case, you probably need only to loop over the vertices, alter and update, while in “exploded” case, you need to ensure that vertices sharing same original state value get the same update value (probably a direction by a factor) and only once. In welded state, even if your update value would be wrong (not saying it is) the mesh surface would remain “connected”. (assuming it was connected in original state)
|
||
Neuromancer, Newbie
Posted: 07 May 2012 12:31 PM Total Posts: 2 [ # 8 ]
Many thanks for this very useful hint. That did it for me.
|
||
highrise, Newbie
Posted: 12 May 2012 04:19 PM Total Posts: 9 [ # 9 ] Thanks for the posts. I ended up Exloding a loaded .obj. Storing all of the verticles that are effectively the same point in a single Vector3D, I could then manipulate these points without the models breaking up. Sorry I don’t have the 3D jargon but happy to post code if it helps. Thanks Ben
|