|
From: SourceForge.net <no...@so...> - 2004-03-01 21:33:26
|
Bugs item #907855, was opened at 2004-03-01 21:21 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=442052&aid=907855&group_id=45158 Category: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: Dair Grant (grantd) Assigned to: Nobody/Anonymous (nobody) Summary: TriMesh shading wrong when no vertex UVs are present Initial Comment: (note, this issue could also be solved by bug 907849, as any triangles that shared vertex attributes would push us onto the break-down-and-push-into-tribuffer path) -------------- When rendering a TriMesh with no vertex UVs in Quesa 1.6d16, the shading is interpolated across each triangle, as if we had vertex normals. The correct appearance would be for each triangle to have a uniform shading, for a faceted appearance. See attached sample 3DMF and picture showing the result in QD3D and Quesa. -------------- OK, had a quick look at this. The problem is that the triangles in the TriMesh share vertices, and we don't correctly handle the case where a shared vertex inherits different values from the triangles which reference it. The model was of a box, so if you consider two of the top/face triangles like: /| | V_______ | / | ---| \ | I.e., on triangle on the top of the box whose normal points up, and one triangle on the side of the face whose normal points out. What happens at the moment is that when we're looking for the normal for V, we check to see if V specifies it. It doesn't, so we pick the first triangle which references V and use its normal. This then means that when the second triangle is rendered, it also references V and so ends up with the wrong normal (which produces the smoothed off effect). The general way to handle this is to introduce new vertices into the TriMesh when we see that shared vertices have different parents - it looks like this is what QD3D was doing, as the same problem occurs with colours (e.g., if the top triangle was red and the side one was blue, you would get an all-red and all-blue triangle in QD3D: but we'll do a red-to-blue fade over the two triangles). ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=442052&aid=907855&group_id=45158 |