Esempio n. 1
0
void
glsl_R_InitAlias (void)
{
	int         vert;
	int         frag;

	vert = GLSL_CompileShader ("quakemdl.vert", quakemdl_vert,
							   GL_VERTEX_SHADER);
	frag = GLSL_CompileShader ("quakemdl.frag", quakemdl_frag,
							   GL_FRAGMENT_SHADER);
	quake_mdl.program = GLSL_LinkProgram ("quakemdl", vert, frag);
	GLSL_ResolveShaderParam (quake_mdl.program, &quake_mdl.mvp_matrix);
	GLSL_ResolveShaderParam (quake_mdl.program, &quake_mdl.norm_matrix);
	GLSL_ResolveShaderParam (quake_mdl.program, &quake_mdl.skin_size);
	GLSL_ResolveShaderParam (quake_mdl.program, &quake_mdl.blend);
	GLSL_ResolveShaderParam (quake_mdl.program, &quake_mdl.colora);
	GLSL_ResolveShaderParam (quake_mdl.program, &quake_mdl.colorb);
	GLSL_ResolveShaderParam (quake_mdl.program, &quake_mdl.sta);
	GLSL_ResolveShaderParam (quake_mdl.program, &quake_mdl.stb);
	GLSL_ResolveShaderParam (quake_mdl.program, &quake_mdl.normala);
	GLSL_ResolveShaderParam (quake_mdl.program, &quake_mdl.normalb);
	GLSL_ResolveShaderParam (quake_mdl.program, &quake_mdl.vertexa);
	GLSL_ResolveShaderParam (quake_mdl.program, &quake_mdl.vertexb);
	GLSL_ResolveShaderParam (quake_mdl.program, &quake_mdl.colormap);
	GLSL_ResolveShaderParam (quake_mdl.program, &quake_mdl.skin);
	GLSL_ResolveShaderParam (quake_mdl.program, &quake_mdl.ambient);
	GLSL_ResolveShaderParam (quake_mdl.program, &quake_mdl.shadelight);
	GLSL_ResolveShaderParam (quake_mdl.program, &quake_mdl.lightvec);
	GLSL_ResolveShaderParam (quake_mdl.program, &quake_mdl.fog);
}
Esempio n. 2
0
void
glsl_R_InitSprites (void)
{
	int         frag, vert;

	vert = GLSL_CompileShader ("quakespr.vert", quakesprite_vert,
							   GL_VERTEX_SHADER);
	frag = GLSL_CompileShader ("quakespr.frag", quakesprite_frag,
							   GL_FRAGMENT_SHADER);
	quake_sprite.program = GLSL_LinkProgram ("quakespr", vert, frag);
	GLSL_ResolveShaderParam (quake_sprite.program, &quake_sprite.spritea);
	GLSL_ResolveShaderParam (quake_sprite.program, &quake_sprite.spriteb);
	GLSL_ResolveShaderParam (quake_sprite.program, &quake_sprite.palette);
	GLSL_ResolveShaderParam (quake_sprite.program, &quake_sprite.matrix);
	GLSL_ResolveShaderParam (quake_sprite.program, &quake_sprite.vertexa);
	GLSL_ResolveShaderParam (quake_sprite.program, &quake_sprite.vertexb);
	GLSL_ResolveShaderParam (quake_sprite.program, &quake_sprite.colora);
	GLSL_ResolveShaderParam (quake_sprite.program, &quake_sprite.colorb);
	GLSL_ResolveShaderParam (quake_sprite.program, &quake_sprite.uvab);
	GLSL_ResolveShaderParam (quake_sprite.program, &quake_sprite.blend);
	GLSL_ResolveShaderParam (quake_sprite.program, &quake_sprite.fog);
}
Esempio n. 3
0
void InitGLSL()
{
	GLint glMaxVERTEX_UNIFORM_COMPONENTS=0;
	glGetIntegerv(GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS,&glMaxVERTEX_UNIFORM_COMPONENTS);

	if(glMaxVERTEX_UNIFORM_COMPONENTS==0)
		ShadowLevel=2;


	g_GLSLvertex = GLSL_CompileShader("vertex_t.glsl",GL_VERTEX_SHADER_ARB);
	if(ShadowLevel>=3)
		g_GLSLpixel = GLSL_CompileShader("pixel_NOBloom_HighShadow.glsl",GL_FRAGMENT_SHADER_ARB);
	else
		g_GLSLpixel = GLSL_CompileShader("pixel_NOBloom.glsl",GL_FRAGMENT_SHADER_ARB);
	g_GLSLRenderShadowMap_vertex = GLSL_CompileShader("RenderShadowMap_vertex.glsl",GL_VERTEX_SHADER_ARB);
	g_GLSLRenderShadowMap_pixel = GLSL_CompileShader("RenderShadowMap_pixel.glsl",GL_FRAGMENT_SHADER_ARB);
	g_GLSLSea_vertex = GLSL_CompileShader("Sea_vertex.glsl",GL_VERTEX_SHADER_ARB);
	g_GLSLSea_pixel = GLSL_CompileShader("Sea_pixel.glsl",GL_FRAGMENT_SHADER_ARB);
	g_GLSLBackFire_vertex = GLSL_CompileShader("BackFire_vertex.glsl",GL_VERTEX_SHADER_ARB);
	g_GLSLBackFire_pixel = GLSL_CompileShader("BackFire_pixel.glsl",GL_FRAGMENT_SHADER_ARB);
//	g_GLSLBloom_vertex = GLSL_CompileShader("Bloom_vertex.glsl",GL_VERTEX_SHADER_ARB);
	g_GLSLBloomW_pixel = GLSL_CompileShader("BloomW_pixel.glsl",GL_FRAGMENT_SHADER_ARB);
	g_GLSLBloomH_pixel = GLSL_CompileShader("BloomH_pixel.glsl",GL_FRAGMENT_SHADER_ARB);
	g_GLSLBloomMap_pixel = GLSL_CompileShader("BloomMap_pixel.glsl",GL_FRAGMENT_SHADER_ARB);
	g_GLSLToneMapping_pixel = GLSL_CompileShader("ToneMapping_pixel.glsl",GL_FRAGMENT_SHADER_ARB);

	GLSL_RenderShadowMap = glCreateProgramObjectARB();
	GLSL_shaderT = glCreateProgramObjectARB();
	GLSL_DrawSea = glCreateProgramObjectARB();
	GLSL_BackFire = glCreateProgramObjectARB();
	GLSL_DrawBloomW = glCreateProgramObjectARB();
	GLSL_DrawBloomH = glCreateProgramObjectARB();
	GLSL_DrawBloomMap = glCreateProgramObjectARB();
	GLSL_ToneMapping = glCreateProgramObjectARB();
	glAttachObjectARB( GLSL_RenderShadowMap, g_GLSLRenderShadowMap_vertex );
	glAttachObjectARB( GLSL_RenderShadowMap, g_GLSLRenderShadowMap_pixel );
	glAttachObjectARB( GLSL_shaderT, g_GLSLvertex );
	glAttachObjectARB( GLSL_shaderT, g_GLSLpixel );
	glAttachObjectARB( GLSL_DrawSea, g_GLSLSea_vertex );
	glAttachObjectARB( GLSL_DrawSea, g_GLSLSea_pixel );
	glAttachObjectARB( GLSL_BackFire, g_GLSLBackFire_vertex );
	glAttachObjectARB( GLSL_BackFire, g_GLSLBackFire_pixel );
	//glAttachObjectARB( GLSL_DrawBloomW, g_GLSLBloom_vertex );
	glAttachObjectARB( GLSL_DrawBloomW, g_GLSLBloomW_pixel );
	//glAttachObjectARB( GLSL_DrawBloomH, g_GLSLBloom_vertex );
	glAttachObjectARB( GLSL_DrawBloomH, g_GLSLBloomH_pixel );
	//glAttachObjectARB( GLSL_DrawBloomMap, g_GLSLBloom_vertex );
	glAttachObjectARB( GLSL_DrawBloomMap, g_GLSLBloomMap_pixel );
	//glAttachObjectARB( GLSL_ToneMapping, g_GLSLBloom_vertex );
	glAttachObjectARB( GLSL_ToneMapping, g_GLSLToneMapping_pixel );
	GetGLSLLinkSTATUS( GLSL_RenderShadowMap);
	GetGLSLLinkSTATUS( GLSL_shaderT);
	GetGLSLLinkSTATUS( GLSL_DrawSea);
	GetGLSLLinkSTATUS( GLSL_BackFire);
	GetGLSLLinkSTATUS( GLSL_DrawBloomW);
	GetGLSLLinkSTATUS( GLSL_DrawBloomH);
	GetGLSLLinkSTATUS( GLSL_DrawBloomMap);
	GetGLSLLinkSTATUS( GLSL_ToneMapping);
}