The Graphics Pipeline and OpenGL

The Graphics Pipeline and OpenGL

The synthetic camera model

  • Two components of viewing
    • Set of geometric objects that form content of the scene
    • Viewer through which the scene is imaged

The graphics pipeline

Primitives->Geometry processor->Rasterizer->Fragment processor->Frame buffer

The geometry processor

  • Transforms primitves to the camera’s coordinate system, prepares them for rasterization
  • Culls primitives facing away from the camera or lying outside the view frustum

The rasterizer

  • Generates fragments(proto-pixels)

Fragment processor

  • Check if fragments are visible
  • Determines color
  • All fragments treated identically, irrespective of the original primitive

Frame buffer

  • Memory buffer used for the construction of the image.
  • Not all data that passes through the frame buffer is displayed. It is like a sandbox in which the image is constructed.
  • Used by the window system for display

Double buffering

这里写图片描述

  • Render into the back buffer while the window system points to the front buffer. When the next frame is assembled, swap.
  • Avoid terrible visual artifacts

Double buffering

这里写图片描述

  • Render into the back buffer while the window system points to the front buffer. When the next frame is assembled, swap.
  • Avoid terrible visual artifacts.

Advantages and disadvantages of pipeline model

  • Great fro parallel processing
    • Primitives processed independently
    • Fragments processed independently
  • Does not support interaction between multiple object in the scene
  • Global illumination,shadows,reflection,refraction

Global illumination

  • Consider indirect illumination that is transmitted by means of other objects
  • Primitives are no longer independent

Ray tracing

  • Rays are cast from the viewpoint and followed recursivley through the scene
  • Whitted ray tracing: Compute direct illumination from light sources at every point hit by traced rays.

Radiosity

  • Discretize scene into pathes. Compute strength of interaction between patches.
  • Shoot light from source patches, deposit in other patches. iterate until light is absorbed.

Photon mapping

  • Stage 1: Trace photons from light sources and deposit onto photon map when photons interact with diffuse surfaces.
  • Stage 2: Cast rays from viewpoint and estimate radiance

Design considerations for OpenGL

Separation of content and viewer

  • Separates object description from viewer specification
  • Two types of function
    • Describe objects in the world (the input)
    • Specify how the object should be processed for constructing an image (the state)

OpenGL is a state machine

  • State machine with input and outputs
    • Input is geometric object, output is a set of pixels
    • State machine converts a collection of geometric objects in three dimensions to an image. This process is controlled by the state.
    • State specifies how objects are projected onto the image plane, how the are colored, etc.
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值