MTLLoader improvements (#8689)
* MTLLoader: Deprecate setBaseUrl in favor or better named setTexturePath. Make sure MaterialCreator.baseUrl is not undefined if no path/texture path is set. * MTLLoader: Automatically resolve texture base path from .mtl source URL if not explicitly set with setPath or setTexturePath. The URL parameter to .parse(text, url) is passed in if you use .load(). For external use it is optional and preserves earlier behavior if not passed in. * MTLLoader: Use single quotes consistently. Make params object property setting easier to read. * MTLLoader: Don't overwrite already found diffuse texture like is done with bump map. This might change behavior for bad materials that define 'map_kd' multiple times. * MTLLoader: Remaining double quotes to single ticks, also in documentation. * MTLLoader: Remove auto resolving base path from .mtl source URL. Add documentation to load and other important functions. Remove now redundant call to .setBaseUrl in obj/mtl loader example. setPath is enough if the .mtl and textures have the same base path (documented). * MTLLoader: Dont break parsed texture references that are already absolute URLs. * MTLLoader: Fix doc typos. * MTLLoader: Move utility function inside the function that uses it. * MTLLoader: Use case insensitive regexp instead for abs URL checks.
Showing
想要评论请 注册 或 登录