ECS/Project/Project/Renderers/RendererModules/LightsModule/LightsModule.cpp
//	Create the Light Textures and Framebuffers
Create the Light Textures and Framebuffers
Create the Light Textures and Framebuffers
void LightsModule::createLightTexturesAndFramebuffers()
{
	for (unsigned int i = 0; i < maxLightCount; i++)
	{
		LightModuleMetaData newLightModuleMetaData;
		glActiveTexture(GL_TEXTURE0 + 0);
		glGenTextures(1, &newLightModuleMetaData.lightColorMap);
		glBindTexture(GL_TEXTURE_2D, newLightModuleMetaData.lightColorMap);
		glTextureImage2DEXT(newLightModuleMetaData.lightColorMap, GL_TEXTURE_2D, 0, GL_RGBA32F, screenWidth, screenHeight, 0, GL_RGBA, GL_FLOAT, NULL);
		glTextureParameteri(newLightModuleMetaData.lightColorMap, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
		glTextureParameteri(newLightModuleMetaData.lightColorMap, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
		glBindTexture(GL_TEXTURE_2D, 0);
		glGenTextures(1, &newLightModuleMetaData.lightDepthMap);
		glBindTexture(GL_TEXTURE_2D, newLightModuleMetaData.lightDepthMap);
		glTextureImage2DEXT(newLightModuleMetaData.lightDepthMap, GL_TEXTURE_2D, 0, GL_DEPTH24_STENCIL8, screenWidth, screenHeight, 0, GL_DEPTH_STENCIL, GL_UNSIGNED_INT_24_8, NULL);
		glTextureParameteri(newLightModuleMetaData.lightDepthMap, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
		glTextureParameteri(newLightModuleMetaData.lightDepthMap, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
		glBindTexture(GL_TEXTURE_2D, 0);
		lightModuleMetaDatas.push_back(newLightModuleMetaData);
	}
}
void LightsModule :: createLightTexturesAndFramebuffers ( ) { for ( unsigned int i = 0 ; i < maxLightCount ; i ++ ) { LightModuleMetaData newLightModuleMetaData ; glActiveTexture ( GL_TEXTURE0 + 0 ) ; glGenTextures ( 1 , & newLightModuleMetaData . lightColorMap ) ; glBindTexture ( GL_TEXTURE_2D , newLightModuleMetaData . lightColorMap ) ; glTextureImage2DEXT ( newLightModuleMetaData . lightColorMap , GL_TEXTURE_2D , 0 , GL_RGBA32F , screenWidth , screenHeight , 0 , GL_RGBA , GL_FLOAT , NULL ) ; glTextureParameteri ( newLightModuleMetaData . lightColorMap , GL_TEXTURE_MIN_FILTER , GL_NEAREST ) ; glTextureParameteri ( newLightModuleMetaData . lightColorMap , GL_TEXTURE_MAG_FILTER , GL_NEAREST ) ; glBindTexture ( GL_TEXTURE_2D , 0 ) ; glGenTextures ( 1 , & newLightModuleMetaData . lightDepthMap ) ; glBindTexture ( GL_TEXTURE_2D , newLightModuleMetaData . lightDepthMap ) ; glTextureImage2DEXT ( newLightModuleMetaData . lightDepthMap , GL_TEXTURE_2D , 0 , GL_DEPTH24_STENCIL8 , screenWidth , screenHeight , 0 , GL_DEPTH_STENCIL , GL_UNSIGNED_INT_24_8 , NULL ) ; glTextureParameteri ( newLightModuleMetaData . lightDepthMap , GL_TEXTURE_MIN_FILTER , GL_NEAREST ) ; glTextureParameteri ( newLightModuleMetaData . lightDepthMap , GL_TEXTURE_MAG_FILTER , GL_NEAREST ) ; glBindTexture ( GL_TEXTURE_2D , 0 ) ; lightModuleMetaDatas . push_back ( newLightModuleMetaData ) ; } }
Create the Light Textures and Framebuffers
Create the Light Textures and Framebuffers
//	Create the new Light Module Meta Data, and add it to the array. //	Generate the Color and Depth Textures. //	Active Texture. //	Generate the Light Color Map. //	Generate the Light Depth Map. //	Add the Light Module Meta Data.