Beispiel #1
0
void Shader::SetUniformValueByIndex(int32 uniformIndex, const Vector4 & vector)
{
	DVASSERT(uniformIndex >= 0 && uniformIndex < activeUniforms);
	Uniform* currentUniform = GET_UNIFORM(uniformIndex);
	if(currentUniform->ValidateCache(vector) == false)
	{
		RENDER_VERIFY(glUniform4fv(currentUniform->location, 1, &vector.x));
	}
}
Beispiel #2
0
void Shader::SetUniformValueByIndex(int32 uniformIndex, const Matrix3 & matrix)
{
	DVASSERT(uniformIndex >= 0 && uniformIndex < activeUniforms);
	Uniform* currentUniform = GET_UNIFORM(uniformIndex);
	if(currentUniform->ValidateCache(matrix) == false)
	{
		RENDER_VERIFY(glUniformMatrix3fv(currentUniform->location, 1, GL_FALSE, matrix.data));
	}
}
Beispiel #3
0
void Shader::SetUniformValueByIndex(int32 uniformIndex, float32 value)
{
	DVASSERT(uniformIndex >= 0 && uniformIndex < activeUniforms);
	Uniform* currentUniform = GET_UNIFORM(uniformIndex);
	if(currentUniform->ValidateCache(value) == false)
	{
		RENDER_VERIFY(glUniform1f(currentUniform->location, value));
	}
}