Example #1
0
void MaterialNode::load()
{
	if (this->colorMap != 0) SetTextureSlot(UNIFORM_TEXTURE_COLOR_MAP, this->colorMap);
	if (this->normalMap != 0) SetTextureSlot(UNIFORM_TEXTURE_NORMAL_MAP, this->normalMap);
	if (this->specularMap != 0) SetTextureSlot(UNIFORM_TEXTURE_SPECULAR_MAP, this->specularMap);
	SetUniform(UNIFORM_UV_REPEAT, &this->uvRepeat);
	SetUniform(UNIFORM_UV_OFFSET, &this->uvOffset);
	SetUniform(UNIFORM_OVERLAY_COLOR, &this->overlay);
	SetUniform(UNIFORM_HIGHLIGHT_COLOR, &this->highlight);
	SetUniform(UNIFORM_ROUGHNESS, this->roughness);
	SetUniform(UNIFORM_REFRACTION_INDEX, this->refIndex);
}
void AnimaRenderer::InitTextureSlots()
{
	// Slot usati dai materiali
	SetTextureSlot("DiffuseTexture", 0);
	SetTextureSlot("BumpTexture", 1);
	SetTextureSlot("DisplacementTexture", 2);
	SetTextureSlot("OpacityTexture", 3);
	SetTextureSlot("SpecularTexture", 4);

	// Slot usati dal deferred shading
	SetTextureSlot("DepthMap", 0);
	SetTextureSlot("AlbedoMap", 1);
	SetTextureSlot("NormalMap", 2);
	SetTextureSlot("EmissiveMap", 3);
	SetTextureSlot("SpecularMap", 4);
	SetTextureSlot("ShadowMap", 5);

	// Slot usati dal disegno di primitive
	SetTextureSlot("DepthMap", 0);
	SetTextureSlot("Diffuse2Map", 1);
	SetTextureSlot("PDepthMap", 2);
	SetTextureSlot("PColorMap", 3);

	// Slot usati dal deferred shading

	// Slot usati dai filtri
	SetTextureSlot("FilterMap", 0);
}
void AnimaRenderer::SetTextureSlot(const char* propertyName, AUint value)
{
	AnimaString str(propertyName, _allocator);
	SetTextureSlot(str, value);
}