Skip to content

Commit

Permalink
Change from transparency to Tr
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Oom committed Jun 20, 2024
1 parent 8d4c5bf commit 59de850
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions scenes/cornell.mtl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -49,5 +49,5 @@ newmtl RightBox
reflat0deg 0.2
reflat90deg 1.0
ni 1.55
transparency 1.0
tr 1.0
specularroughness 0.001
4 changes: 2 additions & 2 deletions scenes/cornell_textured.mtl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -63,5 +63,5 @@ newmtl RightBox
reflat0deg 0.2
reflAt90Deg 1.0
ni 1.55
transparency 1.0
tr 1.0
specularroughness 0.001
2 changes: 1 addition & 1 deletion scenes/cornellbottle2.mtl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions wavefront/src/mtl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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(),
Expand Down

0 comments on commit 59de850

Please sign in to comment.