Merge pull request #2438 from b1skit/master

Updated FBXConverter to set material shading mode when possible
pull/2448/head^2^2
Kim Kulling 2019-05-07 15:26:26 +02:00 committed by GitHub
commit 9501483367
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 0 deletions

View File

@ -67,6 +67,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <sstream>
#include <iomanip>
namespace Assimp {
namespace FBX {
@ -1598,6 +1599,13 @@ namespace Assimp {
out_mat->AddProperty(&str, AI_MATKEY_NAME);
}
// Set the shading mode as best we can: The FBX specification only mentions Lambert and Phong, and only Phong is mentioned in Assimp's aiShadingMode enum.
if (material.GetShadingModel() == "phong")
{
aiShadingMode shadingMode = aiShadingMode_Phong;
out_mat->AddProperty<aiShadingMode>(&shadingMode, 1, AI_MATKEY_SHADING_MODEL);
}
// shading stuff and colors
SetShadingPropertiesCommon(out_mat, props);
SetShadingPropertiesRaw( out_mat, props, material.Textures(), mesh );