[Maya2osg-users] Normal mapping
Status: Alpha
Brought to you by:
jtaibo
From: Jean-Sébastien G. <jea...@cm...> - 2011-05-04 16:31:21
|
Hello, I'm wondering what is needed to get normal mapping correctly exported. In the log file, I currently always get the "No File Texture attached to Surface Shader Bump Map Attribute !" message, which I can see is output in mesh.cpp around line 380. The result I get is that the .osg file contains a shader for normal mapping but the model does not have a tangent vector array, so it looks all black. In my scene I connected a File texture to the "Bump Mapping" input of a blinn material. In HyperShade I can see that blinn1.normalCamera is connected to bump2d1.outNormal, and then bump2d1.bumpValue is connected to file1.outAlpha. From the code, I can see that the plugin is looking at the normalCamera input of the surface shader to get the bump2d node, and then the bumpValue input of the bump2d node to get the file texture. That all seems correct to me. I've added some debugging code in mesh.cpp around line 368. What I get is that mBumpTexture has type kDependencyNode, not kFileTexture. Why? I know too little about the Maya SDK at this time to know what to do about this. Can a File Texture be extracted from the dependency node? (i.e. there would be one level of indirection more than the plugin code expects) I can send the scene if you want. Hopefully my description above is good enough. The other thing I think should happen is that if this code detects there is no normal map (even if it is erroneous right now) then in some other place in the plugin code, the shader used should not try to do normal mapping. It seems that the test to see if normal mapping is used is not the same. I can correct this later. Thanks in advance, J-S -- ______________________________________________________ Jean-Sebastien Guay jea...@cm... http://www.cm-labs.com/ http://whitestar02.dyndns-web.com/ |