Jump to content
  • entries
    941
  • comments
    5,894
  • views
    871,104

About this blog

Learn about game development technology

Entries in this blog

Compressed Vertex Arrays

My work with the MD3 format and its funny short vertex positions made me think about vertex array sizes. (Interestingly, the Quake 2 MD2 format uses a single char for vertex positions!) Smaller vertex formats run faster, so it made sense to look into this. Here was our vertex format before, weighing in at 72 bytes: struct Vertex { Vec3 position; float displacement; Vec3 normal; Vec2 texcoords[2]; Vec4 tangent; unsigned char color[4]; unsigned char boneweights[4]; unsigned char b

Josh

Josh

Precomputed BSP Trees and Static Meshes

The GMF2 data format gives us fine control to enable fast load times. Vertex and indice data is stored in the exact same format the GPU uses so everything is read straight into video memory. There are some other optimizations I have wanted to make for a long time, and our use of big CAD models makes this a perfect time to implement these improvements. Precomputed BSP Trees For raycast (pick) operations, a BSP structure needs to be constructed from the mesh data. In Leadwerks Engine thi

Josh

Josh

Documentation Sneak Peak

I am happy to show you a preview of the new documentation system I am working on: Let's take a look at what is going on here: It's dark, so you can stare lovingly at it for hours without going blind. You can switch between languages with the links in the header. Lots of internal cross-linking for easy access to relevant information. Extensive, all-inclusive documentation, including Enums, file formats, constructors, and public members. Data is fetch

Josh

Josh

Next Steps

Still a lot of things left to do. Now that I have very large-scale rendering working, people want to fill it up with very big terrains. A special system will be required to handle this, which adds another layer to the terrain system. Also, I want to resume work on the voxel GI system, as I feel these results are much better than the performance penalty of ray-tracing. There are a few odds and ends like AI navigation and cascaded shadow maps to finish up. I am planning to have the engine mor

Josh

Josh

Joint Class Finished

I'm happy to say the physics joint class in the new engine is completed. I made all the members that are not meant to be accessed private. One interesting part is the parent and child public members, which are constant pointers to private members. This should result in a read-only member in C++. A sol property is used to expose this to Lua in a read-only manner. The upvector joint will align an object's Y axis to any vector you set, but still allow rotation around the axis. This is perfect

Josh

Josh

Particle Plugins and More

The Leadwerks 5 beta will soon be updated with particle emitters and an example particle system plugin. Previously, I showed some impressive results with physically interactive particles that collide with and exert forces on the environment. I decided to use the plugin system for controlling particle behavior, as this offers the best performance and can be run on the physics thread.  A particle system plugin uses some predefined structures and functions to modify the behavior of particles w

Josh

Josh

Documentation and Code Details

Documentation in Leadwerks 5 will start in the header files, where functions descriptions are being added directly like this: /// <summary> /// Sets the height of one terrain point. /// </summary> /// <param name="x">Horizontal position of the point to modify.</param> /// <param name="y">Vertical position of the point to modify.</param> /// <param name="height">Height to set, in the range -1.0 to +1.0.</param> virtual void SetHeight(const int x

Josh

Josh

Building Textures in Leadwerks Game Engine 5

The new engine features advanced image and texture manipulation commands that allow a much deeper level of control than the mostly automated pipeline in Leadwerks Game Engine 4. This article is a deep dive into the new image and texture system, showing how to load, modify, and save textures in a variety of file formats and compression modes. Texture creation has been finalized. Here is the command: shared_ptr<Texture> CreateTexture(const TextureType type, const int width, const in

Josh

Josh

Voxel GI: GPU Acceleration, corrected bounces, and reflections

I've moved the GI calculation over to the GPU and our Vulkan renderer in Leadwerks Game Engine 5 beta now supports volume textures. After a lot of trial and error I believe I am closing in on our final techniques. Voxel GI always involves a degree of light leakage, but this can be mitigated by setting a range for the ambient GI. I also implemented a hard reflection which was pretty easy to do. It would not be much more difficult to store the triangles in a lookup table for each voxel in order to

Josh

Josh

Voxel GI: Light Bounces

I implemented light bounces and can now run the GI routine as many times as I want. When I use 25 rays per voxel and run the GI routine three times, here is the result. (The dark area in the middle of the floor is actually correct. That area should be lit by the sky color, but I have not yet implemented that, so it appears darker.) It's sort of working but obviously these results aren't usable yet. Making matters more difficult is the fact that people love to show their best scr

Josh

Josh

Better Voxelization

My initial implementation of mesh voxelization for ray tracing used this code. It was good for testing, but has some problems: It's slow, using an unnecessary and expensive x * y * z loop No support for per-voxel color based on a texture lookup There are mathematical mistakes that cause inaccuracy, and the math has to be perfect My solution addresses these problems and only uses an x * y loop to generate the voxels. It does this by identifying the major (largest magn

Josh

Josh in Articles

Leadwerks 5 beta update adds Visual Studio Code Integration for Lua

A new update is available to beta testers. This makes some pretty big changes so I wanted to release this before doing any additional work on the post-processing effects system. Terrain Fixed Terrain system is working again, with an example for Lua and C++. New Configuration Options New settings have been added in the "Config/settings.json" file: "MultipassCubemap": false, "MaxTextures": 512, "MaxCubemaps": 16, "MaxShadowmaps": 64, "MaxIntegerTextures": 32, "MaxUIntegerTe

Josh

Josh

Dynamic Voxel Updates

I've been working to make my previously demonstrated voxel ray tracing system fully dynamic. Getting the voxel data to update fast enough was a major challenge, and it forced me to rethink the design. In the video below you can see the voxel data being updated at a sufficient speed. Lighting has been removed, as I need to change the way this runs. I plan to keep two copies of the data in memory and let the GPU interpolate smoothly in between them, in order to smooth out the motion

Josh

Josh

Voxel ray tracing and motion

So far the new Voxel ray tracing system I am working out is producing amazing results. I expect the end result will look like Minecraft RTX, but without the enormous performance penalty of RTX ray tracing. I spent the last several days getting the voxel update speed fast enough to handle dynamic reflections, but the more I dig into this the more complicated it becomes. Things like a door sliding open are fine, but small objects moving quickly can be a problem. The worst case scenario is whe

Josh

Josh

Leadwerks 5 Beta Update Available

A beta update is available. The ray tracing system is now using a smaller 128x128x128 grid. There is still only one single grid that does not move. Direct lighting calculation has been moved to the GPU. The GI will appear darker and won't look very good. Additional shader work is needed to make the data look right, and I probably need to implement a compute shader for parts of it. The system is now dynamic, although it current has a lot of latency. GI renders only get triggered when somethi

Josh

Josh

Streaming Terrain Data Preparation

Being able to support huge worlds is great, but how do you fill them up with content? Loading an entire planet into memory all at once isn't possible, so we need a system that allows us to stream terrain data in and out of memory dynamically. I wanted a system that could load data from any source, including local files on the hard drive or online GIS sources. Fortunately, I developed most of this system last spring and I am ready to finish it up now. Preparing Terrain Data The first st

Josh

Josh

Forum Software and Theme Updated

Our forum software and theme have been updated. The new theme is just the default Invision Power Board skin, with our own header and footer added. In the past I put a lot of effort into getting the forum to look exactly the way I wanted, and I don't think that effort was a very good use of time. Each forum update requires us to redo the skin, and I just don't feel like it is that important. I can fine-tune the appearance of the user interface in the Leadwerks Editor, but this web stuff is o

Josh

Josh in Articles

Voxel Ray Tracing and Physically-Based Rendering

Light is made up of individual particles called photons. A photon is a discrete quantum of electromagnetic energy. Photons are special because they have properties of both a particle and a wave. Photons have mass and can interact with physical matter. The phenomenon of "solar pressure" is caused by photons bombarding a surface and exerting force. (This force actually has to be accounted for in orbital mechanics.) However, light also has a wavelength and frequency, similar to sound or other wave

Josh

Josh in Articles

Cryptocurrency Now Accepted in Store and Marketplace

We now accept popular cryptocurrencies in our store and Marketplace through Coinbase Commerce. That's right, you can now buy software like Ultra App Kit using Bitcoin, Ethereum, Litecoin, Dai, or Bitcoin Cash (if you can figure it out!). Right now it's a novelty, but it's worth trying. Maybe by 2022 it will be your only option? Sadly, Dogecoin is not one of the currently supported coins. Soon?

Josh

Josh in Articles

Vulkan on AMD Graphics Cards

I have procrastinated testing of our new 3D engine on AMD hardware for a while. I knew it was not working as-is, but I was not too concerned. One of the promises of Vulkan is better support across-the-board and fewer driver bugs, due to the more explicit nature of the API. So when I finally tried out the engine on an R9 200 series card, what would actually happen? Would the promise of Vulkan be realized, or would developers continue to be plagued by problems on different graphics cards? Read on

Josh

Josh in Articles

Voxel Cone Step Tracing - Cascaded Volumes

I had to spend several weeks just eliminating light leaks and other artifacts, and getting the results I wanted in a variety of scenes. The results are looking good. Everyone who tries implementing this technique has problems with light leaks but I have fortunately been able to avoid this with careful planning: Now that I have nice results with a single volume texture centered at the origin, it's time to add additional stages. The idea is to have a cascading series of volume textures

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

Android Ahead

I hired a local Android developer to get Leadwerks 3.0 running on Android devices. We don't know a lot yet, other than that we have an OpenGLES renderer, and everything should be cross-platform compilable. The Android version of LE3 is using a minimum requirement of Android 2.2, which is the lowest version that supports OpenGL ES 2.0. This will run on about 75% of Android devices:     As you can see here, the proportion of 2.1 devices is steadily dropping. If a linear rate of decrease i

Josh

Josh

×
×
  • Create New...