Ogre3d
OGRE (Object-Oriented Graphics Rendering Engine) is a scene-oriented, flexible 3D engine written in C++ designed to make it easier and more intuitive for developers to produce applications utilising hardware-accelerated 3D graphics. The class library abstracts all the details of using the underlying system libraries like Direct3D and OpenGL and provides an interface based on world objects and other intuitive classes.
Categories
- Ogre:Android - Ogre3D를 Android 플랫폼에 포팅하는 방법.
Features
- Features | OGRE - Open Source 3D Graphics Engine
- 단순한 3D 장면을 렌더링.
- Direct3D 또는 OpenGL의 독립적을 위해 필요한 노력을 최소화하도록 설계뙨 OO 인터페이스를 쉽게 사용할 수 있음.
- 확장 예제 프레임 워크는 응용 프로그램 실행을 신속하고 간단하게 투명성을 다루는 렌더링 상태 관리, 공간적 학살과 같은 일반적인 요구 사항은 당신이 자동으로 귀중한 시간을 절약을 위해 완료함.
- 모든 엔진 클래스의 깨끗하게 정리된 디자인 및 전체 설명서.
- 여러 상용 제품에 사용되는 검증된 안정적인 엔진.
- 정교한 골격 애니메이션 지원.
- 압축 파일에서 메모리 관리 및 로딩을 위한 기능 지원 (ZIP, PK3 파일 지원).
- 유연한 플러그인 아키텍처는 엔진이 재컴파일없이 확장.
- 메모리 누수 식별을 위해 메모리 관리자를 디버깅.
- BSP 맵 지원.
- 범프 맵 지원 (또는 노멀 맵).
Tutorials
이대현(Daehyun Lee) Ogre3D 기초 강좌 번역
암호로 보호되고있는 문서가 존재한다. 암호는 "leedaehyun
" 이다.
- daehyun_lee_-_ogre3d_tutorials-01.pdf - 제01강 ogre3d 엔진 소개
- daehyun_lee_-_ogre3d_tutorials-02.pdf - 제02강 렌더링 프로세스
- daehyun_lee_-_ogre3d_tutorials-03.pdf - 제03강 씬 구성
- daehyun_lee_-_ogre3d_tutorials-04.pdf - 제04강 프레임리스너
- daehyun_lee_-_ogre3d_tutorials-05.pdf - 제05강 스케일링 및 회전
- daehyun_lee_-_ogre3d_tutorials-06.pdf - 제06강 애니메이션
- daehyun_lee_-_ogre3d_tutorials-07.pdf - 제07강 카메라와 뷰포트
- daehyun_lee_-_ogre3d_tutorials-08.pdf - 제08강 사원수와 회전
- daehyun_lee_-_ogre3d_tutorials-09.pdf - 제09강 캐릭터 컨트롤러
- daehyun_lee_-_ogre3d_tutorials-10.pdf - 제10강 광원
- daehyun_lee_-_ogre3d_tutorials-11.pdf - 제11강 gui (i)
- daehyun_lee_-_ogre3d_tutorials-12.pdf - 제12강 게임프레임웍
- daehyun_lee_-_ogre3d_tutorials-13.pdf - 제13강 gui (ii)
- daehyun_lee_-_ogre3d_tutorials-14.pdf - 제14강 gui (iii)
- daehyun_lee_-_ogre3d_tutorials-15.pdf - 제15강 지형,하늘 및 안개의 렌더링
- daehyun_lee_-_ogre3d_tutorials-16.pdf - 제16강 입자 시스템
- daehyun_lee_-_ogre3d_tutorials-17.pdf - 제17강 지형 충돌 처리
- daehyun_lee_-_ogre3d_tutorials-18.pdf - 제18강 ogre 셰이더
Ogre 3D GUIs
- BetaGUI
- buttonGUI
- CEGUI (Crazy Eddie’s GUI)
- Hikari
- libRocket
- MyGUI
- Navi
- QuickGUI
- Right BrainGUI
- Tiny GUI
- TwOgre
Ogre3D MinGW 컴파일 방법
Ogre3D 소스코드를 MinGW로 컴파일 방법에 대하여 설명한다.
컴파일을 위해, Boost, Cg, FreeImage, freetype, OIS, zlib, zziplib 라이브러리가 필요하다.
- Ogre3D 소스코드를 http://bitbucket.org/sinbad/ogre/ 사이트에서 다운받는다.
- Ogre3D 컴파일에 필요한 라이브러리를 사이트에서 다운받는다. (만약, DirectX를 사용할 경우, http://www.microsoft.com/en-us/download/details.aspx?id=6812 에서 DirectX SDK를 다운받는다)
- CMake 다운받는다.
- MinGW 다운받는다.
- boost 다운받는다.
- boost 컴파일한다. 자세한 설치(컴파일)방법은 해당 페이지 참조.
- Navigate to C:\boost
- Open
index.html
and go to "Getting Started" -> "Getting Started on Microsoft Windows" - Follow the steps to build boost from sources. You will most likely want to read section 5.3 "Build Binaries from source". Mind the following:
- Whenever you're supposed to run "bootstrap.bat", run "bootstrap.bat gcc" instead.
- As you are using MinGW, specify gcc as toolset when actually building boost.
- Building boost takes much time. Get a cup of tea.
- If you use the following line to build boost...
b2 --build-dir=C:\boost\build toolset=gcc --build-type=complete stage
... you will end up with a stage folder in C:\boost. Move the lib folder inside the stage folder to C:\boost so that you end up having a C:\boost\lib folder. - If you get a "Duplicate name of actual target" error when building boost, use "minimal" build-type instead of "complete".
BOOST_ROOT
and Boost_DIR
also pointing to C:\boost. - Open the CMake GUI.
- Set "Where is the source code" to C:\Ogre\sources\dependencies.
- Set "Where to build the binaries" to C:\Ogre\building\dep-release. THIS IS NOT the final dependencies folder. It is merely the folder we will use to build the SDK.
- Click "Configure" to init CMake. Select "MinGW Makefiles".
- Based on your setup, CMake may or may not output some errors. Make sure to resolve them before continuing. CMake is usually pretty verbose about what to do. If you are having trouble, you can always ask in our forums, of course . Click "Configure" again until no more errors appear.
- Change
CMAKE_INSTALL_PREFIX
to C:\Ogre\built\dependencies. Click "Generate". - Repeat 3) – 6), this time changing
CMAKE_BUILD_TYPE
to "Debug". Also change the "Where to build the binaries" folder to C:\Ogre\building\dep-debug. - Open a command line in C:\Ogre\building\dep-release and type in "mingw32-make install". This will take a minute or two. Do this also for the debug folder.
- Navigate to C:\Ogre\built\dependencies. Navigate to lib/Release within that folder and copy the cg.lib to lib/Debug. Somehow, the install make misses this.
- Create a new environment variable named
OGRE_DEPENDENCIES_DIR
that points to C:\Ogre\built\dependencies.
- Open the CMake GUI.
- Set "Where is the source code" to C:\Ogre\sources\v1-8.
- Set "Where to build the binaries" to C:\Ogre\building\ogre-release. THIS IS NOT the final SDK folder. It is merely the folder we will use to build the SDK.
- Click "Configure" to init CMake. Select "MinGW Makefiles".
- If CMake did not find the dependencies, set the
OGRE_DEPENDENCIES_DIR
to C:\Ogre\built\dependencies manually. - You can ignore the "
Boost_DIR-NOTFOUND
" if everything else worked well. If you have a look at the vars in "Advanced" CMake mode, you will see that all boost related vars except that one are correct. - Set the
CMAKE_INSTALL_PREFIX
to C:\Ogre\built\ogre-sdk. Click "Configure" again. - If everything worked out, you will get a load of new configurations. Make sure to select
OGRE_STATIC
,OGRE_INSTALL_SAMPLES
andOGRE_INSTALL_DOCS
.- If you want a dynamic build, do not select
OGRE_STATIC
- You can of course select other plugins as you desire, but this tutorial does only "guarantee" to work for the stated ones.
- If you want a dynamic build, do not select
- Click "Configure" again, resolving all problems that might appear, until everything goes well. Click "Generate".
- Repeat 3) – 9), this time changing
CMAKE_BUILD_TYPE
to "Debug". Also change the "Where to build the binaries" folder to C:\Ogre\building\ogre-debug. - Open a command line in C:\Ogre\building\ogre-release and type in "mingw32-make install". This will take some time, so get another cup of tea. Do this also for the debug folder (and get your third cup of tea).
FrameListeners
In Ogre, we can register a class to receive notification before and after a frame is rendered to the screen. That class is known as a FrameListener
. This FrameListener interface declares three functions which can be used to receive frame events:
virtual bool frameStarted(const FrameEvent& evt);
virtual bool frameRenderingQueued(const FrameEvent& evt);
virtual bool frameEnded(const FrameEvent& evt);
frameStarted | Called just before a frame is rendered. |
frameRenderingQueued | Called after all render targets have had their rendering commands issued, but before the render windows have been asked to flip their buffers over. |
frameEnded | Called just after a frame has been rendered. |
So, how does it work?
Let's take a peek at Ogre::Root::renderOneFrame
:
bool Root::renderOneFrame(void)
{
if(!_fireFrameStarted())
return false;
if (!_updateAllRenderTargets())
return false;
return _fireFrameEnded();
}
Here you can see that Ogre::Root
, when rendering a frame, fires a FrameStarted event before updating all render targets. And then fires the FrameEnded
event when it's done updating.
To see where Ogre::Root
fires the FrameRenderingQueued
event, we'll take a look at an excerpt from Ogre::Root::_updateAllRenderTargets
:
bool Root::_updateAllRenderTargets(void)
{
// update all targets but don't swap buffers
mActiveRenderer->_updateAllRenderTargets(false);
// give client app opportunity to use queued GPU time
bool ret = _fireFrameRenderingQueued();
// block for final swap
mActiveRenderer->_swapAllRenderTargetBuffers(mActiveRenderer->getWaitForVerticalBlank());
// more code follows ...
}
Ogre3D + mingw + Eclipse
Ogre3D, MinGW, Eclipse를 연동하는 방법에 대하여 설명한다.
Build Configuration
The gcc C++ compiler and C++ linker have an ocean of possible configuration option. We'll need to set ours up quite carefully, and differently for each one of the Build Configurations (Debug and Release).
- Right-Click your Project in the Left Pane and Click Properties
- Select
C/C++ Build > Settings
on the Left. - Set the Configuration Pull-Down to Release or Debug and in the Tool Settings tab, enter the options from the table below in the appropiate section of the small left tree:
GCC C++ Compiler options
Debug | Release |
Add the following to the Defined Symbols (
| Add the following to the Defined Symbols (
|
Add the following to the Include Paths (
| Add the following to the Defined Symbols (
|
Miscellaneous | |
Put the following in the 'other flags text box:
| Put the following in the 'other flags text box:
|
GCC C++ Linker options
Debug | Release |
Add the following to the libraries (
| Add the following to the libraries (
|
Add the following to the library search path (
| Add the following to the library search path (
|
Miscellaneous. | |
Add the following to the Other Options (
| Add the following to the Other Options (
|
Notes
- Eclipse will build with the Configuration you leave selected. You can also change this under
Project > Active Build Configuration
-
OGRE_HOME
is a pre-defined environment variable setup by the SDK installer.OGRE_HOME
points to the directory where the SDK is installed. You can use${OGRE_HOME}
within your build options when setting up paths to specific directories with the SDK that you will need to access.
Documentation
- Ogre3D Basic Tutorial 1.5
-
Ogre3d-basic_tutorial-1.5.zip
See also
Favorite site
References
-
Ogre-hello_world.pdf ↩