I’ve finally gotten around to getting my Fractal Landscape program up with information, yay.
I am currently releasing two “versions”:
- The first “version” (which I will henceforth call OrgVer) is the original version I made that was specifically put together for a portfolio I was assembling when looking for a job at game companies in 2003.
- I threw OrgVer together as quick as I could as I was eager to start looking for a job at the time and needed some good working examples. Because of this, I didn’t concentrate on making the code pretty or maintainable like I do with most other code, as I never planned on releasing the source code for it. However, since it is a legacy version and I decided to continue with the project later on, I don’t mind releasing this original version’s source code now.
- I have made slight modifications to OrgVer as following so it can more easily be compiled and such:
- This was originally compiled for a specific version of DirectX 8, and has been updated for DirectX 9. This entailed changing a few function call names and their parameters.
- There were originally 2 separate versions included with OrgVer. One was the normal code base, and the other had just a few modifications to include graphics card occlusion culling. I have haphazardly combined the two files through macros found in the “#if UseOcclusion==1” section (UO, NUO, OrOp).
- Executable version information (which always includes the Hyrulean Productions Icon) has been added.
- The original compile (fully working with the fractal generation, lighting, and some other stuff), which I did not keep, was made in 2 to 3 days in, I estimate, 25 to 30 hours (including research on how to generate fractals and such). I worked on it for 2 or 3 more weeks after that though and finished OrgVer with about 1,411 lines of code.
- It only has a DirectX Engine (no OpenGL version in this one).
- Controls are as follows: (For more detailed information on the controls, see the corresponding keys in the “Controls” section)
- Mouse Movement - Rotates the camera.
- “=\+” - Increase the fractal level by 1.
- “-” - Decreases the fractal level by 1.
- “R” - Re-randomize the current fractal level.
- enter - Re-randomizes all levels back to a level 5.
- “W/A/S/D” - Forward, left, back, right (in order) keys
- “L” - Toggle lighting/sun
- “M” - Re-centers the mouse cursor. Only available in non-FullCPU mode.
- “E” - Example fractal
- “F” - Toggle full screen
- “J/K” - Revolve sun counter-clockwise and clockwise
- “C” - Toggle clouds
- “O” - Toggle wireframe
- esc - Exit the program
- Source Code Definitions (See the “Source Code Definitions” section). The differences are as follows:
- FullCpu: This toggles FullCpu mode for the executable.
- When in FullCpu mode (1), which is the default:
- DirectX handles keyboard and mouse input events.
- Program receives all keyboard/mouse input even if window does not have focus.
- The mouse cursor is locked to the window when it has focus.
- Frames are redrawn consistently, immediately after each other.
- When not in FullCpu mode (0), which is event driven:
- The Windows’ event message system is used to handle keyboard/mouse input
- Frames are only drawn when an update to the screen has occurred via a keyboard/mouse action.
- This mode is less resource intensive.
- UseOcclusion: Turn on hardware occlusion culling
- WinStyle: This is not found in OrgVer
- Downloads:
- v0.5 Binaries - There are 3 executables of OrgVer found in this archive that only differ from toggled “Source Code Definitions”:
Name | FullCpu | UseOcclusion |
---|
Fractal.exe | on | off |
Fractal_Non_FullCpu.exe | off | off |
Fractal_Occlusion.exe | on | on |
- v0.5 Source - Important Note: Source code has not been cleaned up and was originally never intended for release. See above information in this update for more details.
- The second “version” I am releasing was finished, I believe, within one to two months after OrgVer, when I decided to pick the project back up for fun and make it more organized, optimized, user friendly, and add some more bells and whistles :-). I completely rewrote the engine infrastructure to use a complex object oriented approach in c++ with polymorphism, multiple inheritance, virtual classes, and such.
- The source code and files of this version have not really been modified since I finished them in 2003, except, as always, for adding in executable version information.
- Downloads: v1.0 Binary
There are also 2 other source trees I made of the project that I need to see to and possibly release. They are DirectX and OpenGL versions that use experimental ray-tracing techniques to speed up height-map rendering, which I wrote a paper about (Aug 2003) and will release it later too under this project after checking over it.
I redid all the screenshots for the project page and added lots of information including: The (formatted and updated) original readme, important notes, features, technical details, controls, and source code options.
[Fixed in v1.05] Regrettably, when I seem to run the engine through the DirectX implementation, there are a lot of bugs on newer graphics cards. The OpenGL implementation seems to still work on all new graphics cards though :-). I am including a list of bugs here that I need to look into that didn’t exist on any of the graphics cards I tried this on when I originally made it, and will see to fixing them later. [Most or all of] these bugs apply to both versions released in this update.
DirectX Bugs: [Fixed in
v1.05]
- The water sometimes overlaps solid objects where it shouldn’t. This is due to some alpha blending setting conflicting with the z-buffer.
- The clouds do not show up at most viewing angles when fogging is turned on.
- When leaving full screen mode the window’s title bar is sometimes pushed off the screen.
- If fogging is turned on while a “Special Effect” is also on, all landscape surfaces show as pure white.
Other options I may add in the future:
- Infinite fractal range (this one would take a major rewrite). This would also allow better Level of Detail (LOD) optimizations.
- Running the engine in Windows’ event mode. This is currently available in the OrgVer “first version” available in this update. See “FullCpu” (the turned off version) in Source Code Definitions in this update.
- Re-mappable keyboard shortcuts
- Make “Special effects” available in OpenGL. Unfortunately, when I programmed this, the shaders I wanted weren’t really properly supported in OpenGL.
- Integrate the “ray-tracing” modes
- Dialog box keyboard shortcuts, including enter and escape
- Option to have the engine pause when window loses focus
- Make sure user doesn’t start under water [Added in v1.05]
- Real shadows based upon the height-map (Not likely that I’m going to worry about this)
- Lens flair when looking at the sun. I tried this at one point and failed pretty miserably, heh. Couldn’t get it to look right! This kind of thing is so pas sé/old school though ^_^;.