ShaderFlex - Features



Here are some of the features that make ShaderFlex so powerful.


DirectX 11 Support

Fully supports all vertex, geometry, hull, domain, pixel and compute shaders.

Connects to NodeFlex

As GPUs continue to advance, shader languages are exposing more functionality and shaders are inherently growing in complexity and size. Authoring these shaders by hand and iterating on them is getting harder and harder and harder. Making major changes to your shaders is very time consuming, especially when you want to quickly add or remove textures, constants, resources, views and passes which require tons of settings, semantics and confusing syntax. One alternative is to use NodeFlex, a a stand-alone node-based code generator to automate these redundant and error-prone tasks. You build your logic and algorithms into graph nodes using a C++ style template language and for example when you want to add a texture to your shader, you simply drop a texture node into the graph and connect it. The new shader is generated and saved to file.


We've developed an extensive graph system specifically for ShaderFlex's DX11 shaders which can be extended by users.


Full Control of the Renderer

Render passes have full control over all blend, rasterization and depth states.

Oculus Rift Support

Jump into your DK1 or DK2 and visualize your 3D scene up close and personal with a couple clicks of the mouse. Control the world scaling, per-axis sensitivity and backbuffer quality. The unwarped dual eye backbuffer is rendered to screen and also sent to the HDM using either 'Direct HMD Access' or 'Extend Desktop to HMD' display modes.







3D Connexion's SpaceMouse Support

Supports all 3DConnexion 6-degree of freedom motion controls. Works great with the Oculus HMDs. Imagine using the SpaceMouse to fly around your 3D world like you were in a zero gravity spaceship while using the DK2 to control your head and body from within the cockpit. Makes for some amazing fly throughs!







Real-Time Debug Info

Full run-time D3D debugging information reported to the user per frame. ShaderFlex taps into DirectX's runtime debug system and lets the user know if anything is set up wrong in the shader.

Dynamic Previews

ShaderFlex has a very handy thumbnail preview feature which lets you inspect data at stages in your pixel shader. Simply add one or multiple macro directive like 'PREVIEW_SAVE( Output, 1, 14 )' to your pixel shader code and ShaderFlex will automatically render the scene once for every thumbnail and output the color value in 'Output' to the user interface as a thumbnail preview. This is the same feature that is used to generate the previews that are sent back to be used in NodeFlex's graph and displayed in each node.







Simulation Stage

ShaderFlex has simulation rendering stage that runs at any user-defined frequency set to each rendering or compute pass. For example, if you want have a fur shader, you can tell it to compute the physics and collision every 0.004 seconds but at minimum every 0.002. This way your physics aren’t tied to the rendering speed, just the simulation time which can be slowed down or sped up.

Access Mesh Data in Compute Shader

A mesh's position, normal, tangent, color and uv resource buffers can be directly accessed ( read-only ) from any compute shader so you can do things like process ambient occlusion on the GPU or generate a voxel volume. Each mesh also has 4 float4 custom buffers that can also be written into.

Unordered Access and Resource Views

Supports 31 different types of shader resource views, unordered access views and render target views, each with their own special options which keeps their capabilities clear and concise.

Auto Draw

The auto-draw feature allows users to tell a render pass how many dummy vertices to render with so that you can render a shader without any actual geometry. You then use the 'SV_VertexID' system value semantic to know what vertex you are processing. I use this feature to auto-generate all screen quads, grass, lens flares and particles from the geometry shader.


Autodesk FBX Support

Full FBX support ( mesh, hierarchy, lights, cameras and animation ) which also supports all OBJ and 3DS files.

Powerful C++ Style Material Definition System

Each shader has a custom C++ style material definition which makes it easy to set up material resources, views, shaders, passes etc.

Smart Thread Group Counts

Compute passes can define thread group count as a fraction of a render target or resource size since that is not known at compile time and you may want to use a specific compute shader on a render target texture.

Auto-Register Views

Shader resource views, unordered access views and render target view, Views can be defined without tying them to fixed registers, let the engine figure this out for you. This helps aleviate a lot of annoying work trying to make sure your views are at the register your shader is expecting them to be.

Render Stages

Passes can be told to execute at any stage in the rendering pipeline ( init, simulate, compute, shadowmap, background, opaque, transparent, filter, overlay, output ). This mimics how many game engines are setup.


Give the renderer RenderCommands to tell it what pass to draw, set per-pass constants or clear render targets for example. This feature becomes especially useful when doing complex non-linear multi-pass effects where you need to loop over render passes multiple times to achieve a specific effect. This also helps you render passes out of order which is not inherently supported by pass systems that are defined in the UI like AMD's RenderMonkey for example.

Stream-Output Buffers

DirectX supports the ability to output vertex data from a vertex or geometry shader back into a stream buffer. This is supported in ShaderFlex. Simply give the render pass the name of the resource buffer you want filled and it will take care of the rest.

Draw and Dispatch Indirectly

DirectX supports the ability to make draw or dispatch calls which are driven by values from a buffer resource. Instead of having to know how many vertices to draw or how many thread groups to compute, you have a compute shader set those values dynamically into a small buffer, and the following draw or dispatch calls will use that information instead. This functionality helps keep everything on the GPU and avoid having to hardcode equivalent run-time functionality into your engine.


A good example of this feature being used is when you have a compute shader that generates a varying amount of particles into a fixed sized buffer. Your engine has no idea how many particles were created and how many to draw, so what you do is keep a running count of particles in a buffer and simply have the next draw call use that buffer to know how many to draw.


Similarly, you can have one compute shader tell the following compute shader how many thread groups to execute with by saving 3 values into a buffer for a following compute shader dispatch call.

Render Scripting

Allows users to setup their own rendering stages and dynamically control exactly what gets rendered when at run-time.

Intelligent Resources and Render Targets

Render target options to help manage re-usable resources, for example, an accumulation style motion blur would tell its render target not to be shared or used by other similar resource because it must persist from frame to frame, where a bloom quarter resolution blur target can be re-used by another effect once it is done.

Dynamically Generated Vertex/Index Buffers

Supports GPU generated vertex/index buffers from a compute shader. Build your geometry the cool way! Simply tell the pass what buffer to use for the vertex and index buffer, the stride, start and count and let it go. You can have special compute shaders for creating your static world geometry like your skybox or grass and have your compute shader run in the init stage ( only runs once at startup ), or dynamically generate your geometry every frame. Very powerful feature.

Render Rate

The rendering rate can be throttled from a min f/s to a max f/s so you don’t burn out your GPU.

Resource Previews

ShaderFlex has a dockable 'Resource' window that shows you a real-time thumbnail for all your internal or user-created resources ( targets, textures, buffers, etc ). You can also tell them to only update on idle as well as display them in the main render viewport at whatever scale you want so that you can inpect them closer.

Navigation Tools

Supports many camera and object tools as well as a 2D pointer tool that can be customized by the effect and used as wanted by the shader. for example when in pointer tool mode, in the SPH water shader, you can grab and throw water particles, or in the liquify effect you can smudge, bulge or pinch pixels etc. The shaders have full access to many mouse and keyboard states. More navigation and object control features will be added along the way.

Material Presets

Multiple materials can use the same shader, and if the shader exposes some tweaks like float values or textures, you can be tweak these values independantly from one material to another and can be saved and loaded to material presets.

Multiple Projects

You can have multiple projects loaded into ShaderPlay at the same time. Simply click on the project in the project tree and it will become current.

Flexible Viewport Window

Choose from multiple stock output resolutions or size the output to stretch to fit the window pane. Also pan and zoom the viewport image.

Disassemble HLSL Code

View the ASM codef or any shader.

Shader Compilation Statistics

Full shader compilation statistics ( register, texture, instruction counts, etc ). Hoping to get more relevant performance information like cycle count reported to the user in upcoming versions.

Render Pass Iterations

Set a render or compute pass iteration count and the rendering engine will run the shader multiple times. An iteration count and index shader variable are updated so the shader has information on what iteration it is running. For example, if you wanted to render a 40 layer fur shader, you'd simply tell the pass to iterate 40 times and your shader would alter the vertex position and fur pixels according to what iteration you are on.

Code Snippets

Plans to support code snipets and other helpful development features.

User Constants

Supports up to 32 custom float constants per pass that can be generated within the material's definition script or set manually. This enables you to reuse the same shaders in the same pass but with different custom constants to drive the desired effect.

GPU Accelerated UI

ShaderFlex is developed using ShaderPlay's proprietary GPU accelerated DirectX 11 user-interface API. The UI can render at 4k resolutions without issue and allows a seamless integration of the rendering viewports into the software for a very responsive look and feel. The interface also support DirectX's WARP software renderer just in case your video card does not support the minimum hardware acceleration requirements.

Settings Script

The settings script lets users manually set their own application settings as well as change code highlighting and similar global things.

Intellisense and Code Tips

All scripts ( material definition scirpts, settings script, etc ) support visual studios style intellisense and code tips.

Code Preview

The code editor has a code preview strip along the right side so that you can quickly jump from one area of code to another.

Engine Constants

ShaderFlex supports tons of engine driven variables which are grouped in a handful of constant buffers.