Esempio n. 1
0
void SkyDomeShader::use(SubObject* so)throw(SimulatorException)
{
	GUARD(glUseProgram(mGLProgramHandle));
	setupTransformationUniforms(so);

	VisualMaterial * visMat =  dynamic_cast<VisualMaterial*>(so->getMaterial());
	assert(visMat);
	setupMaterialUniforms(visMat);
	//---------- uncategorized uniforms to come ------------------------------------------------
	bindVector3D("eyePositionW",URE_INSTANCE->getCurrentlyActiveCamera()->getGlobalTransform().getPosition());
}
void DepthImageGenerationShader::use(SubObject* so)throw(SimulatorException)
{
	GUARD(glUseProgram(mGLProgramHandle));

	//---------------------------------------------------------
	setupTransformationUniforms(so);
	//----------------------------------------------------------
	VisualMaterial * visMat =  dynamic_cast<VisualMaterial*>(so->getMaterial());
	assert(visMat);
	//setupTessellationParameters() returns doing nothing if tess is not enablled globally or in this mat
	setupTessellationParameters(visMat);
	//---------- uncategorized uniforms to come ------------------------------------------------
	//bindVector3D("eyePositionW",URE_INSTANCE->getCurrentlyActiveCamera()->getGlobalTransform().getPosition());

	//TODO check if the upper impl. works ;(
}
//virtual bool operator==(const Shader& rhs)const;
void GenericLightingUberShader::use(SubObject *so) throw (SimulatorException)
{
   GUARD(glUseProgram(mGLProgramHandle));


   //---------------------------------------------------------
   setupTransformationUniforms(so);
   //----------------------------------------------------------
   if( (mLocalShaderFeatures.shadingFeatures & SHADING_FEATURE_DIRECT_LIGHTING) !=0)
   {
	   setupLightSourceUniforms();
   }
   //----------------------------------------------------------
   VisualMaterial * visMat =  dynamic_cast<VisualMaterial*>(so->getMaterial());
   assert(visMat);
   setupMaterialUniforms(visMat);
//---------- uncategorized uniforms to come ------------------------------------------------
	bindVector3D("eyePositionW",URE_INSTANCE->getCurrentlyActiveCamera()->getGlobalTransform().getPosition());

}