Android opengl es render shader without triangles

Started by
3 comments, last by wintertime 4 years, 9 months ago

Hello,

 

I start in opengl programming. I successfully render a face (2 triangles) with vertex and fragment shader. Now I want to see if it's also to render a shader whitout faces. I mean a shader that is simply painting the screen surface with color. Does someone has already done this kind of rendering?

Thank you for your help.

Coder for life

Advertisement

I think that if you want to do that, you need to render two triangles of the size of the screen, otherwise you can use the glClear color to do that. I also recommend you to take a look to this http://duriansoftware.com/joe/An-intro-to-modern-OpenGL.-Chapter-1:-The-Graphics-Pipeline.html

Pay special attention to the rasterizing part, that would help you to understand better how it works

Thank you Diego for your answer. It's exactly what I did, using a face that match the screen but I was curious to know if it's possible to manipulate directly the framebuffer in shaders.

Thank you also for the link I will read it to have better knowledge on the pipeline.

 

Coder for life

You can use a single triangle with doubled side-lengths containing the whole screen and some outside, it will be clipped automatically and is a bit better than 2.

Though, for just a single color use glClear, as said above, because it doesn't need a shader.

This topic is closed to new replies.

Advertisement