Created
November 19, 2018 14:18
-
-
Save yakivmospan/43221b89e68e1fd3c5678a653859cf33 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
material { | |
name : "Textured material", | |
parameters : [ | |
{ | |
type : sampler2d, | |
name : baseColorMap | |
}, | |
{ | |
type : sampler2d, | |
name : normalMap | |
}, | |
{ | |
type : sampler2d, | |
name : metallicMap | |
}, | |
{ | |
type : sampler2d, | |
name : roughnessMap | |
} | |
], | |
requires : [ | |
uv0 | |
], | |
shadingModel : lit, | |
blending : opaque | |
} | |
fragment { | |
void material(inout MaterialInputs material) { | |
vec3 normal = texture(materialParams_normalMap, getUV0()).xyz; | |
material.normal = normal * 2.0 - 1.0; | |
prepareMaterial(material); | |
material.baseColor = texture(materialParams_baseColorMap, getUV0()); | |
material.metallic = texture(materialParams_metallicMap, getUV0()).r; | |
material.roughness = texture(materialParams_roughnessMap, getUV0()).r; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment