jerome Posted September 7, 2015 Share Posted September 7, 2015 Hi people, Jahow fixed the old well known cylinder light reflection artifact problem by fully re-implementing it using the ribbon which now can manage well the continuity of the light reflection along curved and closed meshes. However the cylinder code is now quite complex because of the cylinder caps (caps aren't ribbon features) and after having hacked for a long time the computeNormals() method used by ribbons, I know now that it will be quite complex to support capped meshes under the ribbon. This means I will probably re-implemented again the cylinder, with continuous light reflection and correct cap normals of course, from scratch. Then only, I could have a look to the caps of the tube and the lathe (both ribbon based)... aaargg Temechon 1 Quote Link to comment Share on other sites More sharing options...
JohnK Posted September 7, 2015 Share Posted September 7, 2015 Do not know whether it is something to pursue or not but I needed a ribbon with caps. For the top cap I chose a point, A, within the polygon plane formed by the initial points of each path (easy in my case as initial points all in the xy plane and surrounding the origin) then added A to the beginning of each path. Same idea for bottom cap. Quote Link to comment Share on other sites More sharing options...
jerome Posted September 7, 2015 Author Share Posted September 7, 2015 That's just what I did for the tube actually ! and for extrusion with the barycenter of the model shape But if you are looking for better normals (or no artifact), you would probably design the plane polygon "capping" the ribbon, then would add to it some normals orthogonal to this polygon and finally merge these two meshes. This is quite simple. But if you then need to animate or morph such a capped shape, it becomes far more complex to do this 3-step operation (ribbon + polygon cap + merge) in a decent delay. That's why, for now, I decided to keep the tube caps as they are -because of the morph/animation aspect-, it is to say like you just suggested, until I can find another way to quickly compute a real independant cap with its own normals and have everything a final single global mesh. Performance over accuracy... for now The cylinder is not morphable, so we can compute dedicated caps with better normals. Wingnut and JohnK 2 Quote Link to comment Share on other sites More sharing options...
JohnK Posted September 8, 2015 Share Posted September 8, 2015 Should have know the master had it covered Wingnut 1 Quote Link to comment Share on other sites More sharing options...
jerome Posted September 8, 2015 Author Share Posted September 8, 2015 Quote Link to comment Share on other sites More sharing options...
jerome Posted September 8, 2015 Author Share Posted September 8, 2015 working on it ... Quote Link to comment Share on other sites More sharing options...
jerome Posted September 9, 2015 Author Share Posted September 9, 2015 done it was far more difficult than I expected initially, pffeww So, now (once it will be merged), the Cylinder doesn't use any longer either ribbons, either computeNormals(), but a dedicated normal computation, so it avoids the tiny normal artifacts that might appear on edges.I guess noone until now even noticed them note : I kept Jahow's cylinder cap implementation Ahiru and Wingnut 2 Quote Link to comment Share on other sites More sharing options...
jahow Posted September 9, 2015 Share Posted September 9, 2015 Thanks Jerome well done. Did you implement the side parameter ? Quote Link to comment Share on other sites More sharing options...
jerome Posted September 9, 2015 Author Share Posted September 9, 2015 ourgforgottenI do it right now Quote Link to comment Share on other sites More sharing options...
jerome Posted September 9, 2015 Author Share Posted September 9, 2015 commit donethanks Jahow jahow and iiceman 2 Quote Link to comment Share on other sites More sharing options...
jerome Posted September 11, 2015 Author Share Posted September 11, 2015 the reason of the reimplementation without computeNormals : http://www.html5gamedevs.com/topic/17040-the-mystery-of-computenormals/?p=95871 Wingnut 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.