f



Question about postprocessing


I have the code below that uses a shader any.

context.BeginFrame();
		Renderer.PreRender();
		if (frag_color_xy_shader != NULL)
		{
			frag_color_xy_shader->Use();
			frag_color_xy_shader->setFloat("u_time", context.secs);
			frag_color_xy_shader->setVec2("u_resolution", glm::vec2(static_cast<GLfloat>(SCREEN_WIDTH), static_cast<GLfloat>(SCREEN_HEIGHT)));
			frag_color_xy_shader->setVec2("u_mouse", glm::vec2(static_cast<GLfloat>(mouse_x), static_cast<GLfloat>(mouse_y)));
		}
	
		glEnable(GL_TEXTURE_2D);
		glActiveTexture(GL_TEXTURE0);
		glBindTexture(GL_TEXTURE_2D, glTex2D);
		glBegin(GL_QUADS);
		glTexCoord2f(1.0, 1.0); glVertex3f(0, 0, 1);
		glTexCoord2f(1.0, 0.0); glVertex3f(0, SCREEN_HEIGHT, 1);
		glTexCoord2f(0.0, 0.0); glVertex3f(SCREEN_WIDTH, SCREEN_HEIGHT, 1);
		glTexCoord2f(0.0, 1.0); glVertex3f(SCREEN_WIDTH, 0, 1);
		glEnd();

		Renderer.PostRender();

My question is: how do I add more shaders, for example a shader that renders the final image by applying a FXAA.

thanks
0
newbie_x11
9/28/2016 11:25:05 PM
comp.graphics.api.opengl 7074 articles. 1 followers. Post Follow

0 Replies
480 Views

Similar Articles

[PageSpeed] 45

Reply: