A full implementation of NVidia's SAS (Standard Annotations and Semantics) scripting results in completely automated functionality, thereby making shaders fully Plug & Play and removing unnecessary code from the calling program.

You don't have to manage the textures manually. You don't have to set each one before rendering. You don't have to manage the states. You don't have to feed in the light positions. And you definitely don't have to iterate the passes.


What, Why, How

Effect files (that is, shader files with the suffix ".fx") try to describe a complete setup for real-time rendering. That means they include not only the code for the specific vertex and pixel shader functions that will run on the GPU, but also definitions of the contexts for these shader functions: the required graphics states; the user parameters that control them (whose values may be controlled by a UI, or automatically provided by the rendering program); and in many cases, the multiple rendering passes that together draw a complete, final image. In some cases these multiple passes may be executing in varying order and there can even be interaction between multiple effect files as seen with the layered post-processing shaders for cameras.

Semantics

Semantics can hint to the renderer about connecting colors and positions to existing parts of the scene, and they can tell the renderer to load data from the scene into specific parameters. When a recognized semantic is bound to a parameter, its values will then be automatically assigned.

Annotations

Annotations eliminate guesswork by providing a mechanism to specify additional data for a parameter (light color vs. surface color). Any type of metadata can be attached to any parameter, for whatever use you desire. If the engine doesn't recognize the specific annotations to automatically fill, it can just ignore them.

Standard Annotations and Semantics

At its core, SAS simply defines a standard list. While any rendering application can use semantics and annotations as they see fit, following the standard list gives everyone the best chance of broad compatibility.

Scripting

Why would you want to script techniques and passes?

Rendering occurs in a series of discrete steps. Often, only one pass is needed to render an object (or entire scene). Sometimes, several passes are accumulated or otherwise combined. By default, the passes are simply executed in order, one after another. If that's all you need, then scripting isn't required. But it often is! For example, you may have an iterative technique that requires looping on a single pass. Or you may want to use a shadow map, which needs to be rendered to an off-screen buffer with a different render size and transform from the regular scene camera.

Besides ordering passes, scripting allows you to set the desired priority between techniques (for effects that contain multiple techniques), and to pass data to the rendering program to let it know when to execute your effect in relationship to other effects in the scene.

In short: scripting lets shaders become fully Plug & Play so they can be moved and reused between engines that support scripted SAS. For Nuclear Basic it's as simple as LoadShader tailed by SetEntShader or AddCameraShader.

Deferred Rendering

Scripted SAS allows you to take responsibility of how the surfaces in the entire scene should look, where they are rendered to (including rendering to multiple targets simultaneously), and how to display/combine/alter those final renders. The engine performs exactly what you ask even if it were as simple as clearing the screen without rendering anything at all.

A deferred renderer can be provided externally by effect authors without entangling themselves in the nuances of 3D engine design. The sample deferred rendering framework provided with Nuclear Basic uses script (less than 25 lines) to control the entire process.

Pre & Post Effects

Rendering to textures off-screen is a common method of preparing advanced effects (as with deferred rendering). Another example may be rendering the scene to a smaller texture and using it as a glow/intensity map for a brightening pass. This appears to radiate around the edges of the displayed surfaces from scaling.

The nature of this design allowed us to take NVidia's scripted SAS to the next level. You can now stack several pre & post processing shaders on top of each other simultaneously. So you get the Plug & Play with compounding to boot.

Sample Videos

Demonstration videos of the shader system:
 

What comes in Nuclear Basic?

Over 100 shaders are provided with Nuclear Basic!

These range from various surface effects (reflections, vertex bomb, etc...), pre & post processing effects (radial blur, screen frost, color filters, etc...), all the way to scene management effects like with the deferred renderer.


Download TrialDownload Trial Secure OrderSecure Order

Navigation