» EX9 Rendering
This site relies heavily on Javascript. You should enable it if you want the full experience. Learn more.

EX9 Rendering

Mandarin | French | Italian

DX9 - What happened so far

People who've been with vvvv from the very beginning may remember the times when there was no EX9 category of nodes yet. DX9 (or DX8 as it was called in the very beginning) was always there. The EX9 category was only introduced with the support of effects in vvvv.

Primitives in the DX9 category are simple to use, but not really flexible. They combine geometry and the drawing effect (ie. shader) in one node. Actually they are always only drawn with constant shading. No lights, no multitexturing and using the ArbitraryPoint (Transform) node to distort the DX9 nodes always feels a bit hacked as it actually messes with the downstream nodes vertexbuffer. DX9 nodes internally use the direct3d fixed function pipeline (to whom this may mean something).

EX9 - Of Effects, Vertex- and PixelShader

The EX9 category introduces the direct3d programmable pipeline to vvvv. Creation of geometry here is separated from the actual drawing, which is now user-programmable via nodes of the category EX9.Effect.

Effects are containers for vertex- and pixelshader, which in turn represent the two steps in which drawing is performed: when being drawn each vertex of a geometry is first put through the vertexshader which is a little script that can operate on the vertex' components. Shortly later in the render pipeline each visible pixel of the geometry is put through a pixelshader script which can then, considering lighting, textures and other parameters decide the pixels color.

VVVV ships with a small range of default effects:

  • Constant: draws the geometry with a color and/or texture. looks exactly like the DX9 primitives.
  • Flat, Gouraud, Phong: with Point or Directional lighting they implement classic shading algorithms to get simple 3d looks.

Those effects work for fast prototyping but are really rather dumb and can easily be adapted to use multiple lights and textures, show special shading or whatevvvver.

Explicitly dealing with Geometry

Before diving into shader code we have to get some terms straight. Make sure you understand the basics of Meshes and Vertexbuffers by reading the EX9.Geometry section. Before continuing it is also recommended to have a first peak at EX9.Spaces. Even if this may be quite abstract to you at this point it is good to have heard of it and know where you have to check back later, when you are confronted with the different spaces during shading.

Explicitly dealing with Drawing

To get an idea what is going on behind the scenes when vvvv is drawing geometry on your screen have a look at the dataflow diagram:
EX9.Dataflow

You'll need a basic understanding of the structure of effects files:
EX9.Effect.File

Here is how the effect files are being interpreted as vvvv effect nodes:
EX9.Effect.Node

Now take the step by step walk through the template effect which you most likely want to start from when creating your own effects:
EX9.Effect.Template

Before now really coding your own you may want to read a short introduction about HLSL:
EX9.HLSL.Introduction

References

Finally a list of references that come handy during shader coding:
EX9.HLSL.Semantics vvvv supported semantics
EX9.HLSL.Annotations vvvv supported annotations
Direct3D Effect States render- and samplerstates
HLSL Intrinsic Functions built in functions
HLSL DataTypes
Shader Models vs. Shader Profiles
vs_2_0 registers
ps_2_0 registers
vs_3_0 registers
ps_3_0 registers

EX9.FurtherReading

anonymous user login

Shoutbox

~7h ago

Urbankind: circuitb:Wrongcop is epic! :)

~8h ago

joreg: @tobi: use GetSlice() as the patch i referred you to is demonstrating. or start a forum thread with your patch.

~8h ago

TobiTobsen123: hmm yes i can see the values...but how to handle them as seperate values? I need to forward them via TCP/IP...

~9h ago

joreg: @tobi: OSCDecoder helppatch has a section: OSC_Advanced (bottomright) that demoes decoding of multiple messages

~10h ago

TobiTobsen123: I'm using an OSCDecoder, it receives two arguments...works but how can I seperate the arguments into two seperate values

~12h ago

u7angel: @mediadog, make it a forum question.

~12h ago

u7angel: @mediadog, tty renderer ?

~15h ago

microdee: however non-conductive objects are invisible for this so the pencil and the sticks in the video are still a mysteries