OpenGLES Programming Guide for iOS 번역 - OpenGL ES에 대해

OpenGL ES/iOS 2011. 9. 9. 21:08
본 번역은 얼마든지 정확하지 않을 수 있습니다. 참고용으로만 보시길... ^^;;;

OpenGL ES에 대해


The Open Graphics Library (OpenGL) is used for visualizing 2D and 3D data. It is a multipurpose open-standard graphics library that supports applications for 2D and 3D digital content creation, mechanical and architectural design, virtual prototyping, flight simulation, video games, and more. OpenGL allows application developers to configure a 3D graphics pipeline and submit data to it. Vertices are transformed and lit, assembled into primitives, and rasterized to create a 2D image. OpenGL is designed to translate function calls into graphics
commands that can be sent to underlying graphics hardware. Because this underlying hardware is dedicated to processing graphics commands, OpenGL drawing is typically very fast.

OpenGL for Embedded Systems (OpenGL ES) is a simplified version of OpenGL that eliminates redundant functionality to provide a library that is both easier to learn and easier to implement in mobile graphics hardware.
Open Graphics Library(OpenGL)는 2D 및 3D 데이터를 시각화하는 데 사용합니다. OpenGL 은 개방형 표준에 기반한 다목적 그래픽 라이브러리에서 2D 및 3D 디지털 콘텐츠 작성, 기계 설계 및 건축 설계, 가상 프로토 타이핑, 비행 시뮬레이션, 비디오 게임 등의 애플리케이션을 지원합니다. OpenGL을 사용하여 응용 프로그램 개발자는 3D 그래픽 파이프라인을 설정하고 파이프라인에 데이터를 전송 할 수 있습니다. 정점은 변형 및 라이팅되어 원시적으로 조립 프로젝터에 래스터화된 2D 이미지가 생성됩니다. OpenGL 함수 호출을 기본 그래픽 하드웨어에 보낼 수있는 그래픽 명령으로 변환하도록 설계되고 있습니다. 이 기 반 하드웨어 그래픽 명령 처리 전용 때문에 OpenGL 의 렌더링은 일반적으로 매우 높은 속도입니다.

OpenGL for Embedded Systems (OpenGL ES) 는 OpenGL 의 중복 기능을 제거한 단순 버전에서 OpenGL 보다 기억하기 쉽고, 모바일 그래픽 하드웨어에 구현 가능한 라이브러리를 제공합니다.


개요
Apple은 OpenGL ES 1.1 및 OpenGL ES 2.0의 두가지 구현을 제공합니다.

OpenGL ES 1.1 implements a well-defined fixed-function pipeline. The fixed-function pipeline implements a traditional lighting and shading model that allows each stage of the pipeline to be configured to perform specific tasks, or disabled when its functionality is not required.
- OpenGL ES 1.1은 명확하게 정의된 고정 기능 파이프라인을 구현합니다. 고정 기능 파이프라인은 기존의 조명과 음영 모델을 구현하고 있습니다. 이 모델은 파이프라인의 각 단계를 특정 작업을 수행하도록 설정하거나 기능이 불필요한 경우 사용하지 않도록 할 수 있습니다.

- OpenGL ES 2.0 shares many functions in common with OpenGL ES 1.1, but removes all functions that target the fixed-function vertex and fragment pipeline stages. Instead, it introduces new functions that provide access to a general-purpose shader-based pipeline. Shaders allow you to author custom vertex and fragment functions that are executed directly on the graphics hardware. With shaders, your application can more precisely and more clearly customize the inputs to the pipeline and the computations that are performed on each vertex and fragment.
- OpenGL ES 2.0은 많은 기능(함수)을 OpenGL ES 1.1과 공유하지만, 고정 기능 파이프라인의 정점과 조각에 대한 단계를 대상으로 하는 모든 함수가 제거 되었습니다. 대신 OpenGL ES 2.0은 쉐이더 기반과 범용 파이프라인에 대한 액서스를 제공하는 새로운 기능을 채용하고 있습니다. 쉐이더를 사용하면 그래픽 하드웨어에서 직접 실행되는 자동 정점 함수와 조각 함수를 만들 수 있습니다. 쉐이더에 의해 응용 프로그램은 파이프라인의 입력 및 각 꼭지점과 각 조각에 대해 실행되는 연산을 더 정확하게, 그리고 더 명확하게 사용자 정의할 수 있습니다.

OpenGL ES는 플랫폼에 의존하지 않는 C언어 기반의 API (OpenGL ES is a C-based, Platform-Neutral API )
Because OpenGL ES is a C-based API, it is extremely portable and widely supported. As a C API, it integrates seamlessly with Objective-C based Cocoa Touch applications. The OpenGL ES specification does not define a windowing layer; instead, the hosting operating system must provide functions to create an OpenGL ES rendering context, which accepts commands, and a framebuffer, where the results of any drawing commands are written to.
OpenGL ES는 C언어 기반의 API이기 때문에 이식성이 매우 높고, 폭넓게 지원을 합니다. OpenGL ES는 C언어의 API로 Objective-C 기반의 Cocoa Touch 응용 프로그램과 완벽하게 통합합니다. OpenGL ES의 사양은 윈도우 계층을 정의하지 않고 호스트 운영체제가 OpenGL ES 렌더링 컨텍스트(명령을 접수) 및 프레임 버퍼(그리기 명령의 결과를 기록하는 위치)를 만드는 함수를 제공 해야 합니다.

OpenGL ES와 Core Animation 통합 (OpenGL ES is Intergrated into Core Animation)
Core Animation is fundamental to iOS graphics, and that includes OpenGL ES content that your application delivers to the screen. When you develop an OpenGL ES application, your OpenGL ES content is rendered to a special Core Animation layer, known as a CAEAGLLayer object. The images you render using OpenGL ES are stored in the CAEAGLLayer. Core Animation composites these images with content in other layers and delivers the final image to the screen.
Cocoa Animation은 iOS 그래픽의 토대가 되는 것으로, 응용프로그램이 화면에 제공하는 OpenGL ES 내용이 포함되어 있습니다.
OpenGL ES를 개발하는 경우 OpenGL ES 내용은 CAEAGLLayer 객체라는 특별한 Core Animation 레이어 렌더링 됩니다. OpenGL ES를 사용하여 렌더링된 이미지는 CAEAGLLayer에 저장됩니다. Core Animaton은 이러하 ㄴ이미지와 다른 레이어에 저장된 콘텐츠와 합성하여 최종 이미지를 화면에 제공합니다.

프레임 버퍼 개체가 항상 렌더링의 대상 (Framebuffer Ojbects are Always the Rendering Destination)
The OpenGL ES specification assumes there are two kinds of framebuffers: system-provided framebuffers and framebuffer objects. A system framebuffer is allocated using an API provided by the host operating system, and connects to the screen or windowing environment. In contrast, framebuffer objects target offscreen rendering and fully supported within the OpenGL ES specification. iOS only uses framebuffer objects; rather than create a separate system framebuffer, iOS extends the OpenGL ES API to allow a framebuffer
object to be allocated so that its contents are shared with Core Animation.
OpenGL ES의 사양은 시스템에 포함되어 있는 프레임 버퍼와 프레임 버퍼 오브젝트라는 2종류의 프레임 버퍼가 존재하는 것을 전제로 하고 있습니다. 시스템 프레임 버퍼는 호스트 운영 체제가 제공하는 API를 사용하여 할당 화면 또는 윈도우 환경에 연결합니다. 한편, 프레임 버퍼 객체는 오프 스크린 렌더링을 대상으로 하고 있으며, OpenGL ES 사양에서 완벽하게 지원되고 있습니다. iOS 프레임 버퍼 객체를 사용합니다. iOS는 독립적인 시스템 프레임 버퍼를 작성하는 대신 OpenGL ES API를 확장하여 콘텐츠 Core Animation과 공유 되도록 프레임 버퍼 객체를 할당할 수 있도록 합니다.

기능은 장치에 따라 (Functionality May Vary on Different Devices) 
iOS devices support a variety of graphics processors with varying capabilities. Some devices support both OpenGL ES 1.1 and OpenGL ES 2.0; older devices only support OpenGL ES 1.1. Even devices that support the same version of OpenGL ES may have different capabilities depending on the version of iOS and the underlying graphics hardware. Apple offers many OpenGL ES extensions to provide new capabilities to your applications.

To allow your application to run on as many devices as possible and to ensure compatibility with future devices and iOS versions, your application must always test the capabilities of the underlying OpenGL ES mplementation at run time, disabling any features that do not have the required support from iOS.
iOS 장치는 기능이 다른 다양한 그래픽 프로세서에 대응하고 있습니다. 일부 장치는 OpenGL ES 1.1 및 OpenGL ES 2.0을 모두 지원하고 있습니다. 오래된 장치는 OpenGL ES 1.1만 대응하고 있습니다. 장치는 OpenGL ES의 동일한 버전에 해당하는 경우에도 iOS 버전 및 기본 그래픽 하드웨어에 따라 기능이 다를 수 있습니다. Apple은 많은 OpenGL ES 확장 기능을 제공하여 응용프로그램에 새로운 기능을 제공합니다.

응용프로그램을 가능한 한 많은 장치에서 실행할 수 있도록 하거나, 향후 등장하는 장치 또는 iOS 버전과의 호환성을 확보하는 데 기반이 되는 OpenGL ES 구현 기능을 iOS에 따라 지원이 필수가 아닌 기능을 비활성화 한 상태에서 실행시 반드는 테스트를 해야 합니다.

응용 프로그램에 필요한 추가 성능 튜닝 (Application Require Additional Performance Tuning)
Graphics processors are parallelized devices optimized for graphics operations. To get great performance in your application, you must carefully design your application to feed data and commands to OpenGL ES so that the graphics hardware runs in parallel with your application. A poorly tuned application forces either the CPU or the GPU to wait for the other to finish processing commands.

You should design your application to efficiently use the OpenGL ES API. Once you have finished building your application, use Instruments to fine tune your application’s performance. If your application is bottlenecked inside OpenGL ES, use the information provided in this guide to optimize your application’s performance.

Xcode 4 provides new tools to help you improve the performance of your OpenGL ES applications.
그래픽 프로세서는 그래픽 작업에 최적화된 병렬 처리 장치 입니다. 애플리케이션에 뛰어난 성능을 발휘하기 위해서는 그래픽 하드웨어가 응용 프로그램과 병행해서 작동하도록 응용 프로그램을 신중하게 설계하여 데이터와 명령을 OpenGL ES에 제공해야 합니다. 최적화가 충분하지 않은 응용 프로그램 하나가 명령 처리를 완료할 때까지 CPU 또는 GPU 중 하나를 대기 시킬수 있습니다.

OpenGL ES API를 효율적으로 사용하여 응용 프로그램을 설계하십시오. 응용 프로그램 빌드가 완료되면 Instruments를 사용하여 응용프로그램의 성능을 최적화 합니다. OpenGL ES에서 응용 프로그램의 병목 현상이 발생하는 경우 본 가이드의 정보를 사용하여 응용 프로그램 성능을 최적화 하십시오.

XCode 4는 OpenGL ES 응용 프로그램의 성능을 향상시키는 새로운 도구를 제공합니다.


백그라운드 응용 프로그램에서 OpenGL ES를 사용할 수 없는 가능성에 대해 (OpenGL ES May Be Used in Background Applications)
Applications that are running in the background may not call OpenGL ES functions. If your application accesses the graphics processor while it is in the background, it is automatically terminated by iOS. To avoid this, your application should flush any pending commands previously submitted to OpenGL ES prior to being moved into the background and avoid calling OpenGL ES until it is moved back to the foreground.
백그라운드에서 실행되는 응용 프로그램은 OpenGL ES 함수를 호출 않을 수 있습니다. 응용 프로그램이 백그라운드 때 그래픽 프로세스에 액세스 하면 iOS 응용 프로그램을 자동으로 종료합니다. 이것을 해결 하려면 백그라운드로 전환 전에 OpenGL ES로 전송 처리되지 않은 명령을 플래시 응용 프로그램이 포그라운드로 돌아가기까지의 사이에 OpenGL ES를 호출하지 않도록 해야 합니다.


OpenGL ES에 의한 다중 스레드 응용 프로그램에 대한 제약 사항 (OpenGL ES Places Additional Restrictions on Multithreaded Applications)
Designing applications to take advantage of concurrency can be useful to help improve your application’s performance. If you intend to add concurrency to an OpenGL ES application, you must ensure that the application does not access the same context from two different threads at the same time.
병렬 처리를 사용하도록 응용 프로그램을 디자인하는 것은 응용 프로그램 성능 향상에 도움이 될 수 있습니다. OpenGL ES 응용 프로그램에 병렬 처리를 추가하려면 응용 프로그램이 다른 2개의 스레드에서 동일한 컨텍스트에 동시에 액세스 하지 않도록  해야 합니다.


: