Moved LightLocations to outside of UniformLocations
parent
2b94de44a8
commit
79c21f6676
|
@ -683,7 +683,7 @@ void CGL21Device::SetLight(int index, const Light &light)
|
||||||
|
|
||||||
m_lights[index] = light;
|
m_lights[index] = light;
|
||||||
|
|
||||||
UniformLocations::LightLocations &loc = m_uniforms[m_mode].lights[index];
|
LightLocations &loc = m_uniforms[m_mode].lights[index];
|
||||||
|
|
||||||
glUniform4fv(loc.ambient, 1, light.ambient.Array());
|
glUniform4fv(loc.ambient, 1, light.ambient.Array());
|
||||||
glUniform4fv(loc.diffuse, 1, light.diffuse.Array());
|
glUniform4fv(loc.diffuse, 1, light.diffuse.Array());
|
||||||
|
|
|
@ -42,6 +42,24 @@
|
||||||
namespace Gfx
|
namespace Gfx
|
||||||
{
|
{
|
||||||
|
|
||||||
|
struct LightLocations
|
||||||
|
{
|
||||||
|
//! true enables light
|
||||||
|
GLint enabled = -1;
|
||||||
|
//! Light type
|
||||||
|
GLint type = -1;
|
||||||
|
//! Position or direction vector
|
||||||
|
GLint position = -1;
|
||||||
|
//! Ambient color
|
||||||
|
GLint ambient = -1;
|
||||||
|
//! Diffuse color
|
||||||
|
GLint diffuse = -1;
|
||||||
|
//! Specular color
|
||||||
|
GLint specular = -1;
|
||||||
|
//! Attenuation
|
||||||
|
GLint attenuation = -1;
|
||||||
|
};
|
||||||
|
|
||||||
struct UniformLocations
|
struct UniformLocations
|
||||||
{
|
{
|
||||||
// Uniforms
|
// Uniforms
|
||||||
|
@ -91,23 +109,7 @@ struct UniformLocations
|
||||||
//! Specular color
|
//! Specular color
|
||||||
GLint specularColor = -1;
|
GLint specularColor = -1;
|
||||||
|
|
||||||
struct LightLocations
|
LightLocations lights[8] = {};
|
||||||
{
|
|
||||||
//! true enables light
|
|
||||||
GLint enabled = -1;
|
|
||||||
//! Light type
|
|
||||||
GLint type = -1;
|
|
||||||
//! Position or direction vector
|
|
||||||
GLint position = -1;
|
|
||||||
//! Ambient color
|
|
||||||
GLint ambient = -1;
|
|
||||||
//! Diffuse color
|
|
||||||
GLint diffuse = -1;
|
|
||||||
//! Specular color
|
|
||||||
GLint specular = -1;
|
|
||||||
//! Attenuation
|
|
||||||
GLint attenuation = -1;
|
|
||||||
} lights[8];
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue