Jump to content
  • entries
    941
  • comments
    5,894
  • views
    868,523

About this blog

Learn about game development technology

Entries in this blog

Reflections on Reflections

Now that I have the downsampled reflection data working, I can start casting rays. The cone step tracing is not a 100% perfect representation of physical light, but it gives a very favorable balance of quality and performance. Somehow I came up with a few formulas that eliminate light leaks and other artifacts. Quite honestly I did not think the results would be this good. Indoor / outdoor scenes with thin walls are very difficult to prevent light leaks in, but somehow it's working ve

Josh

Josh in Articles

Reflection Colors

An update is available for Leadwerks 5 beta on Steam that adds a World::SetSkyColor() command. This allows you to set a gradient for PBR reflections when no skybox is in use. I learned with Leadwerks 4 that default settings are important. The vast majority of screenshots people show off are going to use whatever default rendering settings I program in. We need a good balance between quality and performance for the engine to use as defaults. Therefore, the engine will use SSAO and bloom effe

Josh

Josh in Articles

Real-time Global Illumination: Introducing Latency

Since previously determining that voxels alone weren't really capable of displaying artifact-free motion, I have been restructuring the GI system to favor speed with some tolerance for latency. The idea is that global illumination will get updated incrementally in the background over the course of a number of frames, so the impact of the calculation per frame is small. The new GI result is then smoothly interpolated from the old one, over a period of perhaps half a second. Here's a shot of the r

Josh

Josh in Articles

Real-time Global Illumination: Background Updating

Previously I wrote about introducing latency to the voxel cone step tracing realtime global illumination system. The idea here is to improve performance and quality, at the cost of a small delay when the GI calculation gets updated. The diffuse GI lighting gets cached so the final scene render is very fast. Here's what a gradual GI update does. Of course, this will be running unseen in the background for the final version, but this shows what is actually happening: My new video pro

Josh

Josh in Articles

Project Launch Settings and Mod Support

The new editor is being designed to be flexible enough to work with any game, so it can be used for modding as well as game development with our new 3D engine. Each project has configurable settings that can be used to handle what the editor actually does when you run the game. In the case of a game like Quake, this will involve running a few executables to first compile the map you are working on into a BSP structure, then perform lightmaps and pre-calculate visibility. You can also

Josh

Josh in Articles

Plugins and File Formats

At last I have been able to work the plugin system into the new editor and realize my dreams. The editor automatically detects supported file formats and generates thumbnails for them. (Thumbnails are currently compatible with the Leadwerks system, so Leadwerks can read these thumbnail files and vice-versa.) If no support for a file format is found, the program just defaults to the whatever icon or thumbnail Windows shows. The options dialog includes a tab where you can examine each pl

Josh

Josh in Articles

Package plugins and Quake files now supported

Package plugins are now supported in Ultra Engine 1.0.2. This allows the engine to handle other package formats besides just ZIP. In order to test this out, I created the Quake Loader plugin, which currently supports the following formats used in the original Quake game: PAK WAD BSP (textures) SPR LMP Why Quake? Well, the original Quake game is what got me into game development through modding, but Quake is also great for testing because it's so weird.

Josh

Josh in Articles

Package Plugins

Many games store 3D models, textures, and other game files in some type of compressed package format. These can be anything from a simple ZIP file to a custom multi-file archive system. This has the benefit of making the install size of the game smaller, and can prevent users from accessing the raw files. Often times undocumented proprietary file formats are used to optimize loading time, although with DDS and glTF this is not such a problem anymore. Leadwerks uses built-in support for encr

Josh

Josh in Articles

Multiple Light Bounces

I have more than one light bounce working now, and it looks a lot nicer than single-bounce GI. The ambient light here is pure black. All light is coming off from the direct light, and bouncing off surfaces. It will take some time to get the details worked out, and more bounces will require more memory. I'm actually kind of shocked how good looking it is. This is just a single 128x128x128 volume texture at 0.25 meters per voxel. Light leaks seem to be not a problem, even at that low re

Josh

Josh in Articles

Linux, You Changed Man

I recently fired up an install of Ubuntu 20.04 to see what the state of development on Linux is now, and it looks like things have improved dramatically since I first started working with Linux in 2013. Visual Studio Code looks and works great on Linux, and I was able to load the Ultra Engine source code and start compiling, although there is still much work to do. The debugger is fantastic, especially after using the Code::Blocks debugger on Linux, which was absolutely sadistic. (They're both u

Josh

Josh in Articles

Leadwerks 5 Beta Update

A new update is available for beta testers. This update focuses on the GUI capabilities, mostly for interfaces created directly on a window, rather than 3D interfaces. We are moving from a Lua-driven GUI system to one coded more explicitly in C++. This will provide us with better documented behavior, easier portability, and a more responsive interface. Changes: GUI widgets no longer use Lua scripts. Each widget type has a C++ class, a creation command, and style constants. A

Josh

Josh in Articles

KTX2 Texture Support

A while back I wrote enthusiastically about Basis Universal super compression. KTX2 is a texture file format from Khronos, makers of the Vulkan and glTF specifications. Like DDS files, KTX2 can store multiple mipmaps, as well as memory-compressed texture formats like DXT5 and BC7. However, KTX2 now supports Basis compressed data as well, which makes it the all-in-one universal texture format. glTF has an official extension for KTX2 textures in glTF files, so it can be combined with Draco mesh co

Josh

Josh in Articles

How to use gmax

Not a lot of people know about this, but back in 2001 Discreet (before the company was purchased by Autodesk) released a free version of 3ds max for modding games. Back then game file formats and tools were much more highly specialized than today, so each game required a "game pack" to customize the gmax interface to support that game. I think the idea was to charge the game developer money to add support for their game. Gmax supported several titles including Quake 3 Arena and Microsoft Flight

Josh

Josh in Articles

GPU Voxelization

After testing and some discussion with other programmers, I decided to try performing voxelization on the GPU instead of the CPU. The downside is the memory usage is much higher than a sparse voxel octree, but I found that sparse voxel octrees were very slow when it came to soft reflections, although the results of the sharp raycast were impressive: You can read the details of GPU voxelization here if you wish. Initially I thought the process would require rendering the

Josh

Josh in Articles

GPU Voxel Downsampling with Compute Shaders

For downsampling of GI voxel data, I found that a compute shader offers the best performance. The first step was to add support for compute shaders into Ultra Engine.  I've never used these before but I was able to get them working pretty quickly. I think the user API will look something like this: //Load compute shader auto module = LoadShaderModule("Shaders/Compute/test.comp.spv"); auto shader = CreateShader(); shader->SetModule(module, SHADER_COMPUTE); //Create work group int wor

Josh

Josh in Articles

glTF Export

The glTF importer took a very long time to develop, but it much easier to write a glTF save routine. In one day I got an exporter working with support for everything except skinning and animation. To save a model in glTF format, just call Model::Save("mymodel.gltf") and it will work! Entire scenes can also be saved in glTF format.Here is a model that was loaded from Leadwerks MDL, MAT, and TEX files and saved as glTF. The textures are converted to PNG files. (Microsoft has an official extension

Josh

Josh in Articles

Global Illumination with Voxel Cone Step Tracing

Finally, finally, finally, finally, for the first time since I started working on this feature several years ago, finally we have real-time global illumination with a second light bounce: Below you can see the direct light hitting the floor, bounding up to the ceiling, and then being reflected back down on the floor again. Performance is still good and I have not started fine-tuning optimization yet. I was just trying to get the effect working at all, which was quite difficult to do,

Josh

Josh in Articles

Finishing Touches

At long last, the engine that felt like it would never be done is here. This is all the result of an idea I had and wanted to put to the test. Of course I never anticipated it was possible to deliver a 10x improvement in rendering performance, but here we are with the benchmarks to prove it. Research & Development The last four years of research and development were an opportunity to rethink and redesign what a game engine should be. Along the way there were a few ideas I had that

Josh

Josh in Articles

Finished Direct Lighting Step

While seeking a way to increase performance of octree ray traversal, I came across a lot of references to this paper: http://wscg.zcu.cz/wscg2000/Papers_2000/X31.pdf Funnily enough, the first page of the paper perfectly describes my first two attempted algorithms. I started with a nearest neighbor approach and then implemented a top-down recursive design: GLSL doesn't support recursive function calls, so I had to create a function that walks up and down the octree hierarchy with

Josh

Josh in Articles

Finalizing Terrain

I'm wrapping up the terrain features now for the initial release. Here's a summary of terrain in Ultra Engine. Terrains are an entity, just like anything else, and can be positioned, rotated, or scaled. Non-square terrains are supported, so you can create something with a 1024x512 or whatever resolution. (Power-of-two sizes are required.) Editing Terrain Ultra Engine includes an API that lets you modify terrain in real-time. I took something very complicated and distilled it down

Josh

Josh in Articles

Finalizing Shaders and Real-time Global Illumination Progress

I'm finalizing the shaders, and I was able to pack a lot of extra data into a single entity 4x4 matrix: Orthogonal 4x4 matrix RGBA color Per-entity texture mapping offset (U/V), scale (U/V), and rotation Bitwise entity flags for various settings Linear and rotational velocity (for motion blur) Skeleton ID All of that info can be fit into just 64 bytes. The shaders now use a lot of snazzy new function like this: void ExtractEntityInfo(in uint

Josh

Josh in Articles

Finalizing Direct Lighting

I have not used the engine outside the editor in a while, but I needed to for performance testing, so now I am back to real-time rendering. During the development of the GI system I broke most of the light types, so I had to spend a couple of days getting those to work again. While doing this, I decided to resolve some longstanding issues I have put off. First, the PBR lighting will use a default gradient in place of the skybox, if no reflection map is set for the world. This is based off t

Josh

Josh in Articles

Final Thoughts on Ultra App Kit

Breaking the new engine up into sub-components and releasing them in several stages is something new. The reason for trying this was twofold: Steam now incentives competition for digital shelf space, unlike when Leadwerks was first released on Steam in 2014, when I was trying to build up my quality of presence and promote one app ID on Steam. I would like to get some new software out early before the full engine is finished. The beautiful thing is that Ultra App Kit all con

Josh

Josh in Articles

Exporting a glTF model from 3ds Max

Autodesk 3ds Max now supports export of glTF models, as well as a new glTF material type. The process of setting up and exporting glTF models is pretty straightforward, but there are a couple of little details I wanted to point out to help prevent you from getting stuck. For this article, I will be working with the moss rocks 1 model pack from Polyhaven. Getting geometry into 3ds Max is simple enough. I imported the model as an FBX file. To set up the material, I opened the compa

Josh

Josh in Articles

×
×
  • Create New...