Additive Blending Practical Usage

So armed with all this knowledge how can a developer ensure the smoothest, easiest and most understandable method of using the technique in their own project?

What follows is an outline of my general approach, although specific cases may justify some changes.

1. Compatibility.

First test the users system, ensure they have not set the SW 3D Renderer to 'Always use Render X'. If they have get them to set it to 'Obey content settings'. Also check they are not in software mode ( I see little point in using the effect in software only), and that the other supported API's are indeed supported.

 

2. User/Auto detection

When giving the option to activate additive blending to the user, either directly upfront at the start of the movie or within an options page, start off by checking the platform (system)

Mac

Here the only valid API is openGL, unfortunately because SDT doesn't work with openGL, and the getHardwareInfo() is unreliable on Macs, we have to make an educated guess how many fill layers to use. This can be improved by using a look up table of common 3D cards, their names and the actual number of texture units they have. This becomes our first test case.

Set up the sw3d sprite, and display the additive texture using the test case settings (num fill layers). Present the user with the sw3d sprite, and a pre render image of how it should look with additive blending. This makes it simple for the user to answer the question 'Do these images match?'. If the user answers 'Yes' then you have you additive blend settings, if they reply 'No', then we have more work to do.

This time create a list of case starting with numfilllayers = 0 to 7, but don't include the same fill layer value as the first test had, else we'd check it twice. Again set up the sw3d sprite, and display it on screen with the pre-rendered image. Its now become a case of playing 'Snap' or 'Match' with the user until they confirm a working setting, or run out of test cases. (who would have though setting an option would be so much fun - a game within a game). If they run out of tests, then we can assume for some reason additive blending is not supported on their card. For completeness you could export a log of the testcase, hardware, system etc, or direct the user to using the Additive Blending Test Tool to double check.

Example of the Additive Blend matching game ;)

 

Windows

The process starts off simpler in Windows, as we can make full use of the SDT in DX7 and DX5 to automatically determine which settings under these API's work best. This time a test case list is generated for DX7 using the 3D cards textureunits as the number of fill layers, and one for DX5 with just 1 fill layer. Both this cases are tested automatically to see if additive blending is visible. Again for piece of mind (but not necessary), we'll ask the user to confirm the test case matches the pre-render image of the first working case we find. If they reply 'Yes' our work is done, if they reply 'No' we have two options.

First option is to create a new test case list using DX7 and DX5 again, but this time loop through num fill layers = 0 to 7. Each time we ask the user to verify if the sw3d matches the pre rendered image. Alternatively we could simply jump straight to openGL (although in nearly all case DX7 or DX5 will work), and follow the same procedure as outlined for the Mac above.

A point to bear in mind on the PC, is while DX7 and openGL are close in terms of performance, the openGL check is a pain as it needs much more input from the user, so as DX5 is likely to pass no matter what, they may be no need to bother with openGL, unless performance is more important than ease of use.

These approaches to the problem should ensure that the user has as little if anything to do to activate additive blending. In the event that we need user interaction/guidance, the flow should reduce the user input to a minimum, finding a match within just a few clicks.

 

Additive Blending - Questions and Answers
 
Introduction and Contents

 

All material including text, images, source, results and demos are copyright Noisecrime Productions
You may not modify, copy, reproduce or publish in any manner the material in this tutorial which includes text, graphics, html, or anything else with out written approval.

@ 1996-2003 Noisecrime Productions