0
votes

I'm loading an OBJ with an MTL which references a diffuse map and a bump. The map_Kd (diffuse map) is reading and loading in the renderer, but the map_Bump (bump map) is not. When I log the material to the console, the bumpmap property is null. Does OBJ MTL Loader work with bump maps?

1

1 Answers

1
votes

I looked into MTLLoader.js and found that bump maps are not added from the mtl file. I think I've fixed this:

In the file, there's a section for diffuse maps:

            case 'map_kd':

                // Diffuse texture map

                params[ 'map' ] = this.loadTexture( this.baseUrl + value );
                params[ 'map' ].wrapS = this.wrap;
                params[ 'map' ].wrapT = this.wrap;

                break;

Immediately after that, I added this:

            case 'map_bump':

                // Diffuse bump map

                params[ 'bumpMap' ] = this.loadTexture( this.baseUrl + value );
                params[ 'bumpMap' ].wrapS = this.wrap;
                params[ 'bumpMap' ].wrapT = this.wrap;

                break;

This is working for my example. If any developers see pitfalls with this modification, please let me know. Thanks.