diff --git a/scenes/cornell.mtl b/scenes/cornell.mtl index 9b25cf7d..1874cf6c 100644 --- a/scenes/cornell.mtl +++ b/scenes/cornell.mtl @@ -40,7 +40,7 @@ newmtl LeftBox reflat0deg 0.3 reflat90deg 1.0 ni 1.55 - transparency 0.0 + tr 0.0 specularroughness 0.001 newmtl RightBox @@ -49,5 +49,5 @@ newmtl RightBox reflat0deg 0.2 reflat90deg 1.0 ni 1.55 - transparency 1.0 + tr 1.0 specularroughness 0.001 diff --git a/scenes/cornell_textured.mtl b/scenes/cornell_textured.mtl index 5a88df2d..353644ab 100644 --- a/scenes/cornell_textured.mtl +++ b/scenes/cornell_textured.mtl @@ -54,7 +54,7 @@ newmtl LeftBox reflat0deg 0.3 reflAt90Deg 1.0 ni 1.55 - transparency 0.0 + tr 0.0 specularroughness 0.001 newmtl RightBox @@ -63,5 +63,5 @@ newmtl RightBox reflat0deg 0.2 reflAt90Deg 1.0 ni 1.55 - transparency 1.0 + tr 1.0 specularroughness 0.001 diff --git a/scenes/cornellbottle2.mtl b/scenes/cornellbottle2.mtl index 03f3d076..3e5ae953 100644 --- a/scenes/cornellbottle2.mtl +++ b/scenes/cornellbottle2.mtl @@ -39,7 +39,7 @@ newmtl Bottle reflat0deg 0.1 reflat90deg 1.0 ni 1.4 - transparency 1.0 + tr 1.0 newmtl Cork kd 0.6745 0.5725 0.4902 diff --git a/wavefront/src/mtl.rs b/wavefront/src/mtl.rs index 678dbaf3..cecdf6d2 100644 --- a/wavefront/src/mtl.rs +++ b/wavefront/src/mtl.rs @@ -119,7 +119,7 @@ where materials.last_mut().unwrap().reflection_90_degrees = x; } else if let Ok((_, x)) = tagged("ni", float, trimmed) { materials.last_mut().unwrap().index_of_refraction = x; - } else if let Ok((_, x)) = tagged("transparency", float, trimmed) { + } else if let Ok((_, x)) = tagged("tr", float, trimmed) { materials.last_mut().unwrap().transparency = x; } else if let Ok((_, _)) = tagged("specularroughness", float, trimmed) { // TODO: not supported @@ -215,8 +215,8 @@ mod tests { 0.5 ); assert_eq!( - mtl_test("newmtl m1\ntransparency 1.").materials[0].transparency, - 1. + mtl_test("newmtl m1\ntr 0.5").materials[0].transparency, + 0.5 ); assert_eq!( mtl_test("newmtl m1\nspecularroughness 1.").materials.len(),