0
\$\begingroup\$

I wanted to write small software renderer that will follow almost the same flow as OpenGL does, but got stuck with understanding of the rendering pipeline. After reading tons of info across the Internet I came to conclusion that the rendering pipeline is part of hardware. What OpenGL does it just delivers data from the app to video memory and tells when pipeline must be executed.

But then I came across the info about rendering pipeline in Unity3D. After that I got confused. If pipeline is "fixed" by hardware then how Unity3D can have it's own rendering pipeline? Is it somehow another layer of abstraction that utilizes the same terminology at app/engine level which means preparing all the resources for hardware pipeline execution? Or the pipeline is orchestrated by OpenGL itself, but the computation is done on the GPU? Or Unity3D uses Vulkan that provides such capability which explains why it's like that? Or maybe I misunderstood the whole concept incorrectly?

\$\endgroup\$
2
  • \$\begingroup\$ A "pipeline" is just a sequence of steps executed in order. We can use the word pipeline to refer to lots of different sequences of steps, including steps performed by hardware, or steps performed by an engine. There is no reason a priori to expect these two uses of the word pipeline need to have any similarity whatsoever, beyond each being sequences of steps related to rendering. \$\endgroup\$
    – DMGregory
    Commented May 7, 2022 at 21:47
  • \$\begingroup\$ @DMGregory, yeah, it’s understandable that pipeline is broad term and can be used anywhere. But the question is whether the rendering pipeline has the same meaning at both levels of abstraction? As for me unity3d is not rendering anything here. It just prepares data to be delivered to the gpu and then GL or hardware is responsible to execute real rendering pipeline \$\endgroup\$
    – Yurii B
    Commented May 7, 2022 at 23:31

1 Answer 1

2
\$\begingroup\$

The graphics APIs specify pipelines because your input data (vertices, indices, shaderprograms, program constants, textures, output buffers) need to undergo many transforms before becoming an output image. Since there is a lot of data, it's all transformed the same way and the output of one stage is the input for the next, it's advantageous to special pipelines rather than individual operations on each primitive (vertex, triangle, pixel).

The graphics APIs such as d3d, opengl, vulkan define low level pipelines. For example, a pixel needs to undergo viewpoint clipping, scissor box clipping, fragment shading, depth test, stencil test, blending. Before it's output.

Engines such as unity specify high level pipelines and work with 3d models, lights, cameras, materials rather than vertices, indices, vertex shaders, fragment shaders and render targets. They build upon the 3d APIs.

Inevitably, many of the low level concepts leak through to the high level engine.

\$\endgroup\$
1
  • \$\begingroup\$ I see. It does make sense. Thank you for clarifying that :). Do you know some resources where it is demonstrated as small examples with different rendering pipeline implementations? The one thing that I can come up is PBR implementation, which I guess is a rendering pipeline as well. Am I right? Thanks one more time :) \$\endgroup\$
    – Yurii B
    Commented May 13, 2022 at 9:12

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .