Added ShaderManager (Experimental)

Former-commit-id: 327e373f2b932e31184e88c5f29bd5bd8fa3ba46
This commit is contained in:
Lynix
2013-07-15 00:23:04 +02:00
parent 68d5f9a8e6
commit 4352083c4b
23 changed files with 1367 additions and 955 deletions

View File

@@ -38,7 +38,7 @@ void NzLight::AddToRenderQueue(NzAbstractRenderQueue* renderQueue) const
renderQueue->AddLight(this);
}
void NzLight::Apply(const NzShader* shader, unsigned int lightUnit) const
void NzLight::Enable(const NzShader* shader, unsigned int lightUnit) const
{
/*
struct Light
@@ -66,6 +66,7 @@ void NzLight::Apply(const NzShader* shader, unsigned int lightUnit) const
-P3: float cosInnerAngle + float cosOuterAngle
*/
///TODO: Optimiser
int typeLocation = shader->GetUniformLocation("Lights[0].type");
int ambientLocation = shader->GetUniformLocation("Lights[0].ambient");
int diffuseLocation = shader->GetUniformLocation("Lights[0].diffuse");
@@ -217,6 +218,12 @@ NzLight& NzLight::operator=(const NzLight& light)
return *this;
}
void NzLight::Disable(const NzShader* shader, unsigned int lightUnit)
{
///TODO: Optimiser
shader->SendInteger(shader->GetUniformLocation("Lights[" + NzString::Number(lightUnit) + "].type"), -1);
}
void NzLight::Invalidate()
{
NzSceneNode::Invalidate();