Jump to content
  • entries
    941
  • comments
    5,894
  • views
    870,344

About this blog

Learn about game development technology

Entries in this blog

Slider Widget

The slider widget is used for scrollbars, trackbars, and steppers. It has a lot of style options, so it's really six different widgets packed into one. (In Leadwerks Editor, a slider and textfield widget are combined to make the numerical entries you use to adjust positions and other values.)     To create a new slider you just create a widget and set the slider script: local slider = Widget:Create(230+40,140,20,20,panel) slider:SetScript("Scripts/GUI/Slider.lua")   You can then se

Josh

Josh

Skinned Animation in Vulkan

It's been nearly a year since I made the decision to port our OpenGL renderer over to Vulkan, and it has been very difficult work, but we are getting back up to speed. I was able to get skinned animation working for the first time in Vulkan yesterday, using a slightly modified version of our original animation shader code. The system works exactly the same as in Leadwerks 4, with a few differences: Animation features are confined to the Model class only, and are no longer

Josh

Josh

Single-file SPIR-V shaders for Vulkan

It is now possible to compile shaders into a single self-contained file that can loaded by any Vulkan program, but it's not obvious how this is done. After poking around for a while I found all the pieces I needed to put this together. Compiling First, you need to compile each shader stage from a source code file into a precompiled SPIR-V file. There are several tools available to do this, but I prefer GLSlangValidator because it supports the Google #include extension. Put your vertex

Josh

Josh

Siggraph Contest

This might be worth submitting a demo to: http://www.siggraph.org/s2010/for_submitters/live_real-time_demos

Josh

Josh

Should you get a Mac?

A few people have asked me about this, so now seems like a good time to talk about my experience with Mac computers. My first computer was actually an old Macintosh SE30, but of course in the 1990's Windows took over and I forgot about Mac. When I started developing Leadwerks3D I invested in a 27" iMac. It includes a 3.2 ghz quad core i3 CPU and an ATI Radeon 5750.   At the most minimal, the computer needs one cord for power, and that's it. The keyboard and mouse are wireless, and a built-

Josh

Josh

Shifting to DLCs

As described previously, the open-market model store approach does not work for Leadwerks and I am shifting my focus to providing DLCs made by third-party authors. The first thing I want to do is create more consistent branding that all DLC model packs will use. Here's what I came up with:           I'm also developing terminology to apply consistently to say what the DLC contains. The meaning of "Material Pack" and "Model Pack" is obvious. "Action Figures" will refer to charac

Josh

Josh

Shadow Filtering

Happy Friday! I am taking a break from global illumination to take care of some various remaining odds and ends in Ultra Engine. Variance shadow maps are a type of shadowmap filter technique that use a statistical sample of the depth at each pixel to do some funky math stuff. GPU Gems 3 has a nice chapter on the technique. The end result is softer shadows that run faster. I was wondering where my variance shadow map code went, until I realized this is something I only prototyped in OpenGL a

Josh

Josh in Articles

Shadow Caching

I have shadow caching working now in Turbo. This feature is already in Leadwerks Game Engine 4. The idea is that static scene geometry should not be redrawn when a dynamic object moves. Imagine a character (6000 polys) walking across a highly detailed room (100,000 polys), with one point light in the room. If we mark the scene geometry as static and the character as dynamic, then we can render a shadow map cache of the static scene once. When the character moves, the static cache is copied into

Josh

Josh

Shader Families

I started to implement quads for tessellation, and at that point the shader system reached the point of being unmanageable. Rendering an object to a shadow map and to a color buffer are two different processes that require two different shaders. Turbo introduces an early Z-pass which can use another shader, and if variance shadow maps are not in use this can be a different shader from the shadow shader. Rendering with tessellation requires another set of shaders, with one different set for each

Josh

Josh

Sell your 3D content in the Workshop Store

I am now accepting additional paid content from select authors to publish their Workshop content. Valve will take their standard 30% cut, you will receive 50% of each sale, and Leadwerks will take just 20%. If you are interested in reaching a new audience with the Workshop store, please contact me. You must be a seller with 3D models or textures in an existing marketplace for 3D content, or have a website showing your work.     More information on publishing here: http://www.leadwerks.c

Josh

Josh

Selective file inclusion (continued)

Based on a little observation, I've made the following changes to the publish routine on the beta branch: The FPS Player script has been updated so that the footstep sound files are explicitly named, so they don't get missed in the publish step. You will need to update your project to get the new script (or just copy FPSPlayer.lua to your project). There is now a checkbox to "Only include used files". If this is checked, then the new packing routine will be used, otherwise the old beha

Josh

Josh

Selective File Inclusion (Beta)

A new update on the beta branch on Steam adds selective file inclusion on publishing a project. This works by scanning map files and building a list of required files, and only packing up files that are actually used in your game. Here's how it works: All map files are always included, and scanned for required files. All script files are always included, and scanned for required files. Included prefab files are scanned for required files. Included model files are scanned for require

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

Scripted Behavior

The stock scripts that come with Leadwerks form a continually expanding game framework that can be used in many different ways. The reuse we get out of the door, switch, trigger, and AI scripts is really great. Every time I add a new script I can count on it being used in many different ways.   Sometimes this requires a custom model in order to develop and demonstrate usage of the script. It's best for me to have one model made exactly to my specs, and then make everything else conform to t

Josh

Josh

Script Update [beta]

The beta branch contains a small update which affects the SoldierAI and Projectile scripts. The SoldierAI script now has a modifiable field that lets you choose a prefab for the projectile his weapon fires. The default value is "Prefabs\Projectiles\tracer.pfb" so your existing instances of these objects will be unaffected.   By making the projectile prefab a modifiable value, we can use different types of projectiles with this script. For example, a medieval archer could fire arrows by crea

Josh

Josh

Screen-space directional occlusion

Screen-space directional occlusion (SSDO) is the next logical step after simple screen-space ambient occlusion. This routine uses a raytracing approach to approximate global illumination. You can get my shader here.  

Josh

Josh

Scenes, prefabs, and the Lua state serialization that loves them

The beta testers and I are are discussing game programming in the new engine. I want to see C++, Lua, and C# all take a near-identical approach that steals the best aspects of modern game programming and ditches the worst, to create something new and unique. To that end, we are developing the same simple game several times, with several different methodologies, to determine what really works best. One thing I realized quickly was we really need a way to load prefabs from files. I started im

Josh

Josh in Articles

Scenegraph Stuff

Discussing scene graphs in a game development or programming forum can be difficult, because I feel many people are very short-sighted about all the exceptions and complications that can arise in a flexible environment. In fact, there are many situations that will make rendering with a scene graph much slower than without. Many programmers have a tendency to ignore anticipated problems and assume it will work itself out somehow. It's also very hard to predict how bottlenecks will form and what "

Josh

Josh

Say Goodbye to Hitboxes

The limiting step on getting animated characters into Leadwerks is the creation of "hitboxes". Since vertex sknning is done entirely on the GPU, static boxes are attached to bones to approximate the shape of each limb. This works well and is efficient, but very tedious to set up. The zombie character pack, for example, would have been released much sooner if not for this task.   This morning I began with the intention of adding an option in the Model Editor to automatically calculate hit bo

Josh

Josh

Sample Sliding Door Script in Turbo / Leadwerks 5

I've successfully converter the sliding door script over to the new API. This will all look very familiar, but there are some cool points to note. The entity mass can be retrieved and set with a property as if it was just a regular variable. Underneath the hood, the engine is making method calls. I decided to prefix most field names with "slidingdoor_" to prevent other scripts from accidentally interfering. The "enabled" value, however, is meant to be shared. The Entity is

Josh

Josh

Sample FPS Player Script in New Engine

Here is a script for a first-person player. All of this is actually working now. It's very interesting that physics, rendering, culling, and Lua game code are all executing at the same time on different threads. CPU usage in a simple scene and some physics is about 35% on a quad core processor, which is good. I think the most interesting thing here is that to break the kinematic joint used to control an object the player picks up, you simply set the variable to nil. However, I did run into

Josh

Josh

S-M-R-T

I've made more progress on the model editor. I needed it to be able to resave models after making changes. First, I started with an Entity::Save function that would save all entities in the GMF format. "But wait", I thought, "I can save all entities in the GMF format!" Then I thought, even better, I can simply write a Serialize() virtual class function in the base object and extend it for each class, so that instead of writing this: stream->WriteFloat(position.x); stream->WriteFloa

Josh

Josh

Running Your Computers in 2016

I was optimizing and downsizing my computer systems yesterday, and I thought I would write a blog about how I keep my Windows, Mac, and Linux systems running, along with email on my iPhone.   Install Windows and Linux on Two Separate Hard Drives The best way to run Windows and Linux side by side is on two separate drives. Try anything else and you will run into trouble. You should unplug the other drive when installing the OS to make sure they don't interfere with each other. Use the boot

Josh

Josh

×
×
  • Create New...