Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is a renderpass?

Tags:

opengl

3d

I'm currently trying to learn to use uniform buffers and instanced rendering.
I know the concept of both, but in each Tutorial I read the term "renderpass" or "draw-call" comes up.
Can someone explain to me what that means in Programming terms? is it each time and individual object, Mesh is drawn?
is it each time a shader is executed?
So what exactly is a renderpass? Is it the same as a draw call?
Is it maybe basicly this?:

Gl_Color(xyz);
gl_uniform("a",1);
gl_uniform("a",1);
gl_uniform("a",1);
//I know this is deprected as balls, but just to help me understand
Gl_Begin(GL_VERTEX_STRIP);
GL_Vertex(xyz);
GL_TEXCOORD(xy);
GL_End();
like image 618
user2741831 Avatar asked Dec 20 '15 15:12

user2741831


1 Answers

The term "Draw call" means exactly what it says: calling any OpenGL function of the form gl*Draw*. These commands cause vertices to be rendered, and kick off the entire OpenGL rendering pipeline.

So if you're drawing 5000 instances with a single glDrawElementsInstanced call, that's still just one draw call.

The term "render pass" is more nebulous. The most common meaning refers to multipass rendering techniques.

In multipass techniques, you render the same "object" multiple times, with each rendering of the object doing a separate computation that gets accumulated into the final value. Each rendering of the object with a particular set of state is called a "pass" or "render pass".

Note that a render pass is not necessarily a draw call. Objects could require multiple draw calls to render. While this is typically slower than making a single draw call, it may be necessary for various reasons.

Techniques like this are generally how forward rendering works with multiple lights. Shaders would typically be designed to only handle a single light. So to render multiple lights on an object, you render the object multiple times, changing the light characteristics to the next light that affects the object. Each pass therefore represents a single light.

Multipass rendering over objects is going out of style with the advent of more powerful hardware and deferred rendering techniques. Though deferred rendering does make multiple passes itself; it's just usually over the screen rather than individual objects.

This is only one definition of "render pass". Depending on the context, the tutorial you're looking at could be talking about something else.

like image 175
Nicol Bolas Avatar answered Oct 08 '22 22:10

Nicol Bolas