Skip to content

add TrOneIsOpaque option to MTLLoader #12861

@wtlyu

Description

@wtlyu
Description of the problem

Today there are two major definitions of keyword Tr in mtl. And both of them are applied in different big 3D softwares. So I think it a proper way to add a new option equalizeTransparency in materialOptions of MTLLoader.

Details of this issue

According to the original spec http://paulbourke.net/dataformats/mtl/ , there's no Tr field. The Tr field is added into mtl format later than other field, and up to now, there are not any 'standard' spec defined it.

The most widely used definition might be set Tr = 1 - d. The value of 1.0 of d or the 0 of Tr means fully opaque. This is used in Wikipedia, and most of other softwares.

However, another definition is using Tr as an alias of d, with the same usage. So the fully opaque is d = Tr = 1. This implementation is recorded in andrewnoske‘s wiki and another spec from Department of Scientific Computing at Florida State University (FSU) (They delete it at early 2014. So this link is the cache page from web.archive.org). This definition is accepted in 3ds Max, vcglib and MeshLab.

Three.js version
  • Dev
  • r88
  • ...
Browser
  • All of them
  • Chrome
  • Firefox
  • Internet Explorer
OS
  • All of them
  • Windows
  • macOS
  • Linux
  • Android
  • iOS
Hardware Requirements (graphics card, VR Device, ...)
  • All of them

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions