From: Thomas S. <th...@dr...> - 2013-07-22 23:19:20
|
Nope, sorry. Tangents and Bitangents are *defined* to point along the texture axises. They're used to convert between model space and tangent space for normal mapping and about any other per-pixel shader effect. You can't have those without texture coordinates. Bye, Thomas Am 23.07.2013, 00:12 Uhr, schrieb Nicolas Leroux <nic...@ou...>: > It looks like you’re right: > > > “Vertex tangents. > The tangent of a vertex points in the direction of the positive X > texture axis. The array contains normalized vectors, NULL if not > present. The array is mNumVertices in size. A mesh consisting of points > and lines only may not have normal vectors. Meshes with mixed primitive > types (i.e. lines and triangles) may have normals, but the normals for > vertices that are only referenced by point or line primitives are > undefined and set to qNaN. See the mNormals member for a detailled > discussion of qNaNs. ” > > > I can only assume the same is true for bitangents. > > > Hmm, okay then, so shouldn’t the discussion we be having about > correctness: Wouldn’t it be pretty much trivial to calculate tangents > without the texture coordinates? I remember doing it in a graphics class > back in college, but I feel fairly confident that I could code it up if > needed. > > > Just thinking out loud now, this seems like a good discussion to have. > > > -Nico > > > > From: Martti > Sent: Monday, July 22, 2013 4:39 PM > To: ass...@li... > > > The tangent vector is the vector that represents the UV x-axis in model > space and binormal is the UV y-axis in model space, so I think there's > no way to compute them without having some form of texture coordinates > available. I may be wrong though. > > > > > On Tue, Jul 23, 2013 at 12:16 AM, Nicolas Leroux > <nic...@ou...> wrote: > > > > > You got it, the problem is that the mesh has no UV coordinates. > > > My question is: Why is this a problem? Aren’t vertices and faces enough > to generate tangents and bitangents? > > > The more I think about this, the more it looks like I’ll have to write > some tangent generating code that runs when I’m copying the vertices > over to my DirectX format. Do you know of a better solution? Don’t worry > about it if it’s late :P, I can definitely wait some time for your free > help. > > > I really appreciate the help, thank you. > > -Nico > > > > From: Martti > Sent: Monday, July 22, 2013 4:14 PM > To: ass...@li... > > > > > > > It is late here, so I may be of little help right now, but the tangent > generating postprocessing step seems to fail on three conditions: > > 1) mesh has no normals (clearly not it) > > 2) mesh primitive type is not triangle/polygon > > 3) mesh has no uv coordinates > > > > > In any case the CalcTangentsProcess seems to notify the logger of any > problem, so check if anything gets logged. > > Hope this helps. > > > > > > > On Mon, Jul 22, 2013 at 11:50 PM, Nicolas Leroux > <nic...@ou...> wrote: > > > > > I apologize, I’m going to have to update this again. > > > It appears that despite having normals and then applying the > CalcTangentSpace post process step, the tangents are still not getting > generated. > > > This screenshot sums up the situation pretty well: > http://i.imgur.com/DD3thr5.jpg > > > Thanks again for reading and sorry for the spam, I should’ve waited and > tested before screaming ”Success!” > > > -Nico > > > > From: Nicolas Leroux > Sent: Monday, July 22, 2013 3:18 PM > To: ass...@li... > > > > > > Ouch, I read the manual a bit closer and answered my own question quite > quickly. > > It looks like running this function AFTER generating the normals will do > the trick: ASSIMP_API const aiScene* aiApplyPostProcessing ( const > aiScene * pScene, > unsigned int pFlags) > > > http://assimp.sourceforge.net/lib_html/cimport_8h.html#a09fe8ba0c8e91bf04b4c29556be53b6d > > > Sorry for the 2 emails. > > > > From: Nicolas Leroux > Sent: Monday, July 22, 2013 3:01 PM > To: ass...@li... > > > Hello all, > > > I’m pulling in models that, more often than not, have no normal and no > tangents. I was disappointed to see this line in the comments for > aiProcess_CalcTangentSpace: > > > "Does nothing if a mesh does not have normals.” > > > The problem here is, my mesh does have normals, but they were just > calculated by > > aiProcess_GenSmoothNormals . > > > Is there any way to do an additional post process pass after generating > the normals? I could definitely write code to generate tangents myself, > but I trust the assimp teams tangent generating skills more than mine 😊. > > > Thanks in advance guys, > > Nico > > ------------------------------------------------------------------------------ > See everything from the browser to the database with AppDynamics > Get end-to-end visibility with application monitoring from AppDynamics > Isolate bottlenecks and diagnose root cause in seconds. > Start your free trial of AppDynamics Pro today! > http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk > _______________________________________________ > Assimp-discussions mailing list > Ass...@li... > https://lists.sourceforge.net/lists/listinfo/assimp-discussions |