roughnessmap_fragment top-level property

String roughnessmap_fragment
getter/setter pair

Implementation

String roughnessmap_fragment = """
float roughnessFactor = roughness;

#ifdef USE_ROUGHNESSMAP

	vec4 texelRoughness = texture2D( roughnessMap, vUv );

	// reads channel G, compatible with a combined OcclusionRoughnessMetallic (RGB) texture
	roughnessFactor *= texelRoughness.g;

#endif
""";