Big UberShader update

-Added GRAPHICS_MAX_LIGHTPERPASS macro
-Added glGetActiveUniform OpenGL function
-Added (Uber)ShaderLibrary
-Added (Uber)ShaderName parameter to models
-Changed uniform system
-Fixed Node copying
-Moved Material class to Graphics module
-Optimized lights
-Remade Shader class
-Renamed Node::Invalidate to Node::InvalidateNode
-Renamed ShaderProgram to Shader


Former-commit-id: 15f0cad52969e91a2442e7d750ba2dc412f3549d
This commit is contained in:
Lynix
2014-02-21 19:27:39 +01:00
parent 4ee2ceaef0
commit 86bdab9055
147 changed files with 2693 additions and 4135 deletions

View File

@@ -0,0 +1,50 @@
// Copyright (C) 2014 Jérôme Leclercq
// This file is part of the "Nazara Engine - Graphics module"
// For conditions of distribution and use, see copyright notice in Config.hpp
#include <Nazara/Graphics/Loaders/Texture.hpp>
#include <Nazara/Graphics/Material.hpp>
#include <Nazara/Renderer/Texture.hpp>
#include <memory>
#include <Nazara/Graphics/Debug.hpp>
namespace
{
nzTernary Check(NzInputStream& stream, const NzMaterialParams& parameters)
{
NazaraUnused(stream);
NazaraUnused(parameters);
return nzTernary_Unknown;
}
bool Load(NzMaterial* material, NzInputStream& stream, const NzMaterialParams& parameters)
{
NazaraUnused(parameters);
std::unique_ptr<NzTexture> texture(new NzTexture);
texture->SetPersistent(false);
if (!texture->LoadFromStream(stream))
{
NazaraError("Failed to load diffuse map");
return false;
}
material->Reset();
material->SetDiffuseMap(texture.get());
texture.release();
return true;
}
}
void NzLoaders_Texture_Register()
{
NzMaterialLoader::RegisterLoader(NzImageLoader::IsExtensionSupported, Check, Load);
}
void NzLoaders_Texture_Unregister()
{
NzMaterialLoader::UnregisterLoader(NzImageLoader::IsExtensionSupported, Check, Load);
}