Skip to content

Instantly share code, notes, and snippets.

@Gumball12
Last active March 18, 2019 11:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Gumball12/fca59c8e30773ccc618233500bf90ab1 to your computer and use it in GitHub Desktop.
Save Gumball12/fca59c8e30773ccc618233500bf90ab1 to your computer and use it in GitHub Desktop.
opengl assignments

Video Controller

Figure 2-26 shows a commonly used organization for raster systems.

그림 2-26은 일반적으로 사용되는 raster system의 구조를 보여준다.

A fixed area of the system memory is reserved for the frame buffer, and the video controller is given direct access to the frame-buffer memory.

system memory에 frame buffer를 위한 고정된 영역을 예약해 놓고, Video controller가 이 frame-buffer memory에 직접 접근하는 것이다.

Frame-buffer locations, and the corresponding screen positions, are referenced in Cartesian coordinates.

frame buffer의 위치에 해당하는 screen 위의 위치(좌표)는 '데카르트 좌표(직교 좌표)'로 그려진다(참조된다).

For many graphics monitors, the coordinate origin is defined at the lower left screen corner (Fig. 2-27).

많은 그래픽 모니터에서 좌표의 원점은 화면 좌측 맨 아래에 정의된다 (그림 2-27).

The screen surface is then represented as the first quadrant of a two-dimensional system, with positive x values increasing to the right and positive y values increasing from bottom to top.

화면의 표면은 2차원 (좌표)계의 첫 번째 사분면으로 표현되며, 양수 x는 오른쪽으로 증가하고 양수 y는 아래에서 위로 증가한다.

(On some personal computers, the coordinate origin is referenced at the upper left corner of the screen, so the y values are inverted.)

(일부 PC에서는 좌측 상단에서부터 좌표 원점이 시작(참조)되는데, 이 때의 y값은 반전된다.)

Scan lines are then labeled from y_{max} at the top of the screen to 0 at the bottom.

scan line은 화면의 가장 위에서 가장 아래까지 y_{max}에서부터 0으로 표기된다.

Along each scan line, screen pixel positions are labeled from 0 to x_{max}.

각각의 scan line을 따라서는, 화면의 픽셀 위치가 0부터 x_{max}로 표기된다.

그림 2-26은 일반적으로 사용되는 raster system의 구조를 보여줍니다. system memory에 frame buffer를 위한 고정된 영역을 예약해 놓고, 이를 통해 Video controller가 frame buffer 메모리에 직접적으로 접근하는 것입니다.

frame buffer의 위치에 해당하는 screen 위의 좌표는 데카르트 좌표를 이용해 그려집니다. 많은 그래픽 모니터에서 좌표의 원점은 화면 좌측 맨 아래에 정의되며(그림 2-27), x는 오른쪽 방향으로 증가하고 y는 위쪽 방향으로 증가하는 2차원 좌표계의 첫 번째 사분면으로 표현됩니다. (일부 PC에서는 좌측 상단에 이 원점이 정의되는데, 이 때는 y값이 반전됩니다.) scan line은 화면의 가장 위에서 아래까지 y_{max}부터 0으로 표기되고, 각각의 scan line을 따라 나열된 픽셀의 위치는 0부터 x_{max}로 표기됩니다.

=

In Fig. 2-28, the basics refresh operations of the video controller are diagrammed.

그림 2-28은 가장 기초적인 Video controller의 새로고침 방법을 다이어그램으로 나타낸 것이다.

Two registers are used to store the coordinates of the screen pixels.

두 개의 레지스터를 이용해 화면 위 픽셀에 대한 좌표를 저장한다.

Initially, the x register is set to 0 and the y register is set to y_{max}.

초기에, x 레지스터에는 0이 y레지스터에는 y_{max}가 저장된다.

The value stored in the frame buffer for this pixel position is then retrieved and used to set the intensity of the CRT beam.

이 frame buffer에 저장되어있는 픽셀 위치에 대한 값을 다시 불러와 CRT 빔의 세기를 설정하는데 사용한다.

Then the x register is incremented by 1, and the process repeated for the next pixel on the top scan line.

그리고 x 레지스터가 1 증가하며, 가장 위 scan line의 다음 픽셀에 대해 프로세스가 반복된다.

This procedure is repeated for each pixel along the scan line.

이러한 과정은 scan line을 따라 각각의 픽셀에 대해 반복된다.

After the last pixel on the top scan line has been processed, the x register is reset to 0 and the y register is decremented by 1.

이후 가장 위 scan line의 마지막 픽셀의 프로세스가 끝나면, x 레지스터는 0으로 재설정되며 y 레지스터는 1이 감소한다.

Pixels along this scan line are then processed in turn, and the procedure is repeated for each successive scan line.

scan line을 따라 픽셀을 차례대로 처리하고, 각각의 연속적인 scan line에 대해 이러한 과정을 반복한다.

After cycling through all pixels along the bottom scan line (y = 0), the video controller resets the registers to the first pixel position on the top scan line and the refresh process starts over.

맨 아래(y = 0) scan line까지 모든 픽셀을 순환했다면, Video Controller는 맨 위 scan line의 첫 번째 픽셀로 레지스터를 초기화시키고 새로 고침 프로세스를 다시 시작한다.

그림 2-28은 가장 기초적은 Video controller의 '새로고침 프로세스'를 다이어그램으로 나타낸 것입니다. 두 개의 레지스터(x, y)를 이용해 화면 위 픽셀에 대한 좌표를 저장하는데, 초기에는 x 레지스터에 0을, y 레지스터는 y_{max}로 설정합니다. 이 값들을 이용해 frame buffer에 저장되어있는 값을 불러와 CRT 빔의 세기를 설정한 다음, x 레지스터의 값을 1 증가시키며 scan line을 따라 모든 픽셀에 대해 이 과정을 반복하는 것입니다. 해당 scan line의 마지막 픽셀까지 이 과정을 진행했다면, x 레지스터는 0으로 재설정하고 y 레지스터는 1 감소시킨 뒤, 다시 이 과정을 반복합니다. 이후 맨 아래(y = 0) scan line까지 모든 픽셀에 대해 이 과정을 모두 끝마쳤면, Video controller는 맨 위 scan line의 첫 번째 픽셀로 레지스터를 초기화시킨 다음 이 '새로고침 프로세스'를 다시 시작합니다.

Raster Scan Displays

The most common type of graphics monitor employing a CRT is the raster-scan display, based on television technology.

일반적으로 CRT를 사용하는 그래픽 모니터를 (TV 기술을 기반으로 구현된) raster-scan 디스플레이라고 한다.

In a raster-scan system, the electron beam is swept across the screen, one row at a time from top to bottom.

raster-scan 시스템에서는, 전자빔이 각각의 줄(row)에 대해 위에부터 아래로 화면을 가로지르며 휩쓸고 간다.

As the electron beam moves across each row, the beam intensity is turned on and off to create a pattern of illuminated spots.

전자빔이 각각의 줄을 가로지를 때, 빔의 밝기가 꺼지거나 켜짐으로써 어떠한 지점(점)을 밝히는 패턴을 만든다.

Picture definition is stored in a memory area called the refresh buffer or frame buffer.

(이렇게 만들어진) 화면은 refresh buffer 또는 frame buffer라 불리는 메모리 영역에 저장된다.

This memory area holds the set of intensity values for all the screen points.

이 메모리 영역은 화면 위 모든 지점(점)에 대한 밝기를 저장하고 있다.

Stored intensity values are then retrieved from the refresh buffer and "painted" on the screen on row(scan line) at a time.

이렇게 refresh buffer에 저장된 밝기 값들은 다시 화면에 그릴 때 사용된다(회수된다). (이 때, 각각의 줄을 주사선(scan line) 이라고 함)

Each screen point is referred to as a pixel or pel (shortened forms of picture element).

각각의 화면 위의 점들은 pixel 또는 줄여서 pel(picture element) 이라고 한다.

The capability of a raster-scan system to store intensity information for each screen point makes it well suited for the realistic display of scenes containing subtle shading and color patterns.

raster-scan 시스템은 이렇게 밝기 정보들을 저장할 수 있는 능력이 있기에, 화면 위 각각의 점들에 대해 곳에 사실적이고 미묘한 셰이딩과 컬러 패턴을 표현하는데에 적합하다.

Home television sets and printers are examples of other systems using raster-scan methods.

집에 있는 텔레비전이나 프린터들이 바로 이 raster-scan 을 사용하는 시스템이라고 할 수 있다.

일반적으로 CRT를 사용하는 그래픽 모니터를 raster-scan 디스플레이라고 한다. raster-scan 구조에서는 전자빔이 각각의 줄(scan line, 주사선)에 대해 위에서부터 아래로 가로지르며 지나가는데, 이 때 빔의 밝기가 꺼지거나 켜짐으로써 어떠한 점을 나타내는 패턴을 만들게 된다. 참고로 여기서 '점'은 pixel 또는 줄여서 pel(picture element)라고 한다. 이렇게 구성되는 화면 위 모든 점(pixel)은 refresh buffer 또는 frame buffer라 불리는 메모리 영역에 저장되며, 이렇게 저장된 값들은 다시 화면에 그릴 때 사용된다.

이 raster-scan 시스템은 이렇게 밝기 정보를 저장할 수 있기에 화면 위 각각의 점들에 대해 사실적이고 미묘한 셰이딩과 컬러 패턴을 표현할 수 있다. 가령 집의 텔레비전이나 프린터들이 바로 이 raster-scan을 사용하는 것이라 할 수 있다.


Intensity range for pixel positions depends on the capability of the raster system.

픽셀의 위치에 따른 밝기의 범위는 raster 시스템의 성능에 따라 달라진다.

In a simple black-and-white system, each screen point is either on or off, so only one bit per pixel is needed to control the intensity of screen positions.

간단한 흑백 시스템의 경우, 각각의 화면 위 점은 켜거나 끄기만 하면 되기에, 화면의 밝기를 나타내기 위해서는 픽셀 당 1bit만 필요하다.

For a bilevel system, a bit value of 1 indicates that the electron beam is to be turned on at that position, and a value of 0 indicates that the beam intensity is to be off.

'bi-level system'(두 개의 색만을 나타낼 수 있는 시스템 [1])의 경우, 1 값을 갖는 bit는 해당 위치가 켜져있음을 의미하며, 0 값을 갖는 bit는 해당 위치가 꺼져있음을 의미한다.

Additional bits are needed when color and intensity variations can be displayed.

색상이나 강도의 변화를 나타내기 위해서는 추가적인 bit가 더 필요하다.

Up to 24 bits per pixel are included in high-quality systems, which can require several megabytes of storage for the frame buffer, depending on the resolution of the system.

픽셀 당 최대 24bit를 포함하고 있는 고품질 시스템에서는 MB 단위의 저장 공간이 필요할 수도 있다.

A system with 24 bits per pixel and a screen resolution of 1024 by 1024 require 3 megabytes of storage for the frame buffer.

픽셀 당 24bit인 시스템에서는 1024 x 1024의 화면을 나타내기 위해 3MB의 frame buffer가 필요하다.

On a black-and-white system with one bit per pixel, the frame buffer is commonly called a bitmap.

픽셀 당 1bit를 갖는 흑백 시스템에서는 일반적으로 frame buffer를 'bitmap' 이라고 한다.

For systems with multiple bits per pixel, the frame buffer is often referred to as a pixmap.

픽셀당 두 개 이상의 bit를 갖는 시스템에서는 종종 frame buffer를 'pixmap' 이라고 한다.

픽셀의 위치에 따른 밝기위 범위는 raster system의 성능에 따라 달라지게 된다.

간단한 흑백 시스템의 경우, 각 화면 위 점은 그냥 켜겨나 끄는 것만 표시하면 되기에, 화면의 밝기를 나타내기 위해서는 픽셀 당 1bit만 필요하다. 예를 들어 1bit면 켜진 것이고, 0bit면 꺼진 것이라고 생각할 수 있을 것이다. 여기서 색상이나 강도의 변화를 나타내기 위해서는 추가적인 bit가 더 필요하다. 픽셀 당 최대 24bit의 정보를 포함하고 있는 시스템에서는 MB 단위의 저장 공간이 필요하곤 한데, 가령 픽셀 당 24bit가 필요하다고 했을 때 1024 x 1024의 화면을 나타내기 위해서는 3MB의 frame buffer가 필요하다.

frame buffer는 종종 시스템에 따라 이름이 달라지는데, 픽셀 당 1bit를 갖는 흑백 시스템에서는 'bitmap'. 픽셀당 두 개 이상의 bit를 갖는 시스템에서는 'pixmap'이라고 불리곤 한다.

[1]: WhatIs, "bi-level image", https://whatis.techtarget.com/definition/bi-level-image (Sep, 2005)


Refreshing on raster-scan displays is carrid out at the rate of 60 to 80 frames per second, although some systems are designed for higher refresh rates.

raster-scan 방식은 초당 60에서 80프레임으로 새로고침되며, 일부 시스템에서는 그 이상의 속도로 새로고침되도록 디자인되기도 한다.

Sometimes, refresh rates are described in units of cycles per second, or Hertz(Hrz), where a cycle corresponds to one frame.

종종 초당 사이클 수 또는 Hz로 이 새로고침 빈도가 표기된다. 참고로 여기서 '사이클'은 하나의 프레임을 의미한다.

Using these units, we would describe a refresh rate of 60 frames per second as simple 60 Hz.

위와 같은 방법을 사용하면, 프레임이 초당 60번 새로고침 되는 것을 그냥 간단히 60Hz로 표기할 수 있다.

At the end of each scan line, the electron beam returns to the left side of the screen to begin displaying the next scan line.

전자빔이 각각의 Scan line 끝에 도달하면, 다음 scan line 왼쪽 끝으로 되돌아간다.

The return to the left of the screen, after refreshing each scan line, is called the horizontal retrace of the electron beam.

이렇게 각각의 scan line에서 새로고침 된 후에 화면의 왼쪽 끝으로 되돌아가는 것을 전자빔의 'Horizontal Retrace' 라 한다.

And at the end of each frame (displayed in 1 / 80 th to 1 / 60 th of a second), the electron beam return(vertical retrace) to the top left corner of the screen to begin the next frame.

그리고 각각의 프레임이 끝나는 시점(디스플레이 된 지 1/80 ~ 1/60초가 지난 후)에, 전자빔은 다음 프레임을 표시하기 위해 왼쪽 상단으로 다시 되돌아간다. (이를 vertical retrace라고 함)

raster-scan 방식은 초당 60~80 프레임으로 새로고침(refresh)되며, 일부 시스템에서는 그 이상의 속도로도 새로고침되도록 디자인되기도 한다. 종종 이 새로고침 빈도는 '초당 사이클 수' 또는 'Hz' 기호로 표기된다. 참고로 여기서 '사이클'은 하나의 프레임을 의미한다. 이와 같은 표기법을 이용하면 프레임이 초당 60번 새로고침 되는 것을 그냥 간단히 60Hz로 표기할 수도 있다.

전자빔은 각각의 Scan line 끝에 도달하면, 다음 scan line 왼쪽 끝으로 되돌아가는데, 이를 전자빔의 'Horizontal Retrace' 라고 한다. 그리고 각각의 프레임이 끝나는 시점에 전자빔은 다음 프레임을 표시하기 위해 왼쪽 상단으로 되돌아가는데, 이를 전자빔의 'Vertical Retrace' 라고 한다.


On some raster-scan systems (and in TV sets), each frame is displayed in two passes using an interlaced refresh procedure.

일부 raster-scan 시스템(그리고 TV)에서는 각각의 프레임에 대해 두 개의 '얽힌(interlaced)' 새로고침 프로시저를 사용한다.

In the first pass, the beam sweeps across every other scan line from top to bottom.

처음에 빔은 위에서 아래로 하나씩 거르며 scan line을 휩쓸고 간다.

Then after the vertical retrace, the beam sweeps out the remaining scan lines.

이 vertical retrace 과정 이후, 빔은 남아있는 scan line을 휩쓸고 지나간다.

Interlacing of the scan lines in this way allows us to see the entire screen displayed in one-half the time it would have kaen to sweep across all the lines at one from top to bottom.

이러한 방식(interlacing of the scan lines)을 사용하면 위에서 아래로 화면을 나타내는데 소요되는 시간의 절반 만으로도 전체적인 모습을 볼 수 있게 된다.

Interlacing is primarily used with slower refreshing rates.

주로 이 interlacing 방식은 느리게 새로고침되는 곳에서 사용된다.

On an older, 30 frame-per-second, non-interlaced display, for instance, some flicker is noticeable.

가령 interlacing 방식을 사용하지 않는 초당 30번의 프레임을 나타내는 디스플레이에서는 약간의 깜빡거림이 나타날 수 있지만.

But with interlacing, each of the two passes can be accomplished in 1 / 60 th of a second, which brings the refresh rate nearer to 60 frames per second.

interlacing 방식을 사용하게 되면, 두 개의 패스를 각각 1 / 60초 동안 (출력)작업을 하도록 할 수 있기에 초당 60번에 가깝게 프레임을 새로고침할 수 있게 된다.

This is and effective technique for avoiding flicker, providing that adjacent scan lines contain similar display information.

이는 scan line에 인접한 화면 정보가 비슷한 경우 깜빡이는 현상을 피할 수 있는 효과적인 방법이다.

일부 raster-scan 시스템(그리고 TV)에서는 각각의 프레임에 대해 두 개의 '얽힌(interlaced)' 새로고침 프로시저를 사용한다. 빔이 처음에 위에서 아래로 하나씩 거르며 scan line을 휩쓸고 지나간 뒤, 다시 남아있는 scan line을 휩쓸고 지나가는 방식이 바로 interlacing 방식이다. 이러한 방식을 사용하게 되면 위에서 아래로 화면을 나타내는데 소요되는 시간의 절반 만으로도 전체적인 모습을 볼 수 있게 된다.

주로 이 interlacing 방식은 프레임이 느리게 새로고침되는 곳에서 사용된다. 가령 초당 30번의 프레임을 나타내는 디스플레이에 대해 interlacing 방식을 사용하지 않는 경우 약간의 깜빡거림이 나타날 수 있으나, interlacing 방식을 사용하게 되면 두 개의 패스를 이용해 초당 60번에 가깝게 프레임을 새로고침 할 수 있다. 유의할 것은 이 방법으로 깜빡이는 현상을 제거할 수는 있지만, 각각의 scan line에 인접한 정보가 비슷해야 효과적으로 사용될 수 있다는 것을 알아두자.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment