提交 fc652725 编写于 作者: R Rab Hallett

3DSMax Exporter - Corrected specular export, support Phong

Made a correction to the way the specular coefficient is exported; this was using the 3DSMax "Glossiness" attribute. It has been corrected to use the 3DSMax material "Specular Level". The "Glossiness" has been correctly remapped to the "Shininess" three.js attribute. 

Additionally included Phong shading, so the three.js Phong material will be used if Phong when used in 3DSMax - without this the bump maps are disregarded as they aren't rendered with Lambert materials (default material when unspecified). Blinn/Metal ShaderType materials will continue to be exported as Lambert.
上级 eb7da5e2
......@@ -484,11 +484,11 @@ rollout ThreeJSExporter "ThreeJSExporter"
DumpColor mat.ambient "colorAmbient"
DumpColor mat.specular "colorSpecular"
t = mat.opacity / 100
s = mat.glossiness
transparency = mat.opacity / 100
Format "\"transparency\" : %,\n" t to:ostream
Format "\"specularCoef\" : %,\n" s to:ostream
Format "\"transparency\" : %,\n" transparency to:ostream
Format "\"specularCoef\" : %,\n" mat.specularLevel to:ostream
Format "\"shininess\" : %,\n" mat.glossiness to:ostream
-- maps
......@@ -497,6 +497,11 @@ rollout ThreeJSExporter "ThreeJSExporter"
DumpMap mat.specularMap "mapSpecular"
DumpMap mat.bumpMap "mapBump"
DumpMap mat.opacityMap "mapAlpha"
if mat.shaderByName == "Phong" then
(
Format "\"shading\" : \"phong\",\n" to:ostream
)
)
else
......@@ -1071,4 +1076,4 @@ rollout ThreeJSExporter "ThreeJSExporter"
)
)
createDialog ThreeJSExporter width:300
\ No newline at end of file
createDialog ThreeJSExporter width:300
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册