Jump to content

  • Log In with Google      Sign In   
  • Create Account


#Actualharshman_chris

Posted 22 January 2013 - 07:11 PM

So A second post because I found out more information. The lines below each comment that are marked with an ERROR generate GL_INVALID_OPERATION, and therefore aren't called. I dont know if this happens on ATI and Nvidia or just Nvidia at this point.

 

Edit:

 

I fixed the problem now, I was not using the gluniform commands correctly.


#1harshman_chris

Posted 22 January 2013 - 06:48 PM

So A second post because I found out more information. The lines below each comment that are marked with an ERROR generate GL_INVALID_OPERATION, and therefore aren't called. I dont know if this happens on ATI and Nvidia or just Nvidia at this point.

 

// Direction Light Colour - ERROR
		glUniform4fv((*this->getShader())["directionalLight.base.colour"],4,
			enviroment->getDirectionalLight()->getLightColour().getArray());
		// Direction Light Ambient Intensity
		glUniform1f((*this->getShader())["directionalLight.base.ambientIntensity"],
			enviroment->getDirectionalLight()->getAmbientIntensity());
		// Direction Light Diffuse Intensity
		glUniform1f((*this->getShader())["directionalLight.base.diffuseIntensity"],
			enviroment->getDirectionalLight()->getDiffuseIntensity());
		// Direction Light Direction - ERROR
		glUniform3fv((*this->getShader())["directionalLight.direction"],3,
			enviroment->getDirectionalLight()->getLightDirection().getArray());

		
		// Number of Point Lights
		glUniform1i((*this->getShader())["numPointLights"],
			enviroment->getNumPointLights());

		// Point Lights
		for(int i = 0; i < enviroment->getNumPointLights(); i++)
		{
			// Point Light Colour - ERROR
			glUniform4fv((*this->getShader())[StringUtils::format("pointLights[%d].base.colour",i)],4,
				enviroment->getPointLight(i)->getLightColour().getArray());
			//Point Light ambient Intensity
			glUniform1f((*this->getShader())[StringUtils::format("pointLights[%d].base.ambientIntensity",i)],
				enviroment->getPointLight(i)->getAmbientIntensity());
			// Point Light Diffuse Intensity
			glUniform1f((*this->getShader())[StringUtils::format("pointLights[%d].base.diffuseIntensity",i)],
				enviroment->getPointLight(i)->getDiffuseIntensity());
			// Point Light Position - ERROR
			glUniform3fv((*this->getShader())[StringUtils::format("pointLights[%d].position",i)],3,
				enviroment->getPointLight(i)->getLightPosition().getArray());
			// Point Light constant
			glUniform1i((*this->getShader())[StringUtils::format("pointLights[%d].attenuation.constant",i)],
				enviroment->getPointLight(i)->getLightAttenuation().getConstant());
			// Point Light linear
			glUniform1i((*this->getShader())[StringUtils::format("pointLights[%d].attenuation.linear",i)],
				enviroment->getPointLight(i)->getLightAttenuation().getLinear());
			// Point Light exponential
			glUniform1i((*this->getShader())[StringUtils::format("pointLights[%d].attenuation.exponential",i)],
				enviroment->getPointLight(i)->getLightAttenuation().getExponential());
		}

		// Camera World Position - ERROR
		glUniform3fv((*this->getShader())["cameraEyeWorldPosition"],3,
			this->getScene()->getActivePerspectiveCamera()->getTranslation().getArray());
		//Specular Intensity - ERROR
		glUniform1i((*this->getShader())["specularIntensity"],this->getMaterial()->getSpecularIntensity());
		//Specular Power - ERROR
		glUniform1i((*this->getShader())["specularPower"],this->getMaterial()->getSpecularPower());

		// Lighting Mode
		glUniform1i((*this->getShader())["lightingEnabled"],enviroment->getLightingEnabled());

PARTNERS