Пример #1
0
void phongShaderOverride::getCustomMappings(
	MHWRender::MAttributeParameterMappingList& mappings)
{
	// The "color" and "incandescence" attributes are all named the same as
	// the corresponding parameters on the fragment so they will map
	// automatically. Need to remap "diffuseReflectivity", "translucenceCoeff",
	// "reflectionGain" and "power" though.
	MHWRender::MAttributeParameterMapping diffuseMapping(
		"diffuse", "diffuseReflectivity", true, true);
	mappings.append(diffuseMapping);

	MHWRender::MAttributeParameterMapping translucenceMapping(
		"translucence", "translucenceCoeff", true, true);
	mappings.append(translucenceMapping);

	MHWRender::MAttributeParameterMapping reflectivityMapping(
		"reflectivity", "reflectionGain", true, true);
	mappings.append(reflectivityMapping);

	MHWRender::MAttributeParameterMapping powerMapping(
		"cosinePower", "power", true, true);
	mappings.append(powerMapping);

	// Our phong only uses a single float for specularity, while the Maya
	// phong fragment uses a full 3-float color. We could add a remap fragment
	// in front to expand the float to a 3-float, but it is simpler here to
	// just set the parameter manually in updateShader(). So add an empty
	// mapping to ensure the parameter gets renamed.
	MHWRender::MAttributeParameterMapping specColMapping(
		"specularColor", "", true, true);
	mappings.append(specColMapping);

}
void simpleNoiseShaderOverride::getCustomMappings(
	MHWRender::MAttributeParameterMappingList& mappings)
{
	// Set up some mappings for the noise map parameters on fragment, as there
	// is no correspondence to attributes on the node for them.
	MHWRender::MAttributeParameterMapping mapMapping(
		"noiseLookupMap", "", false, true);
	mappings.append(mapMapping);

	MHWRender::MAttributeParameterMapping textureSamplerMapping(
		"noiseLookupMapSampler", "", false, true);
	mappings.append(textureSamplerMapping);
}
Пример #3
0
void inNullOverride::getCustomMappings(
	MHWRender::MAttributeParameterMappingList& mappings)
{
	// The "color", "transparency" and "incandescence" attributes are all
	// named the same as the corresponding parameters on the fragment so they
	// will map automatically. Need to remap diffuseReflectivity and
	// translucence though
	MHWRender::MAttributeParameterMapping diffuseMapping(
		"diffuse", "diffuseReflectivity", true, true);
	mappings.append(diffuseMapping);

	MHWRender::MAttributeParameterMapping translucenceMapping(
		"translucence", "translucenceCoeff", true, true);
	mappings.append(translucenceMapping);
}