Skip to content

Commit

Permalink
added svn files
Browse files Browse the repository at this point in the history
  • Loading branch information
rortom committed Apr 10, 2010
0 parents commit 0a00069
Show file tree
Hide file tree
Showing 121 changed files with 18,839 additions and 0 deletions.
66 changes: 66 additions & 0 deletions CMakeDependenciesConfig.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
IF(WIN32)
set(Ogre_INCLUDE_DIRS "include/Ogre" CACHE PATH "The ogre include path to use")
set(Ogre_LIBRARY_DIRS "lib" CACHE PATH "The ogre lib path to use")
set(Ogre_LIBRARIES "OgreMain" CACHE STRING "The ogre lib to link against")
set(Ois_INCLUDE_DIRS "include/ois" CACHE PATH "The OIS include path to use")
set(Ois_LIBRARY_DIRS "lib" CACHE PATH "The OIS lib path to use")
set(Ois_LIBRARIES "ois" CACHE STRING "The ogre lib to link against")
# add includes to check directories
set(CMAKE_REQUIRED_INCLUDES ${Ogre_INCLUDE_DIRS} ${Ois_INCLUDE_DIRS})

# check for libs and include files we want to use
CHECK_INCLUDE_FILE(windows.h HAVE_WINDOWS_INCLUDES)
if(NOT HAVE_WINDOWS_INCLUDES)
message(FATAL_ERROR "could not find the windows platform includes. Please install them.")
endif()

set(BOOST_PATH "C:/Program Files/boost/boost_1_39" CACHE PATH "The BOOST root path to use")
include_directories(${BOOST_PATH})
link_directories (${BOOST_PATH}/lib)
ELSEIF(UNIX)
find_package(PkgConfig)
PKG_CHECK_MODULES (Ogre OGRE REQUIRED)
PKG_CHECK_MODULES (Ois OIS REQUIRED)
# add includes to check directories
set(CMAKE_REQUIRED_INCLUDES ${Ogre_INCLUDE_DIRS} ${Ois_INCLUDE_DIRS})
# check for libs and include files we want to use
# check below not working!?
#CHECK_LIBRARY_EXISTS(libOgreMain.so loadPlugins "" HAVE_OGRE_LIBS)
#if(NOT HAVE_OGRE_LIBS)
# message(FATAL_ERROR "could not link against Ogre, please check of you have the required libraries installed")
#endif()
ENDIF(WIN32)


IF(NOT WIN32)
# XXX TODO: fix the checks for windows!
# add this so the checks work
set(CMAKE_REQUIRED_INCLUDES ${Ogre_INCLUDE_DIRS} ${Ois_INCLUDE_DIRS})

# cross platform checks
# check for libs and include files we want to use
CHECK_INCLUDE_FILE_CXX(OgrePrerequisites.h HAVE_OGRE_INCLUDES)
if(NOT HAVE_OGRE_INCLUDES)
message("could not find the Ogre includes. Please install them.")
endif()

CHECK_INCLUDE_FILE_CXX(OIS/OIS.h HAVE_OIS_DIR_INCLUDES)
if(HAVE_OIS_DIR_INCLUDES)
set(OIS_INCLUDE "OIS/OIS.h")
endif()

CHECK_INCLUDE_FILE_CXX(OIS.h HAVE_OIS_INCLUDES)
if(HAVE_OIS_INCLUDES)
set(OIS_INCLUDE "OIS.h")
endif()

if(NOT HAVE_OIS_DIR_INCLUDES AND NOT HAVE_OIS_INCLUDES)
message("could not find the OIS includes. Please install them.")
endif()

if(HAVE_OIS_DIR_INCLUDES AND NOT HAVE_OIS_INCLUDES)
set(OIS_USING_DIR TRUE)
else()
set(OIS_USING_DIR FALSE)
endif()
endif()
137 changes: 137 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
######################################################################
# PagedGeometry BUILD SYSTEM
# Welcome to the CMake build system for PagedGeometry.
# This is the main file where we prepare the general build environment
# and provide build configuration options.
######################################################################
# cmake system for PagedGeometry updated on the 5th of April by thomas{at}thomasfischer{DOT}biz

cmake_minimum_required(VERSION 2.4)
# loose if - else constructs
SET(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS TRUE)
if(COMMAND cmake_policy)
cmake_policy(SET CMP0003 NEW)
endif(COMMAND cmake_policy)


# add some functions we use that are shipped with cmake
INCLUDE(CheckLibraryExists)
INCLUDE(CheckIncludeFile)
INCLUDE(CheckIncludeFileCXX)
INCLUDE(CheckCCompilerFlag)
INCLUDE(CheckCSourceCompiles)


# define the project
project(PagedGeometry)

# find all dependencies
include(CMakeDependenciesConfig.txt)

# build static libs by default
SET(BUILD_SHARED_LIBS OFF)

# setup paths
SET(RUNTIME_OUTPUT_DIRECTORY "${PagedGeometry_SOURCE_DIR}/bin/")
SET(LIBRARY_OUTPUT_DIRECTORY "${PagedGeometry_SOURCE_DIR}/lib/")
SET(ARCHIVE_OUTPUT_DIRECTORY "${PagedGeometry_SOURCE_DIR}/lib/")
SET(EXECUTABLE_OUTPUT_PATH ${RUNTIME_OUTPUT_DIRECTORY})
SET(LIBRARY_OUTPUT_PATH ${LIBRARY_OUTPUT_DIRECTORY})

# some optimization flags
if(WIN32)
# add multi processor compilation flags
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /MP /GL /Ox /Ob2 /Oi /Ot /Oy /fp:fast /GS- /MP /Zi")
set(CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL} /MP /Zi")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /MP /Od /Zi")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /MP /Od /Zi")
# some general flags
add_definitions("-D_CRT_SECURE_NO_WARNINGS")
include_directories(${DirectX_INCLUDE_DIR})

set(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} /DEBUG /SUBSYSTEM:WINDOWS")
set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} /DEBUG /SUBSYSTEM:WINDOWS /LTCG /OPT:REF")
set(CMAKE_EXE_LINKER_FLAGS_MINSIZEREL "${CMAKE_EXE_LINKER_FLAGS_MINSIZEREL} /DEBUG /SUBSYSTEM:WINDOWS /LTCG /OPT:REF")
set(CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO "${CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO} /DEBUG /SUBSYSTEM:WINDOWS /LTCG /OPT:REF")
ELSEIF(UNIX)
set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} -mfpmath=sse -msse2 -mmmx -msse -msse3 -m3dnow -O2 -fomit-frame-pointer -fstrict-aliasing -ffast-math -ftracer")
set(CMAKE_EXE_LINKER_FLAGS_RelWithDebug "${CMAKE_EXE_LINKER_FLAGS_RelWithDebug} -O0")
endif(WIN32)

# some ugly hack to fix cmake's stupidity
macro(windows_hacks NAME)
IF(WIN32)
if (MSVC_IDE)
# hack to get around the "Debug" and "Release" directories cmake tries to add on Windows
set_target_properties(${NAME} PROPERTIES PREFIX "../")
set_target_properties(${NAME} PROPERTIES IMPORT_PREFIX "../")
endif(MSVC_IDE)
ENDIF(WIN32)
endmacro(windows_hacks)

# some PG build options
set(PAGEDGEOMETRY_BUILD_SAMPLES "TRUE" CACHE BOOL "build the examples")
set(PAGEDGEOMETRY_ALTERNATE_COORDSYSTEM "FALSE" CACHE BOOL "alternate coordinate system, do not use unless you are very sure about it")
set(PAGEDGEOMETRY_USE_OGRE_RANDOM "FALSE" CACHE BOOL "fallback to Ogre's PRNG instead of using our own (not recommended)")
set(PAGEDGEOMETRY_USER_DATA "FALSE" CACHE BOOL "ability to attach user data to entities")

# some versioning things
SET(LIB_MAJOR_VERSION "1")
SET(LIB_MINOR_VERSION "1")
SET(LIB_BUILD_VERSION "0")
SET(LIB_VERSION "${LIB_MAJOR_VERSION}.${LIB_MINOR_VERSION}.${LIB_BUILD_VERSION}")
IF(NOT DEFINED LIB_INSTALL_DIR)
SET(LIB_INSTALL_DIR "lib${LIB_SUFFIX}")
ENDIF(NOT DEFINED LIB_INSTALL_DIR)

# Needed for PagedGeometry.pc.in
SET(prefix ${CMAKE_INSTALL_PREFIX})
SET(exec_prefix "\${prefix}")
SET(libdir "\${exec_prefix}/${LIB_INSTALL_DIR}")
SET(bindir "\${exec_prefix}/bin")
SET(includedir "\${prefix}/include")
SET(PACKAGE_NAME "PagedGeometry")
SET(PACKAGE_VERSION "${LIB_VERSION}")

# configuration of the config.h and PkgConfig
CONFIGURE_FILE(
"${PagedGeometry_SOURCE_DIR}/include/PagedGeometryConfig.h.in"
"${PagedGeometry_BINARY_DIR}/include/PagedGeometryConfig.h")
CONFIGURE_FILE(
"${PagedGeometry_SOURCE_DIR}/PagedGeometry.pc.in"
"${PagedGeometry_BINARY_DIR}/PagedGeometry.pc"
@ONLY)
# install the PkgConfig file
INSTALL(FILES "${PagedGeometry_BINARY_DIR}/PagedGeometry.pc" DESTINATION "${LIB_INSTALL_DIR}/pkgconfig")

# some additional compiler flags
IF(NOT WIN32)
ADD_DEFINITIONS(-Wall)
CHECK_C_COMPILER_FLAG(-Wextra HAVE_W_EXTRA)
IF(HAVE_W_EXTRA)
ADD_DEFINITIONS(-Wextra)
ENDIF()
endif()

# Set visibility options if available
IF(NOT WIN32)
CHECK_C_SOURCE_COMPILES("int foo() __attribute__((destructor));
int main() {return 0;}" HAVE_GCC_DESTRUCTOR)

CHECK_C_COMPILER_FLAG(-fvisibility=hidden HAVE_VISIBILITY_SWITCH)
IF(HAVE_VISIBILITY_SWITCH)
CHECK_C_SOURCE_COMPILES("int foo() __attribute__((visibility(\"default\")));
int main() {return 0;}" HAVE_GCC_VISIBILITY)
IF(HAVE_GCC_VISIBILITY)
ADD_DEFINITIONS(-fvisibility=hidden -DHAVE_GCC_VISIBILITY)
ENDIF()
ENDIF()
ENDIF()


# now add the directories
add_subdirectory(source)

if(PAGEDGEOMETRY_BUILD_SAMPLES)
add_subdirectory(examples)
endif(PAGEDGEOMETRY_BUILD_SAMPLES)
15 changes: 15 additions & 0 deletions GettingStarted.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
==== What is PagedGeometry? ====

The PagedGeometry engine is an add-on to the OGRE Graphics Engine, which provides highly optimized methods for rendering massive amounts of small meshes covering a possibly infinite area. This is especially well suited for dense forests and outdoor scenes, with millions of trees, bushes, grass, rocks, etc., etc.

Paged geometry gives you many advantages over plain entities, the main one being speed: With proper usage of detail levels, outdoor scenes managed by PagedGeometry can be >100x faster than plain entities. Another advantage is that the geometry is paged; in other words, only entities which are immediately needed (to be displayed) are loaded. This allows you to expand the boundaries of your virtual world almost infinitely (only limited by floating point precision), providing the player with a more realistically scaled game area.

==== Getting Started ====

The first thing you should do after extracting PagedGeometry somewhere is compile it. By default, the PagedGeometry library files (PagedGeometry.lib, and PagedGeometry_d.lib) are not included in the download, so you'll have to compile them yourself. Fortunately, this is fairly easy to do, since PagedGeometry doesn't require any external libraries besides Ogre. First, double-click on �PagedGeometry.sln� to open up the PagedGeometry library project in Visual Studio. Then find the �Solution Explorer� window right-click on �Solution 'PagedGeometry' (1 project)�, and select �Batch Build�. Click �Select All�, then �Build�, and wait until PagedGeometry has finished compiling (the status bar at the bottom of the screen should say �Build succeeded� when finished).

Next, find Ogre's release and debug DLLs (usually C:\OgreSDK\bin\[release|debug]), and copy them appropriately into the \PagedGeometry\examples\bin\[release|debug] folders. This is necessary because, in order for the examples to run properly, they need to have access to Ogre's DLLs. Note that Plugin_ParticleFX.dll, Plugin_BSPSceneManager.dll, OgreGUIRenderer.dll, and CEGUI DLLs are not used by the examples, and don't need to be copied.

Now you can try running the example applications. Open "Examples.sln" (in the "examples" folder) in Visual Studio. You should see a list of example projects on the left. To choose one, right click on the project name (for example, "Example 7 - Lightmaps"), and select "Set as StartUp Project". Make sure "Release" is selected ("Debug" mode is very slow) in the configuration drop-down, and run (Debug -> Start Debugging).

When you're ready to start learning how to use PagedGeometry, the best place to start is with Tutorial 1 (in the docs folder). The tutorials will teach you how to use many important PagedGeometry features, step by step. The API reference isn't recommended for learning, but is a valuable resource when you need specific in-depth information about a certain function or class.
11 changes: 11 additions & 0 deletions PagedGeometry.pc.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
prefix=@prefix@
exec_prefix=@exec_prefix@
libdir=@libdir@
includedir=@includedir@

Name: PagedGeometry
Description: Paged Geometry is a library that helps you to add grass and trees to your Ogre3D scene
Requires: @PKG_CONFIG_REQUIRES@
Version: @PACKAGE_VERSION@
Libs: -L${libdir} -l@LIBNAME@ @PKG_CONFIG_LIBS@
Cflags: -I${includedir}
57 changes: 57 additions & 0 deletions Todo.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
__PagedGeometry________________________

+ Add minimum tree scale for treeloaders
+ Enforce tree scales with debug-only exceptions in treeloaders
+ Add support for alternate coordinate systems (for example, where Z is up)
+ Update docs (recompile API, no more updateAnimation(), new frameUpdate() function in PageLoader)
+ Add #defines for alternate coordinate system support
+ Fix impostor rotation point
+ Add grass layer delete
+ Fix impostor rotation point problem
+ Add userData parameter support to height functions

Fixed:
+ Fix tree scale issue
+ Fix StaticBillboardSet reference bug
+ Fix possible grass animation bug
+ Fix grass reload bug
+ Supplying an invalid material to GrassLayer will crash without a descriptive error
+ Fix impostor filename issue
+ Batches and impostors do not correctly handle per-subentity materials

Add shared vertex data support

Confirmed:


--- Release Version 1.0 ---

+ Sprite grass
Angled grass
Add density map tree loader
Fix batching of shared vertices
Density map editing functions
Add BillboardPage
Add Impostor autoregeneration

--- Release Version 1.1 ---

Improve impostor customization
setDefaultImpostorResolution(), setDefaultImpostorColor(), setDefaultImpostorRenders()
setImpostorResolution(), setImpostorColor(), setImpostorRenders()
Implement InstancePage
Add hard disk tree loader

Dynamic lighting
Swaying trees
Add functions to reload rectangular and circular regions of geometry
Add progressive reloading option


Add a maximum view height as well as a maximum view distance for detail levels
Optimize impostor generator for tall, skinny trees
Fix Ogre's billboard system for camera roll
Experement with single-triangle billboards and point-sprites
Add collision interface
Possibly add a pseudo-volumetric-texture GeometryPage implementation
Add automated terrain lightmapper to PagedGeometry
Binary file added bin/media/OgreCore.zip
Binary file not shown.
3 changes: 3 additions & 0 deletions bin/media/grass/__ReadMe__.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
This grass texture included with PagedGeometry was kindly provided by
Agnisola Philippe (http://www.blitz3dfr.com/portal_joomla/) for
commercial or non-commercial use.
20 changes: 20 additions & 0 deletions bin/media/grass/grass.material
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
material grass
{
technique
{
pass
{
//lighting off
cull_hardware none
cull_software none
scene_blend alpha_blend
alpha_rejection greater_equal 128
//depth_write off

texture_unit
{
texture grass2.png
}
}
}
}
Binary file added bin/media/grass/grass.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added bin/media/grass/grass2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added bin/media/terrain2/densitymap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
71 changes: 71 additions & 0 deletions bin/media/terrain2/terrain.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
# The main world texture (if you wish the terrain manager to create a material for you)
WorldTexture=terrain_texture.jpg

# The detail texture (if you wish the terrain manager to create a material for you)
DetailTexture=terrain_detail.jpg

#number of times the detail texture will tile in a terrain tile
DetailTile=5

# Heightmap source
PageSource=Heightmap

# Heightmap-source specific settings
Heightmap.image=terrain.png

# If you use RAW, fill in the below too
# RAW-specific setting - size (horizontal/vertical)
#Heightmap.raw.size=513
# RAW-specific setting - bytes per pixel (1 = 8bit, 2=16bit)
#Heightmap.raw.bpp=2

# How large is a page of tiles (in vertices)? Must be (2^n)+1
PageSize=513

# How large is each tile? Must be (2^n)+1 and be smaller than PageSize
TileSize=65

# The maximum error allowed when determining which LOD to use
MaxPixelError=3

# The size of a terrain page, in world units
PageWorldX=1500
PageWorldZ=1500
# Maximum height of the terrain
MaxHeight=100

# Upper LOD limit
MaxMipMapLevel=5

#VertexNormals=yes
#VertexColors=yes
#UseTriStrips=yes

# Use vertex program to morph LODs, if available
VertexProgramMorph=yes

# The proportional distance range at which the LOD morph starts to take effect
# This is as a proportion of the distance between the current LODs effective range,
# and the effective range of the next lower LOD
LODMorphStart=0.2

# This following section is for if you want to provide your own terrain shading routine
# Note that since you define your textures within the material this makes the
# WorldTexture and DetailTexture settings redundant

# The name of the vertex program parameter you wish to bind the morph LOD factor to
# this is 0 when there is no adjustment (highest) to 1 when the morph takes it completely
# to the same position as the next lower LOD
# USE THIS IF YOU USE HIGH-LEVEL VERTEX PROGRAMS WITH LOD MORPHING
#MorphLODFactorParamName=morphFactor

# The index of the vertex program parameter you wish to bind the morph LOD factor to
# this is 0 when there is no adjustment (highest) to 1 when the morph takes it completely
# to the same position as the next lower LOD
# USE THIS IF YOU USE ASSEMBLER VERTEX PROGRAMS WITH LOD MORPHING
#MorphLODFactorParamIndex=4

# The name of the material you will define to shade the terrain
#CustomMaterialName=TestTerrainMaterial


Binary file added bin/media/terrain2/terrain.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 0a00069

Please sign in to comment.