How to render a radial field in OpenGL?

OpenGL: When you mention forward rendering, does it only apply on how the light is render on a particular object regardless those objects are on screen or off screen?

  • Answer:

    As I understand it, the term forward rendering is used to distinguish it from deferred rendering. (aka deferred shading) The computations which determine which parts of a surface are visible, are now usually faster and cheaper to perform than the texturing and lighting of those surfaces. Given that cost difference, it makes sense to only apply shading and lighting to those surfaces which appear in the final image, this avoids the wasted effort of lighting surfaces which are obscured. In deferred rendering solutions, an initial rendering pass is performed which resolves what is visible, and collates the positions, normals etc for each pixel in the frame.  Having done that, a second pass applies the texturing and lighting to those visible pixels.  Forward rendering is the old-school method, where all graphical primitives are rendered out, and shading calculations may be invested in surfaces which might ultimately be obscured at a later point. The right solution depends on the scene. The PowerVR GPUs which are used in mobile devices, implement deferred shading in hardware.  The screen is rendered as a set of tiles. And in processing a tile, the processor first resolves visibility, before running fragment shaders on the visible sub-pixels. Don't confuse this with forward ray-tracing, where light rays are traced from the source and may eventually reach the virtual camera.

Glyn Williams at Quora Visit the source

Was this solution helpful to you?

Other answers

Offscreen primitives are irrelevant, both forward and deferred rendering are applied to primitives that are on screen. In the graphics pipeline, the clipping process determines which primitives are on screen and will be rasterized. Offscreen primitives are not rasterized, and fragment shaders are not executed for them. The difference is that deferred rendering only performs the most expensive lighting computations for (opaque) objects that are visible in z-depth. In forward rendering each fragment that passes the z-test will incur the complete lighting computation even if it is later obscured. This is why z-prepass and front to back rendering are important to cull the number of fragments. One motivation for this question may be the process of light selection. For both techniques, the set of lights must be selected. A light may be offscreen, but affects objects on screen. For forward based, lights are selected per primitive. But for deferred, generally the bounding boxes of each light are intersected within the current view frustum. The beauty of deferred is that you don't have to determine which light affects which primitive, since its is applied to the z-nearest per fragment components in the gbuffers. EDIT: I originally wrote that you needed primitive selection for deferred that was incorrect.

Calvin Hsu

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.