Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DRYer texture creation for different map types #9336

Merged
merged 2 commits into from
Jul 17, 2016
Merged

Conversation

dhritzkiv
Copy link
Contributor

Noticed there was a fair bit of repetition in each map line case. This pulls the case logic out into a reusable function

This also adds support for texture parameters for specular maps as a result. (Expands on #9311 and #9308)

Noticed there was a fair bit of repetition in each map line case. This pulls the case logic out into a reusable function

This also adds support for texture parameters for specular maps as a result. (Expands on mrdoob#9311 and mrdoob#9308)
@@ -358,6 +359,22 @@ THREE.MTLLoader.MaterialCreator.prototype = {

return baseUrl + url;
};

var setMapForType = function ( mapType, value ) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

function setMapForType( mapType, value ) {

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mrdoob changed. I thought there was a preference for this style of declaring a function (looking at the resolveURL function right above it)

@mrdoob mrdoob merged commit 5ded961 into mrdoob:dev Jul 17, 2016
@mrdoob
Copy link
Owner

mrdoob commented Jul 17, 2016

Thanks!

aardgoose pushed a commit to aardgoose/three.js that referenced this pull request Oct 7, 2016
* DRYer texture creation for different map types

Noticed there was a fair bit of repetition in each map line case. This pulls the case logic out into a reusable function

This also adds support for texture parameters for specular maps as a result. (Expands on mrdoob#9311 and mrdoob#9308)

* Change style of function declaration
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants