Fix bug in Pointlight loading
This commit is contained in:
@@ -42,7 +42,7 @@ struct PointLight {
|
|||||||
vec3 diffuse;
|
vec3 diffuse;
|
||||||
vec3 specular;
|
vec3 specular;
|
||||||
};
|
};
|
||||||
#define NUM_POINT_LIGHTS 16
|
#define NUM_POINT_LIGHTS 1
|
||||||
uniform PointLight u_pointLight[NUM_POINT_LIGHTS];
|
uniform PointLight u_pointLight[NUM_POINT_LIGHTS];
|
||||||
|
|
||||||
/*struct SpotLight {
|
/*struct SpotLight {
|
||||||
|
|||||||
@@ -168,8 +168,7 @@ std::vector<Light*> JsonParser::getLights(ShaderProgram* shaderProgram)
|
|||||||
// Pointlights
|
// Pointlights
|
||||||
const Json::Value pointLightsJson = root["pointLights"];
|
const Json::Value pointLightsJson = root["pointLights"];
|
||||||
|
|
||||||
|
int index = 0;
|
||||||
unsigned int index = 0;
|
|
||||||
for (; index < pointLightsJson.size(); index++) {
|
for (; index < pointLightsJson.size(); index++) {
|
||||||
PointLight *current_pointLight;
|
PointLight *current_pointLight;
|
||||||
|
|
||||||
|
|||||||
@@ -75,7 +75,8 @@ void PointLight::update()
|
|||||||
|
|
||||||
std::string PointLight::getStructMemberName()
|
std::string PointLight::getStructMemberName()
|
||||||
{
|
{
|
||||||
std::string temp = "u_pointLight[" + std::to_string(id) + "].";
|
// id - 1 because id 0 is always the DirectionalLight!
|
||||||
|
std::string temp = "u_pointLight[" + std::to_string(id - 1) + "].";
|
||||||
return temp;
|
return temp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
#include "ShaderProgram.h"
|
#include "ShaderProgram.h"
|
||||||
|
|
||||||
#define NUM_POINT_LIGHTS 4
|
#define NUM_POINT_LIGHTS 1
|
||||||
|
|
||||||
class Light
|
class Light
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -2,7 +2,6 @@
|
|||||||
#include "JsonParser.h"
|
#include "JsonParser.h"
|
||||||
#include "eventActions.h"
|
#include "eventActions.h"
|
||||||
#include "helper.h"
|
#include "helper.h"
|
||||||
#include <iostream>
|
|
||||||
|
|
||||||
Menu::Menu(Framebuffer *p_framebuffer, ShaderProgram *p_shaderProgram) :
|
Menu::Menu(Framebuffer *p_framebuffer, ShaderProgram *p_shaderProgram) :
|
||||||
framebuffer(p_framebuffer), shaderProgram(p_shaderProgram)
|
framebuffer(p_framebuffer), shaderProgram(p_shaderProgram)
|
||||||
@@ -75,7 +74,7 @@ void Menu::writeWindowActions(bool *windowActionRegister)
|
|||||||
|
|
||||||
void Menu::onPlayPressed()
|
void Menu::onPlayPressed()
|
||||||
{
|
{
|
||||||
std::cout << "Hello, from Widget play in Menu :)" << std::endl;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Menu::onExitPressed()
|
void Menu::onExitPressed()
|
||||||
|
|||||||
@@ -6,7 +6,6 @@
|
|||||||
#include "defines.h"
|
#include "defines.h"
|
||||||
#include "helper.h"
|
#include "helper.h"
|
||||||
|
|
||||||
|
|
||||||
Window::Window()
|
Window::Window()
|
||||||
{
|
{
|
||||||
// Initialize GLFW
|
// Initialize GLFW
|
||||||
|
|||||||
Reference in New Issue
Block a user