Jump to content
  • entries
    941
  • comments
    5,894
  • views
    867,716

About this blog

Learn about game development technology

Entries in this blog

Textures in Leadwerks Engine 3

Textures in LE3 give you more control. You can retrieve all or part of any mipmap of a texture to system memory, edit the texture, then send it back to the GPU. Fortunately, the engine checks the bounds of the texture so you don't have to worry about producing any blue screens of death, as can happen when you're having too much fun with GPU memory.   Here's some simple code to retrieve the texture from video memory into a system memory bank, modify it, and send it back to the graphics card:

Josh

Josh

Three's a Crowd

Crowd navigation is built into Leadwerks3D. You just set a destination, and your characters will automatically travel wherever you tell them to go. I think having navigation built into the engine will give us better results than a third party add-on would. We can automatically recalculate sections of the map that change, AI script functions can be called when certain events occur, and the code to control characters is extremely simple.  

Josh

Josh

FPS Weapons Pack on the way

Based on the excellent sales of the SciFi Interior Model Pack, I was able to get a deal to sell a new pack of high-quality first-person weapons. The following items are included: Pistol Combat shotgun MP5 Machne Gun M4 Rifle Grenade Machete   Weapons are included as animated visual weapons, and as models that can be placed throughout the map to pick up.     Instead of just distributing raw models, I want to offer game-ready items that can just be dropped into your g

Josh

Josh

Linux Graphics

Compiling Leadwerks on Linux using the Code::Blocks IDE wasn't very hard. I particularly like the way Code::Blocks handles files in projects. Instead of creating your own "fake" file system in the project explorer, you just add the folder or files you want, and they are organized in a hierarchy that matches the file system.   I found the X windowing system to be extremely easy to work with. I've implemented windowed OpenGL contexts on Windows, OSX, iOS, and Android, and Linux was by far the mo

Josh

Josh

Game Scripting is Hard

As I finish up the FPS Weapons Pack, I am struck by just how much work it takes to build a game, beyond the engine programming. I wrote Leadwerks, and it still took me several days to script the behavior of these weapons. I also had the advantage of being able to add new entity classes, as I needed two new entity types to complete the task: LensFlares and Sprites.   I like the flexibility of Leadwerks to make any type of game, and I think having an abstract 3D command set to do anything is r

Josh

Josh

Umbra Sucks. Check out our Easy No-Bake Occlusion Culling

With the help of @martyj I was able to test out occlusion culling in the new engine. This was a great chance to revisit an existing feature and see how it can be improved. The first thing I found is that determining visibility based on whether a single pixel is visible isn't necessarily a good idea. If small cracks are present in the scene one single pixel peeking through can cause a lot of unnecessary drawing without improving the visual quality. I changed the occlusion culling more to record t

Josh

Josh

Multipass Rendering in Leadwerks 5 beta

Current generation graphics hardware only supports up to a 32-bit floating point depth buffer, and that isn't adequate for large-scale rendering because there isn't enough precision to make objects appear in the correct order and prevent z-fighting. After trying out a few different approaches I found that the best way to support large-scale rendering is to allow the user to create several cameras. The first camera should have a range of 0.1-1000 meters, the second would use the same n

Josh

Josh

What's Next

Here's what's next for Leadwerks Game Engine.   Game Launcher Leadwerks Game Launcher will be released in early preview mode when 50 games are reached. Right now we have 13. Filling the content up is a high priority, and the Summer Game Tournament will bring us closer to that goal.   I am mentioning this first because I want to emphasize that the number of games posted is my measure of how well I'm doing. Every action should be considered in terms of how it helps you guys publish more ga

Josh

Josh

Vulkan on Mac with MoltenVK

When it comes to complex projects I like to focus on whatever area of technology causes me the most uncertainty or worry. Start with the big problems, solve those, and as you continue development the work gets easier and easier. I decided at this stage I really wanted to see how well Vulkan graphics work on Mac computers. Vulkan doesn't run natively on Mac, but gets run through a translation library called MoltenVK. How well does MoltenVK actually work? There was only one way to find out...

Josh

Josh in Articles

Vegetation Research - Pt 2

The Leadwerks 2 vegetation system used a grid of "cells" that each contained a quantity of vegetation instances. If the cell was close enough, each instance was checked against the camera frustum like a regular entity and then all visible instances were rendered in a batch. Cells that were further away were collapsed into a single surface consisting of a quad for each instance. This is how we were able to draw massive amounts of foliage in the distance at a fast framerate:     This w

Josh

Josh

Leadwerks 4.1 Beta

Leadwerks Game Engine 4.1 beta is now available on the beta branch on Steam. This is the final version 4.1, barring any bug fixes that are made before the release later this month. I am going to focus on just resolving bug reports and adding new documentation for the next two weeks.     4.1 adds environment probes, which have been covered previously, and volumetric lighting. Point and spot lights can display a volumetric effect by adjusting the "Volume strength" setting, found under Ligh

Josh

Josh

Leadwerks 3.0 Terrain Update Now Available

A new update to Leadwerks 3.0 is now available. Registered developers can run the Leadwerks updater to download and install the patch. This update adds terrain, bug fixes, and a few small feature enhancements. Our new terrain system, described in our Kickstarter campaign to bring Leadwerks to the Linux operating system, is based on a unique "dynamic megatextures" approach. This technique renders sections of the terrain into virtual textures and places them around the camera. The terrain pre

Josh

Josh

Another Design Puzzle

I have the basis of CSG editing written into the engine. It was a bit challenging to figure out just how to structure the Brush class. We have a lightweight ConvexHull entity, which is used for the camera frustum. This is an invisible volume that changes frequently, and is used to test whether objects intersect the camera's field of view. I didn't want to bloat this class with a lot of renderable surfaces, texture coordinates, vertex normals, etc. I initially thought I would derive the Brus

Josh

Josh

Sunrise, sunset

Day/night cycles are something I have thought about for a long time. There's several possible approaches to simulating these, but it wasn't until today that I decided which is best. Here are some options I considered:   1. Shader-based skies with particle clouds. This is the method Crysis employs. A subsurface scattering shader creates the sky background. The mathematics are pretty complex, but the results for an empty blue sky look great. Particle clouds are used to place sparse clouds

Josh

Josh

Vegetation

There's basically two kinds of vegetation, trees and grass.   Grass is plentiful, ubiquitous, dense, but can only be seen at a near distance. Its placement is haphazard and unimportant. It typically does not have any collision. ("Grass" includes any small plants, bushes, rocks, and other debris.)   Trees are fewer in number, larger, and can be seen from a great distance. Placement of groups of trees and individual instances is a little bit more important. Because these tend to be larger

Josh

Josh

Fun with JSON

I realized there are two main ways a plugin is going to be written, either as a Lua script or as a DLL. So I started experimenting with making a JSON file that holds the plugin info and tells the engine where to load it from: { "plugin": { "title": "Game Analytics", "description": "Add analytics to your game. Visit www.gameanalytics.com to create your free account.", "author": "© Leadwerks Software. All Rights Reserved.", "url": "https://www.turboengine.co

Josh

Josh

Halloween Horrors with Objective-C

It's November 1, and this is the longest summer I can remember in a while. Jokes about the seasons aside, last week I had trouble deciding what to do first, so I decided to attack the remaining tasks I was most scared of. This has been my strategy throughout the entire process, and it results in my work becoming progressively easier as we near the finish line.   I finished one big task today that was holding us back. We need a file system watcher for Mac computers to detect changes to the f

Josh

Josh

2016 Plans

Leadwerks is about making games, first and foremost. Therefore, you can expect me to focus on the following in the next year: More and better AAA first-party content. We're working out the process right now. It's a lot harder to produce top-quality content, but the results are worth it. I figure once we get the process down it will be easier to go back and produce more. Easy to use networking will open up a lot more gameplay possibilities and give us some fun games we can jump in and o

Josh

Josh

Model Tools

I've never coded much polygonal modeling routines, instead focusing on constructive solid geometry. I wanted to include some tools for modifying surface normals and texture coordinates. I came up with a normal calculation routine that actually uses four different algorithms, depending on the settings specified.   One thing I learned right away is you want to do away with n*n routines. That is, NEVER do this: for (i=0; i<surface->CountVertices(); i++) { for (n=0; n<surface->

Josh

Josh

Cone Step Tracing

Now that we have our voxel light data in a 3D texture we can generate mipmaps and perform cone step tracing. The basic idea is to cast a ray out from each side of each voxel and use a lower-resolution mipmap for each ray step. We start with mipmap 1 at a distance that is 1.5 texels away from the position we are testing, and then double the distance with each steo of the ray. Because we are using linear filtering we don't have to make the sample coordinates line up exactly to a texel center, and

Josh

Josh

Oculus Rift support now available [beta]

As described earlier, Oculus Rift support is now enabled on the beta branch on Steam!   Enabling VR To enable VR in any game, just add the Window::VRDisplay flag in the creation flags in the Window::Create() function: Window* window = Window::Create("My VR Game",0,0,1024,768,Window::Titlebar|Window::VRDisplay);   Or in Lua: local window = Window:Create("My VR Game",0,0,1024,768,Window.Titlebar + Window.VRDisplay)   (If you are using a Lua project, you must update the project to

Josh

Josh

Bindless Textures

The clustered forward renderer in Leadwerks 5 / Turbo Game Engine required me to implement a texture array to store all shadow maps in. Since all shadow maps are packed into a single 3D texture, the shader can access all required textures outside of the number of available texture units, which only gives 16 guaranteed slots. I realized I could use this same technique to pack all scene textures into a few arrays and completely eliminate the overhead of binding different textures. In order to

Josh

Josh

Second Performance Test: nearly 400% faster!

After observing the behavior of the previous test, I rearranged the threading architecture for even more massive performance gains. This build runs at speeds in excess of 400 FPS with 100,000 entities....on Intel integrated graphics! I've had more luck with concurrency in design than parallelism. (Images below are taken from here.) Splitting the octree recursion up into separate threads produced only modest gains. It's difficult to optimize because the sparse octree is unpredicta

Josh

Josh

Beta branch update: Tons of art pipeline enhancements

I'm happy to say I nailed the design of the Leadwerks 3 workflow overall, but there are a couple of places where there's still some friction. Because the community is going to soon be moving a lot of content into the Steam Workshop, now is a good time to take a look at those issues. It's also smart to address them before the Blender exporter is written.   A new update has been pushed out to the beta branch on Steam that contains a lot of improvements in this area. However, both the map and

Josh

Josh

Marketing begins before you write a line of code

The lean startup methodology posits that life is to short to build a product no one wants. The old way of doing business involved a limited number of companies with very high barriers to entry adopting a "push" strategy. Sears could effectively create demand for a product by choosing what they wanted to feature prominently in their mail-order catalog. Television advertisers could craft a promotional strategy that would reliably result in a certain response. Those days are over, fortunately,

Josh

Josh

×
×
  • Create New...