Jump to content

  • Log In with Google      Sign In   
  • Create Account

Leadwerks Developer Blog

Leadwerks 3 Gets Projected Shadows

Posted by , 28 April 2013 - - - - - - · 514 views

We've got a Leadwerks 3 update coming out this week, with miscellaneous fixes and some new features.

The first are the addition of Import and Export buttons in the Project Manager. You can export an entire project to a zip file. You can import a project from either a Leadwerks project file (*.werk) or a zip file. This makes it easy to share projects and synchronize your work across different computers.
Posted Image

The second new feature is projected shadows. These allow characters and other objects to cast dynamic shadows on the scene around them. They run fast, even on mobile devices, and add an extra degree of depth to your scene:
Posted Image

You can expect these updates to become available later this week.

Leadwerks 3 Rendering Enhancements

Posted by , 21 April 2013 - - - - - - · 834 views

Shadows in 3D games are important. Not only do they look good, but they communicate information about the 3D geometry of the scene. Leadwerks pioneered dynamic deferred lighting, with one of the first deferred renderers in the world on PC. However, the reality of today's situation in computing hardware has to be considered when we are designing a platform for other people build commercial products on.

To support games that reach the widest audience possible, we launched Leadwerks 3 with a baseline renderer that runs across the board on all supported platforms. The engine has been designed in a modular fashion so we can add on a new high-end deferred renderer later on, and Leadwerks games will get an instant graphics upgrade with no code changes. I am looking forward to pushing graphics even further later on when I turn my attention to the OpenGL 3.2/4.0 renderer.

Projected Shadows
As for the baseline renderer, there are a few extra enhancements I'm finishing up that will make Leadwerks 3 games look good on a wide range of hardware. In my last blog I talked about light vector maps, which store normal mapping information in a second lightmap. We delivered the results to users last week, and are am working on projected shadows, a low-cost technique Source Engine uses to provide dynamic shadows on characters and other dynamic objects in the scene.

I started by just rendering an object and getting its rendered image to line up with the original object:

Attached Image

The next step was to color the shadow black and use alpha blending, to make it look like...a shadow!:

Attached Image

The hardest part of this process, which I am still working on, is the data management. It's easy to set up a simple one-time effect like this, but making it scalable so your games keep running fast takes much more work. We don't want to re-render shadows when they aren't visible on screen, and we only want to re-render them when the orientation of the shadow caster changes. We can't simply loop through all shadow-casting objects in the scene, because that approach will slow down when more objects are added. Instead we have to build the shadow system into the scene octree so that shadows only get updated when its absolutely needed.

Post-processing Effects
Thanks to our research for GDC 2013, we found that post-processing effects on mobile are completely doable. Consequently, we're adding a few post-processing steps to finish out the baseline renderer before we move on to OpenGL 4. Bloom and HDR iris adjustment are the two that make the biggest impact on visual quality, and will be approached first. Refraction effects are easy to add, and this time we're going to make them easier for the end user to set up. The end goal is for the baseline renderer to be on par with Valve's Source Engine, and have it run on mobile.

We think these features will provide a striking visual impact on a wide range of hardware, and provide a good fallback for systems that don't support full deferred rendering. Next, we'll be moving on to terrain and a new deferred renderer based on OpenGL 3.2 / 4.0.

Leadwerks 3 Brings Native Code to Mobile Games

Posted by , 17 April 2013 - - - - - - · 1,162 views

Leadwerks Software announced today the release of Leadwerks 3, their new development platform for building mobile games with native code. Based on the technology developed for their successful game engine for PC, Leadwerks 3 brings a totally new approach to mobile game development.

While environments such as Unity and MonoDevelop use managed code...that is, code that is designed to be easily run on multiple devices...Leadwerks uses an approach called native code. Applications built with native code are optimized to work with each platform. That means games written with Leadwerks will run faster and be more powerful than their managed code counterparts.

Mobile is growing rapidly, but there still exists a gap between mobile gaming and the larger game industry, which has traditionally focused on consoles. Professional game studios overwhelmingly favor native code because of its speed and flexibility. By focusing on the standard the game industry already uses, Leadwerks provides both professional studios and indie developers with an easy pathway into mobile. Games written in C++ can be ported to Leadwerks 3 without having to rewrite them in a new programming language.

Leadwerks 3 brings some innovative new approaches to the table:
  • The editor features tools for building game levels using a technique called constructive solid geometry. This streamlines the process of creating games, and makes it easier for artists to see what their games will look like as they build them.
  • Leadwerks 3 uses automatic asset conversion. This means that images and objects can be reloaded on-the-fly, so an image file can be modified in Photoshop and the result will show up in the editor right away. This removes tedious steps from the game development workflow.
  • AI is supported out-of-the-box. The traversable areas AI can travel within are highlighted in the editor as you build your game level. Pathfinding is dynamic, meaning that if a door opens or a drawbridge lowers, the AI is smart enough to take the new routes that appear.
  • The script language Lua is also supported, and can be combined with games written in native code. Scripted objects can be linked together in a visual flowgraph editor. This makes it easy to set up game interactions, something that can be a challenge when working with development platforms based solely on code.
Leadwerks CEO Josh Klint said that “Leadwerks 3 is a big step forward for our company and our users. We’re bridging the gap between mobile gaming and the traditional game industry.” The product received a favorable response at the GDC 2013 expo. ”C++ is the game industry standard. Our market research at GDC 2013 revealed a huge demand for a cross-platform game engine built on native code. We found the design philosophy of Leadwerks resonates with a lot of developers.”

Leadwerks 3 can be purchased from the company’s website for $199, with add-ons for iOS and Android publishing available separately. A source code license is available for professional studios. A 30-day trial can be downloaded from the company’s website.

Leadwerks Software has provided game development tools to thousands of developers worldwide since 2006. It’s technology has been used in commercial games, education, training simulations, and military applications. To find out more, please visit http://www.leadwerks.com.

Using Light Vector Maps in Leadwerks 3

Posted by , 08 April 2013 - - - - - - · 1,038 views

After a wild week at GDC 2013, it's nice to be back doing what I do best...writing code!

A new build of Leadwerks 3 is now available. We've added light vector maps so that lightmapped surfaces can display normal mapping effects. This is a fantastic technique because it gives us high quality per-pixel lighting that requires very little processing, so it runs fast on mobile. Lightmapped materials with normal maps should use the texture "Common/lightvectormap.tex" in slot 4. (If you create a new lightmapped material, this will be done automatically.)
Attached Image

This technique works by calculating the average light vector that influences each luxel in the lightmap. Each vector is weighted by the light's intensity and range to get an overall vector representing the direction most light is coming from. The light vectors are encoded in a secondary light map that looks like this:
Attached Image

This effect will even work with specular reflection, as seen in this totally over-the-top screenshot:
Attached Image

We also made about a dozen small fixes to the engine and editor. For more detail on recent issues resolved, visit the bug reports forum. Like any new software, we've had some teething problems, but it's pretty easy to resolve those issues as they arise. Bugs can be fixed as they are identified, but bad design is forever. Fortunately, I think we've got a great design and a good and stable development system.