3D Procedural Game Engine Using OpenGL
Switch branches/tags
Nothing to show
Clone or download
Latest commit ad7011b Nov 11, 2018
Permalink
Failed to load latest commit information.
Targa Changed the targa reader/writer from C to C++ and fixed a few compile… Aug 15, 2011
coll_objs Cleanup of old San Miguel includes (commented out) Aug 24, 2018
cornell_box Fixed cornell_box scene so that cobjs don't intersect each other. Aug 21, 2016
dependencies Adding missing glm files to dependencies/glm Aug 13, 2018
heightmaps Added large 65MB eroded heightmap for city test scene Aug 5, 2018
house Another fix for filename case Jul 31, 2018
mapx Fixed asymmetry in mapx bench model Oct 7, 2018
model_data Generated a 256^3 lighting file for the soda scene Feb 11, 2017
scene_config Moved all root level config files to a new directory scene_config and… Nov 11, 2018
shaders Added domain warp noise to rocky planets. Looks better, but slower an… Nov 11, 2018
sounds Added a car horn sound Aug 27, 2018
sponza Changed some config files to use forward slashes rather than back sla… Aug 2, 2018
src Added domain warp noise to rocky planets. Looks better, but slower an… Nov 11, 2018
textures Added a crosswalk texture for use with cities Oct 12, 2018
universe Added a system_max_orbit config file value to control elliptical syst… Aug 19, 2018
.gitignore Added the 4 required DLLs for building on Windows 10 with MS Visual S… Aug 13, 2018
3DWorld.sln Started working on a 64-bit build. Added x64 project and fixed the 64… Feb 5, 2012
3DWorld.vcxproj Moved all root level config files to a new directory scene_config and… Nov 11, 2018
3DWorld.vcxproj.filters Moved all root level config files to a new directory scene_config and… Nov 11, 2018
3DWorld_debug.bat Added batch files for running 3DWorld from the project directory with… Jul 15, 2018
3DWorld_debug.exe.lnk Added 3DWorld debug and release symlinks Jul 14, 2018
3DWorld_release.bat Added batch files for running 3DWorld from the project directory with… Jul 15, 2018
3DWorld_release.exe.lnk Added 3DWorld debug and release symlinks Jul 14, 2018
LICENSE Create LICENSE Apr 9, 2018
README.defaults Updates to README.defaults and universe config file Aug 12, 2018
README.linux Added export commands to README.linux Aug 2, 2018
README.md Updated README, .gitignore, and MSVS project file Aug 13, 2018
Script1.aps Added Script1.aps and Script1.rc, which seem to be needed to run 3DWorld Jul 14, 2018
Script1.rc Added Script1.aps and Script1.rc, which seem to be needed to run 3DWorld Jul 14, 2018
Universe_class_hierarchy.txt Initial commit of src, textures, house, mapx, config files, and other… Sep 15, 2010
alut.dll Added the 4 required DLLs for building on Windows 10 with MS Visual S… Aug 13, 2018
bullet.lnk Added bullet physics wrapper file and updated project include and lib… Oct 14, 2015
defaults.txt Switched default scene back to office building Jul 12, 2018
freeglut.dll Added the 4 required DLLs for building on Windows 10 with MS Visual S… Aug 13, 2018
glew32.dll Added the 4 required DLLs for building on Windows 10 with MS Visual S… Aug 13, 2018
glut32.dll Added the 4 required DLLs for building on Windows 10 with MS Visual S… Aug 13, 2018
heightmap_flood.bmp Added some more files to svn. Sep 15, 2010
heightmap_river.bmp Fixed a w_motion_matrix infinite loop. Updated the river config file … Oct 9, 2010
hmv.mesh Initial commit of src, textures, house, mapx, config files, and other… Sep 15, 2010
icon1.ico Todo file updates. Added new icon. Nov 7, 2015
makefile Switch to new gli version in linux makefile and enable DDS image reading Aug 7, 2018
mesh.txt Initial commit of src, textures, house, mapx, config files, and other… Sep 15, 2010
obj_list Makefile fixes for link errors in linux build. Link now succeeds Jul 30, 2018
output.modmap Added 3DWorld.{vcxproj,sln} to svn, which may or may not be a good id… Oct 23, 2011
readme-keys.txt Removed unused mesh resolution code. -FG Mar 24, 2014
scene_stats.xlsx Increased MAX_VMAP_SIZE from 64K to 256K, which seems to work a littl… Nov 12, 2011
shader_info.txt Various small changes, including adding code to prevent TT tiles from… Jan 18, 2014
snow.voxels.map Removed an old/incorrect assertion from snow drawing. Added a snow ma… Nov 16, 2014
sphere_materials.txt Set IoR for metal materials equal to magnitude of R+I complex number … Jul 16, 2017
todo.txt Experimenting with simple texture-based sky occlusion lighting; not v… Nov 3, 2018
universe.modmap Initial commit of src, textures, house, mapx, config files, and other… Sep 15, 2010
universe_todo.txt Created a todo.txt file and moved some of the non-universe stuff in u… Mar 18, 2013

README.md

3DWorld is a cross-platform OpenGL-based 3D Game Engine that I've been working on since I took the CS184 computer graphics course at UC Berkeley in 2001. It has the following features:

  • 3D graphics functions, classes, and wrappers around OpenGL
  • Shader generator/processor with hot reload
  • Procedural content generation for terrain, vegetation, buildings, etc.
  • Procedural universe generator with galaxies, stars, planets, moons, etc.
  • Procedural voxel 3D terrain generation with realtime user editing
  • Terrain generator including various noise functions, erosion, realtime user editing, heightmap read/write
  • Physics simulation for primitive object types and others (> 10K dynamic objects)
  • Realtime day/night cycle with weather (rain, snow, hail, wind, lightning)
  • Physically based materials with reflection and refraction
  • Dynamic shadows, ambient occlusion, up to 1024 dynamic light sources, postprocessing effects
  • Built-in first person shooter game "smiley killer"
  • Build-in spaceship + planet colonization game
  • Computer AI for players in the FPS game and ships in the universe game
  • Importer for Lightwave object file and 3DS formats
  • Reading support for textures: JPEG, PNG, BMP, TIFF, TGA, RAW, DDS
  • Optimized for fast load and realtime rendering of large models (> 1GB of vertex/texture data)

I converted the project from svn to git at commit 6607. Most of the code is written in C++, with GLSL for shaders. This is intended to be a cross-platform project. Microsoft Visual Studio 2015 project files are included. A linux/gcc makefile is also included, but is more experimental. See README.linux for more details. The project should build under gcc on linux with some work, but it's been a while since I tried this. I have an old makefile that is out of date, but may not take too much work to fixup and make it usable.

Be warned, this is a large repository, currently 955MB. I've included source code, config files, textures, sounds, small models, lighting files, scene data, heightmaps, and project files. This repo does not contain the large model files used in some scenes, you'll have to download these separately. This means that some of the scene config files won't work because they can't find their referenced data. The current list of dependencies is:

I've included stripped down versions of most of these libraries in the dependencies directory. I removed all large files that aren't required by 3DWorld, in some cases even examples/tests/documentation. These have been built with MS Visual Studio 2015 Professional on Windows 10. If you want to use these, you'll need to copy the directories to the root directory and rebuild any libraries needed for other versions of Visual Studio.

Note that many of these dependencies are old and could be replaced with newer libraries. I've been concentrating on adding content and I'm not too interested in this. Freeglut should probably be replaced with SDL, the last 4 image libraries with DevIL, and maybe assimp can be used for model loading.

If you want to build 3DWorld, you'll need to download and build these dependencies somewhere and change the project settings to use them. I just copy these into the current directory and have these files ignored by git/svn. I currently use a 32-bit MS Visual Studio build target for 3DWorld. It should compile in 64-bit mode, but I couldn't find compatible 64-bit debug libraries for OpenAL, and a few of the other dependencies didn't build cleanly in 64-bit mode.

If you have linux, you can try to build using the provided makefile. The file README.linux should be helpful. I've gotten 3DWorld to build and mostly run on Ubuntu 18.04 with gcc 7.

3DWorld takes a config filename on the command line. If not found, it reads defaults.txt and uses any config file(s) listed there. Some of these congig files include models such as the Sponza Atrium, Stanford Dragon, sportscar, etc. These files are too large to store in the git repo. I've attempted to have 3DWorld generate nonfatal errors if the models can't be found. Many of the larger models can be found at the McGuire Computer Graphics Archive: http://casual-effects.com/data/

System requirements:

  • Windows 7/8/10 (Runs on Windows 7, but I've only built on 8 and 10). Linux when using the makefile with gcc.
  • Microsoft Visual Studio 2015 (or newer?). The professional version is needed for OpenMP support. You can also try to use gcc.
  • A relatively new generation of Nvidia or ATI GPU (Runs on my laptop with Intel graphics, but at 12-20 FPS)
  • At least 4GB system memory for the larger scenes
  • At least 2GB GPU memory for the larger scenes

I currently have this repo up for educational purposes under the GPL license. It's not meant as a commercial tool and I'm not trying to make money here. I'm also not looking for others to work on the project at this early stage, though I'm accepting feedback and suggestions. Maybe things will change if I decide to make a real game out of this. If you would like to use something here for your project, please let me know.

There is no further documentation for 3DWorld. However, I do have a blog that includes descriptions of the algorithms and lots of screenshots: https://3dworldgen.blogspot.com/

Here are some screenshots linked from my blog:

alt text

alt text

alt text

alt text

alt text

alt text

alt text

alt text

alt text

alt text

alt text

alt text

alt text

alt text

alt text

alt text

alt text

alt text

alt text

alt text

alt text

alt text

alt text

alt text

alt text

alt text

alt text

alt text