{
  "Name": "_renderFasterParticles",
  "_id": "53c4e607-d97b-49c1-b935-74a2b9e4303d",
  "Namespace": "lib.geometry.particles",
  "Description": "",
  "Inputs": [
    {
      "Name": "InitCode",
      "MetaInstanceID": "fec785ec-4383-4337-9f32-3cf9c1d29199",
      "DefaultValue": {
        "Type": "Text",
        "Value": [
          "//>>> InitParticle\r",
          "struct Particle\r",
          "{\r",
          "    float3 EmitPosition;\r",
          "    float TrailIndex;\r",
          "    float3 EmitVelocity;\r",
          "    float EmitTime;\r",
          "    float EmitIndex;\r",
          "    float3 __fillUp1;\r",
          "    float4 __fillUp2;\r",
          "};\r",
          "\r",
          "Texture2D NoiseTextureRGB : register (t0);\r",
          "\r",
          "RWStructuredBuffer<Particle> ParticleStates : register (u0);\r",
          "SamplerState samLinear : register(s0);\r",
          "\r",
          "// Important: This has to match the struct-layout of ParticleInitParametersBufferLayout\r",
          "cbuffer InitParticleParams : register(b0)\r",
          "{\r",
          "    int StartIndex;\r",
          "    int EmitCount;\r",
          "    float Time;\r",
          "    int ParticleCount;\r",
          "    \r",
          "    float3 EmitPosition;\r",
          "    float LimitPositions;\r",
          "        \r",
          "    float3 PreviousEmitPosition;\r",
          "    float EmitStartTime;\r",
          "\r",
          "    float3 EmitterSize;\r",
          "    float EmitPeriod;\r",
          "\r",
          "    float2 EmitVelocity;\r",
          "    int TrailsLength;\r",
          "    int EmitterShape;\r",
          "\r",
          "    float2 EmitAngleA;\r",
          "    float2 EmitAngleB;\r",
          "\r",
          "\r",
          "    float3 BoxSubDivision;\r",
          "    float PreviousEmitAngleA;\r",
          "\r",
          "    float3 Scatter;\r",
          "    float PreviousEmitAngleB;\r",
          "    \r",
          "    //float __dummy;\r",
          "\r",
          "};\r",
          "\r",
          "\r",
          "\r",
          "\r",
          "\r",
          "cbuffer UpdateParticleParams : register(b1)\r",
          "{\r",
          "    float4 DeltaTime;\r",
          "};\r",
          "\r",
          "float3 rotate(float3 v, float3 axis, float angle)\r",
          "{\r",
          "    float ux = axis.x*v.x;\r",
          "    float uy = axis.x*v.y;\r",
          "    float uz = axis.x*v.z;\r",
          "    float vx = axis.y*v.x;\r",
          "    float vy = axis.y*v.y;\r",
          "    float vz = axis.y*v.z;\r",
          "    float wx = axis.z*v.x;\r",
          "    float wy = axis.z*v.y;\r",
          "    float wz = axis.z*v.z;\r",
          "    float sa = sin(angle);\r",
          "    float ca = cos(angle);\r",
          "    return float3(axis.x*(ux+vy+wz)+(v.x*(axis.y*axis.y+axis.z*axis.z)-axis.x*(vy+wz))*ca+(-wy+vz)*sa,\r",
          "                  axis.y*(ux+vy+wz)+(v.y*(axis.x*axis.x+axis.z*axis.z)-axis.y*(ux+wz))*ca+(wx-uz)*sa,\r",
          "                  axis.z*(ux+vy+wz)+(v.z*(axis.x*axis.x+axis.y*axis.y)-axis.z*(ux+vy))*ca+(-vx+uy)*sa);\r",
          "}\r",
          "\r",
          "#define M_PI 3.14159265358979323846\r",
          "float Noise(int x, int seed)\r",
          "{\r",
          "    int n = x + seed*137;\r",
          "    n = (n<<13) ^ n;\r",
          "    return (float)( 1.0 - ( (n * (n * n * 15731 + 789221) + 1376312589) & 0x7fffffff) / 1073741824.0);\r",
          "}\r",
          "\r",
          "float3 random(int x)\r",
          "{\r",
          "    return float3(Noise(x, x), Noise(x*1.5, x*1.5), Noise(x*3.75, x*3.75));\r",
          "}\r",
          "\r",
          "\r",
          "float Lerp(float a, float b, float t)\r",
          "{\r",
          "    return a + t * (b - a);\r",
          "}\r",
          "\r",
          "\r",
          "float Fade(float t)\r",
          "{\r",
          "    return t * t * t * (t * (t * 6 - 15) + 10);\r",
          "}\r",
          "\r",
          "\r",
          "float getNoise(float value, float zoom, float noiseTime, int seed, float period)\r",
          "{\r",
          "    value /= zoom;\r",
          "    value += noiseTime;\r",
          "        \r",
          "    float noiseSum = 0;\r",
          "    for(int a=0; a<4; a++) {\r",
          "        float f = (float)pow(2,a); \r",
          "        float amplitude = (float)pow(period ,a);\r",
          "\r",
          "        float v = value*f / zoom;\r",
          "       \r",
          "        noiseSum += Lerp( Noise( (int)v  , (int)seed ),\r",
          "                          Noise( (int)v+1, (int)seed ),\r",
          "                          Fade( v - (float)floor(v) ) )* amplitude;\r",
          "    }   \r",
          "    return noiseSum;    \r",
          "}\r",
          "\r",
          "\r",
          "[numthreads(512, 1, 1)]\r",
          "void CSInitParticles(uint3 threadID : SV_DispatchThreadID)\r",
          "{\r",
          "    int indexInBuffer = threadID.x;\r",
          "    \r",
          "    if( indexInBuffer > ParticleCount)\r",
          "        return;\r",
          "\r",
          "    if (indexInBuffer < StartIndex || indexInBuffer >= StartIndex + EmitCount)\r",
          "        return;\r",
          "\r",
          "    int index = (indexInBuffer-StartIndex);\r",
          "    int emitIndex = index / (TrailsLength+1);\r",
          "    int trailIndex = index % (TrailsLength+1);\r",
          "    \r",
          "    float emitTime = EmitStartTime + (emitIndex) * EmitPeriod;\r",
          "    int overallIndex = abs((emitTime / EmitPeriod) - 0.5);\r",
          "    \r",
          "    float3 noise3b = NoiseTextureRGB.SampleLevel(samLinear, overallIndex * float2(1.45323, 12.2123)  % float2(12.1,12.4), 0);\r",
          "\r",
          "    int indexForLimitedPositions = (int) (overallIndex % LimitPositions);\r",
          "    \r",
          "    float emitIndexFactor = 1-emitIndex/(float)EmitCount;\r",
          "    \r",
          "    float3 blendedEmitPos = EmitPosition + ( PreviousEmitPosition-EmitPosition) * emitIndexFactor;\r",
          "    float angleA = EmitAngleA.x + (PreviousEmitAngleA - EmitAngleA.x)* emitIndexFactor;\r",
          "    float angleB = EmitAngleB.x + (PreviousEmitAngleB - EmitAngleB.x)* emitIndexFactor;\r",
          "    \r",
          "    float3 emitDirection;\r",
          "    float3 pos = blendedEmitPos;\r",
          "    \r",
          "    // Box\r",
          "    if( EmitterShape ==0) {\r",
          "        if (LimitPositions < 0.5)\r",
          "        {\r",
          "            pos = (random(overallIndex) - float3(0, 0, 0)) * EmitterSize * 0.5 + pos;\r",
          "            pos += Scatter*(random(overallIndex) - float(0.5));\r",
          "        }\r",
          "        else\r",
          "        {            \r",
          "            float x = (int)( indexForLimitedPositions % BoxSubDivision.x)/ BoxSubDivision.x;\r",
          "            float y = (int)((indexForLimitedPositions/BoxSubDivision.x) % BoxSubDivision.y) / BoxSubDivision.y;\r",
          "            float z = (int)((indexForLimitedPositions/BoxSubDivision.x/BoxSubDivision.y)) / BoxSubDivision.z;\r",
          "                                                                    \r",
          "            pos += float3( (x- (BoxSubDivision.x > 1 ? 0.5 : 0)),\r",
          "                           (y- (BoxSubDivision.y > 1 ? 0.5 : 0)),\r",
          "                           (z- (BoxSubDivision.z > 1 ? 0.5 : 0))) * EmitterSize;            \r",
          "            \r",
          "            pos += Scatter*(random(indexForLimitedPositions) - float3(0.5,0.5,0.5));\r",
          "        }\r",
          "        \r",
          "        float alpha = (angleA + (noise3b.y - 0.5) * EmitAngleA.y) * M_PI/180;\r",
          "        float beta =  M_PI/2 + (angleB + (noise3b.z - 0.5) * EmitAngleB.y) * M_PI/180;       \r",
          "        float3 direction = float3( sin(alpha), cos(alpha) , 0 );                \r",
          "        emitDirection = rotate(direction, float3(0,1,0), beta);\r",
          "        \r",
          "        \r",
          "    }\r",
          "    // Sphere\r",
          "    else if(EmitterShape == 1) {        \r",
          "        if( LimitPositions > 0.5) {\r",
          "            float phi;\r",
          "            float y;\r",
          "            float r;\r",
          "            float inc = M_PI*(3.0 - sqrt(5.0));\r",
          "            float off = 2.0f/(LimitPositions + 1.0f);\r",
          "            y = indexForLimitedPositions*off - 1.0f + (off/2.0f);\r",
          "            r = sqrt(1.0 - y*y);\r",
          "            phi = indexForLimitedPositions*inc;\r",
          "            pos = float3( cos(phi)*r, y, sin(phi)*r);\r",
          "        }\r",
          "        else {\r",
          "            float phi;\r",
          "            float y;\r",
          "            float r;\r",
          "            float posCount = 100000;\r",
          "            float random = noise3b.x * 100 % 1;\r",
          "            float inc = M_PI*(3.0 - sqrt(5.0));\r",
          "            float off = 2.0f/(posCount + 1.0f);\r",
          "            float indexForLimitedPositions = random * posCount;\r",
          "            y = indexForLimitedPositions*off - 1.0f + (off/2.0f);\r",
          "            r = sqrt(1.0 - y*y);\r",
          "            phi = indexForLimitedPositions*inc;\r",
          "            pos = float3( cos(phi)*r, y, sin(phi)*r);\r",
          "        }\r",
          "                \r",
          "        float alpha = atan2(pos.x, pos.y);\r",
          "        float beta =  atan2(pos.x, pos.z);\r",
          "        alpha += (angleA + (noise3b.y - 0.5) * EmitAngleA.y) * M_PI/180;\r",
          "        beta  += (angleB + (noise3b.z - 0.5) * EmitAngleB.y) * M_PI/180;\r",
          "        emitDirection = float3( sin(alpha), cos(alpha) , cos(beta) );\r",
          "        pos*= EmitterSize;\r",
          "        pos+= blendedEmitPos;\r",
          "    }\r",
          "    \r",
          "    // Ring\r",
          "    else  {\r",
          "        float n=0;\r",
          "        float alpha;\r",
          "        float beta = 0;\r",
          "        if( LimitPositions < 0.5) {\r",
          "            alpha = noise3b.z * 1000;  \r",
          "        }\r",
          "        else {\r",
          "            alpha = indexForLimitedPositions / LimitPositions * M_PI * 2;\r",
          "        }\r",
          "        pos += float3( sin (alpha) ,  (noise3b.z -0.5)  , cos(alpha)) * EmitterSize;\r",
          "        alpha += (angleA + (noise3b.y - 0.5) * EmitAngleA.y) * M_PI/180;    \r",
          "        beta =  (angleB + (noise3b.z - 0.5) * EmitAngleB.y) * M_PI/180;\r",
          "        emitDirection = float3(  sin(alpha) * cos(beta) , sin(beta), cos(alpha) * cos(beta));\r",
          "    }\r",
          "\r",
          "    // setup particle struct\r",
          "    Particle p = ParticleStates[indexInBuffer]; \r",
          "    \r",
          "    p.EmitPosition.xyz = pos;\r",
          "    p.TrailIndex = trailIndex;\r",
          "    p.EmitVelocity.xyz = emitDirection.xyz*(EmitVelocity.x + EmitVelocity.y * (noise3b.z-0.5));\r",
          "    p.EmitTime = emitTime;\r",
          "    p.EmitIndex = overallIndex;\r",
          "    ParticleStates[indexInBuffer] = p;\r",
          "}\r",
          "//<<< InitParticle\r",
          ""
        ]
      },
      "MetaID": "c522a66e-3260-4692-b3e3-79fd0361fa3d",
      "IsMultiInput": "False",
      "Relevance": "Optional",
      "Description": "",
      "Min": "-100000",
      "Max": "100000",
      "Scale": "0.1",
      "ScaleType": "Linear",
      "EnumValues": []
    },
    {
      "Name": "RenderCode",
      "MetaInstanceID": "1acc27f4-d3f9-4d0b-892f-0edbedb72625",
      "DefaultValue": {
        "Type": "Text",
        "Value": [
          "//>>> RenderParticle\r",
          "//>>> _common parameters\r",
          "float4x4 objectToWorldMatrix;",
          "float4x4 worldToCameraMatrix;",
          "float4x4 projMatrix;",
          "Texture2D txDiffuse;",
          "float2 RenderTargetSize;",
          "//<<< _common parameters\r",
          "\r",
          "//>>> _parameters\r",
          "Texture2D Texture;",
          "float ParticleCount;",
          "float LifeTime;",
          "float EmitRate;",
          "float3 EmitPosition;",
          "float ResetTrigger;",
          "float3 EmitterSize;",
          "float LimitPositions;",
          "float3 Scatter;",
          "float2 EmitVelocity;",
          "float2 EmitAngleA;",
          "float2 EmitAngleB;",
          "float EmitFrom;",
          "float2 Size;",
          "float3 Stretch;",
          "float StretchByMotion;",
          "float2 ShrinkOverTime;",
          "float Orientation;",
          "float VelocityFriction;",
          "float3 Gravity;",
          "float4 Turbulence;",
          "float2 TextureCells;",
          "float4 ColorStart;",
          "float4 ColorVariation;",
          "float4 ColorEnd;",
          "float2 FadeWithAge;",
          "float2 Focus;",
          "float2 FadeTooClose;",
          "float ParametersAffect;",
          "Texture2D NoiseTextureRGB;",
          "float2 Trails;",
          "float2 FadeTooFar;",
          "float TurbulenceFadeIn;",
          "//<<< _parameters\r",
          "\r",
          "float Time;\r",
          "//float RandomSeed;\r",
          "\r",
          "\r",
          "\r",
          "\r",
          "\r",
          "//- Helpers-----------------------------------------------------------------\r",
          "\r",
          "[numthreads(512, 1, 1)]\r",
          "float3 rgb2hsv(float3 c)\r",
          "{\r",
          "    float4 K = float4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0);\r",
          "    float4 p = lerp(float4(c.bg, K.wz), float4(c.gb, K.xy), step(c.b, c.g));\r",
          "    float4 q = lerp(float4(p.xyw, c.r), float4(c.r, p.yzx), step(p.x, c.r));\r",
          " \r",
          "    float d = q.x - min(q.w, q.y);\r",
          "    float e = 1.0e-10;\r",
          "    return float3(abs(q.z + (q.w - q.y) / (6.0 * d + e)), d / (q.x + e), q.x);\r",
          "}\r",
          " \r",
          "[numthreads(512, 1, 1)]\r",
          "float3 hsv2rgb(float3 c)\r",
          "{\r",
          "    float4 K = float4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);\r",
          "    float3 p = abs(frac(c.xxx + K.xyz) * 6.0 - K.www);\r",
          "    return c.z * lerp(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);\r",
          "}\r",
          "\r",
          "[numthreads(512, 1, 1)]\r",
          " float Noise(int x, int seed)\r",
          "{\r",
          "    int n = x + seed*137;\r",
          "    n = (n<<13) ^ n;\r",
          "    return (float)( 1.0 - ( (n * (n * n * 15731 + 789221) + 1376312589) & 0x7fffffff) / 1073741824.0);\r",
          "}\r",
          "\r",
          "[numthreads(512, 1, 1)]\r",
          "float Lerp(float a, float b, float t)\r",
          "{\r",
          "    return a + t * (b - a);\r",
          "}\r",
          "\r",
          "[numthreads(512, 1, 1)]\r",
          "float BlendFade(float t)\r",
          "{\r",
          "    return t * t * t * (t * (t * 6 - 15) + 10);\r",
          "}\r",
          "\r",
          "[numthreads(512, 1, 1)]\r",
          "float getNoise(float value, float zoom, float noiseTime, int seed, float period)\r",
          "{\r",
          "    value /= zoom;\r",
          "    value += noiseTime;\r",
          "        \r",
          "    float noiseSum = 0;\r",
          "    for(int a=0; a<20; a++) {\r",
          "        float f = (float)pow(2,a); \r",
          "        float amplitude = (float)pow(period ,a);\r",
          "\r",
          "        float v = value*f / zoom;\r",
          "       \r",
          "        noiseSum += Lerp( Noise( (int)v  , (int)seed ),\r",
          "                          Noise( (int)v+1, (int)seed ),\r",
          "                          BlendFade( v - (float)floor(v) )\r",
          "                    )* amplitude;\r",
          "    }   \r",
          "    return noiseSum;    \r",
          "}\r",
          "\r",
          "[numthreads(512, 1, 1)]\r",
          "float3 getNoiseOffset(float3 pos) \r",
          "{\r",
          "    float period = 1;\r",
          "    float RandomSeed = 6;\r",
          "    \r",
          "    float t1 = Turbulence.y*0.1;\r",
          "    float t2 = Turbulence.y*0.1;\r",
          "\r",
          "    float3 noise1 = float3(getNoise(pos.x + pos.y +146.3f + t2, Turbulence.z,  -t1, RandomSeed , period),\r",
          "                           getNoise(pos.x + pos.z +219.3f + t2, -Turbulence.z, +t1, RandomSeed , period ),\r",
          "                           getNoise(pos.y + pos.z +210.3f + t2, Turbulence.z,  -t1, RandomSeed , period ));\r",
          "\r",
          "    float3 noise2 = float3(getNoise(pos.z + pos.x +321.23f - t2, Turbulence.z, -t1/2, RandomSeed , period ),\r",
          "                           getNoise(pos.x + pos.z +131.73f - t2, Turbulence.z, +t1/2, RandomSeed , period ),\r",
          "                           getNoise(pos.x + pos.y +341.33f - t2, Turbulence.z, -t1/2, RandomSeed , period ));\r",
          " \r",
          "    float3 noise3 = float3(getNoise(pos.x + pos.z +191.73f + t2, Turbulence.z, -t1, RandomSeed , period ),\r",
          "                           getNoise(pos.x + pos.y +231.23f - t2, Turbulence.z, +t1, RandomSeed , period ),\r",
          "                           getNoise(pos.y + pos.z  +23.33f + t2, Turbulence.z, -t1, RandomSeed , period ));\r",
          "\r",
          "    float3 noiseCombined = noise1+noise2+noise3;\r",
          "    return noiseCombined;\r",
          "}\r",
          "//--------------------------------------------------------------------------\r",
          "\r",
          "\r",
          "static const float scale = 0.5f;\r",
          "\r",
          "static const float2 g_texcoords[4] = \r",
          "{ \r",
          "    float2( -1, -1 ), \r",
          "    float2( 1, -1 ),\r",
          "    float2( -1, 1 ),\r",
          "    float2( 1, 1 ),\r",
          "};\r",
          "\r",
          "struct Particle\r",
          "{\r",
          "    float3 EmitPosition;\r",
          "    float TrailIndex;\r",
          "    float3 EmitVelocity;\r",
          "    float EmitTime;\r",
          "    float EmitIndex;\r",
          "    float3 __fillUp1;\r",
          "    float4 __fillUp2;\r",
          "};\r",
          "\r",
          "\r",
          "StructuredBuffer<Particle> ParticleStates;\r",
          "\r",
          "//>>> _setup\r",
          "SamplerState samLinear",
          "{",
          "    Filter = MIN_MAG_MIP_LINEAR;",
          "    AddressU = Clamp;",
          "    AddressV = Clamp;",
          "};",
          "//<<< _setup\r",
          "\r",
          "SamplerState samLinearWrapped\r",
          "{\r",
          "    Filter = MIN_MAG_MIP_LINEAR;\r",
          "    AddressU = Wrap;\r",
          "    AddressV = Wrap;\r",
          "};\r",
          "\r",
          "\r",
          "\r",
          "//>>> __declarations\r",
          "struct GS_INPUT",
          "{",
          "    float3 renderPosition : renderPosition;",
          "    float3 renderVelocity : renderVelocity;",
          "    float lifeProgress: Value1;",
          "    float emitTime: Value2;",
          "    int emitIndex:emitIndex;",
          "    int trailSegmentIndex:trailSegmentIndex;",
          "};",
          "",
          "struct PS_INPUT",
          "{",
          "    float4 pos : SV_POSITION;",
          "    float2 texCoord: TEXCOORD0;",
          "    float4 color: color;",
          "    ",
          "};",
          "//<<< __declarations\r",
          "\r",
          "float3 getTurbulenceOffset(float3 p, float t) \r",
          "{\r",
          "    float3 noise1 = (NoiseTextureRGB.SampleLevel(samLinearWrapped, (p.xz + (t+ Turbulence.y)*10 * float3(0.14,0.53,0.41) ) / Turbulence.z , 0).xyz - float3(0.5, 0.5, 0.5));    \r",
          "    float3 noise2 = (NoiseTextureRGB.SampleLevel(samLinearWrapped, (p.yz + (t+ Turbulence.y)*6 * float3(0.41,0.31,0.01) ) / Turbulence.z , 0).xyz - float3(0.5, 0.5, 0.5));    \r",
          "    float3 noise3 = (NoiseTextureRGB.SampleLevel(samLinearWrapped, (p.yx + (t+ Turbulence.y)*9 * float3(0.74,0.15,0.55) ) / Turbulence.z , 0).xyz - float3(0.5, 0.5, 0.5));    \r",
          "    float3 noiseCombined = noise1+noise2+noise3;\r",
          "    return noiseCombined;\r",
          "}\r",
          "\r",
          "float3 getParticlePosition(Particle p, float age)\r",
          "{    \r",
          "    float3 pos = p.EmitPosition +  age * p.EmitVelocity;\r",
          "    pos += p.EmitVelocity *  pow(age,1/VelocityFriction);\r",
          "    pos += Gravity * age*age /2;\r",
          "    pos += getTurbulenceOffset(pos, p.EmitTime * Turbulence.w )* Turbulence.x * smoothstep(0,1, age/LifeTime * TurbulenceFadeIn);\r",
          "    return pos;\r",
          "}\r",
          "\r",
          "\r",
          "//>>> __VS \r",
          "GS_INPUT VS( in uint vertexId : SV_VertexID )\r",
          "{\r",
          "\tGS_INPUT output = (GS_INPUT)0;\t    \r",
          "    Particle p = ParticleStates[vertexId];\r",
          "    \r",
          "    float age = (Time - p.EmitTime);\r",
          "    float ageOfTrailSegment = age + (-p.TrailIndex * Trails.y); \r",
          "\t\r",
          "\tfloat dt = 0.1;\r",
          "\tfloat3 pos1 = getParticlePosition(p, ageOfTrailSegment);\r",
          "\t\r",
          "\tswitch(Orientation) {\r",
          "        // Billboard\r",
          "        case 0: \r",
          "            output.renderVelocity = float3(0,1,0);\r",
          "            break;\r",
          "            \r",
          "    \t// Random\t\r",
          "        case 1:\r",
          "            output.renderVelocity = float3( sin( p.EmitIndex), cos(p.EmitIndex), 0);\r",
          "            break;\r",
          "            \r",
          "        // Motion\r",
          "        case 2:\r",
          "            float3 pos2 = getParticlePosition(p, ageOfTrailSegment+dt);            \r",
          "            output.renderVelocity = pos2 - pos1;\r",
          "            pos1 += (pos2-pos1)*0.5;            \r",
          "            break;\r",
          "            \r",
          "        // Emit Direction            \r",
          "        case 3:\r",
          "    \t   output.renderVelocity = p.EmitVelocity;\r",
          "            break;\t\r",
          "\t}\r",
          "\r",
          "\toutput.renderPosition = pos1;\r",
          "\t//output.lifeProgress = ageOfTrailSegment / (LifeTime + abs(Trails.x*Trails.y)) + (ageOfTrailSegment + Trails.x*Trails.y)/LifeTime;\r",
          "\t//output.lifeProgress = ageOfTrailSegment / (LifeTime + abs(Trails.x*Trails.y));\r",
          "\toutput.lifeProgress = ageOfTrailSegment / LifeTime;\r",
          "\t//output.lifeProgress =  1/LifeTime;\r",
          "\toutput.emitTime = p.EmitTime;\r",
          "\toutput.emitIndex = p.EmitIndex;\r",
          "\toutput.trailSegmentIndex = p.TrailIndex;\r",
          "\r",
          "\treturn output;\r",
          "}\r",
          "//<<< __VS\r",
          "\r",
          "\r",
          "//>>> __GS\r",
          "[maxvertexcount(4)]\r",
          "void GS( point GS_INPUT input[1], inout TriangleStream<PS_INPUT> SpriteStream )\r",
          "{\r",
          "\tPS_INPUT output = (PS_INPUT)0;\r",
          "    int emitIndex =   input[0].emitIndex; \r",
          "    float lifeProgress = input[0].lifeProgress;    \r",
          "    float3 noise3b = NoiseTextureRGB.SampleLevel(samLinearWrapped, emitIndex * float2(13.45123, 21.2123) % float2(56,57),1);\r",
          "\r",
          "    // Orientation and size\r",
          "    float4 viewposition = mul(float4(input[0].renderPosition, 1.0f), objectToWorldMatrix);\r",
          "    float4 cameraTVelocity = mul(float4(input[0].renderVelocity, 0.0f), objectToWorldMatrix);\r",
          "    viewposition = mul(viewposition, worldToCameraMatrix);\r",
          "    cameraTVelocity = mul(cameraTVelocity, worldToCameraMatrix);\r",
          "    float velocity = length(cameraTVelocity.xy);\r",
          "    float2 direction = cameraTVelocity.xy/velocity;\r",
          "    float2 up = direction * Size.x;\r",
          "    float2 right = float2(direction.y, -direction.x) * Size.x;\r",
          "    \r",
          "    float scaleOverLife =  smoothstep(0, ShrinkOverTime.x, lifeProgress)*smoothstep(0, 1 - ShrinkOverTime.y, 1 - lifeProgress) ;\r",
          "    scaleOverLife *= 1 - noise3b.y * Size.y;    // Add random-size\r",
          "    up    *= scaleOverLife * Stretch.x * (velocity*StretchByMotion+1);\r",
          "    right *= scaleOverLife * Stretch.y;\r",
          "    \r",
          "    float distance = viewposition.z;\r",
          "\r",
          "    // Color and opacity\r",
          "    float3 noise3a = NoiseTextureRGB.SampleLevel(samLinearWrapped, emitIndex * float2(0.15141, 1.1241) % float2(13,14),1);    \r",
          "    float3 hsvStart= rgb2hsv(ColorStart.rgb);\r",
          "    float3 hsvEnd= rgb2hsv(ColorEnd.rgb);\r",
          "    hsvStart.xyz += (noise3a.xyz - float3(0,0.5,0.5)) * ColorVariation.xyz * float3(2,5,5);\r",
          "    hsvEnd.xyz   += (noise3a.xyz - float3(0,0.5,0.5)) * ColorVariation.xyz * float3(2,5,5);\r",
          "                \r",
          "    float4 colorStart = float4(hsv2rgb(hsvStart), ColorStart.a - noise3a.x * ColorVariation.a*2);\r",
          "    float4 colorEnd =   float4(hsv2rgb(hsvEnd),   ColorEnd.a - noise3a.x * ColorVariation.a*2);\r",
          "    float4 color =lerp(colorStart, colorEnd, lifeProgress);\r",
          "    color.a = clamp(color.a,0,1);\r",
          "       \r",
          "    float fadeAtBeginning = smoothstep(0,1,  lifeProgress/FadeWithAge.x );\r",
          "    float fadeAtEnd =  clamp( 1- (lifeProgress -1 + FadeWithAge.y)/FadeWithAge.y,  0,1);    \r",
          "    float fadeTooClose = smoothstep(0,1, (distance  - FadeTooClose.x) / (FadeTooClose.y+0.001));    \r",
          "    \r",
          "    float fadeTooFar = smoothstep(1,0, (distance - FadeTooFar.x) / (FadeTooFar.y+0.001));    \r",
          "    \r",
          "\r",
          "    float alphaVariation = (1- noise3b.x * ColorVariation.a *3);\r",
          "    float alphaFactor = alphaVariation * fadeTooClose * fadeAtBeginning * fadeAtEnd;\r",
          "    color.a *= fadeAtBeginning * fadeAtEnd * fadeTooClose * fadeTooFar;\r",
          "  \r",
          "\r",
          "    // Use Texture-Cells for Depth of field and random-textures\r",
          "    float column = 0;\r",
          "    float columnWidth = 1.0/(int)TextureCells.x;\r",
          "    float columnWidthHalf = columnWidth*0.5;    \r",
          "    if( TextureCells.x > 1 && Focus.x > 0) {\r",
          "        column = (int)(TextureCells.x* abs(distance-Focus.x)/Focus.y) *columnWidth + columnWidthHalf; \r",
          "    }\r",
          "    else {\r",
          "        column = (0.5)/(int)TextureCells.x;    \r",
          "        //column = (int)(TextureCells.x* 0 *columnWidth + columnWidthHalf); \r",
          "    }\r",
          "    float rowHeight = 1.0/(int)TextureCells.y;\r",
          "    float rowHeightHalf = rowHeight*0.5;\r",
          "    float row =  (int)((noise3b.y * 1213.123 * TextureCells.y ) % TextureCells.y) * rowHeight + rowHeightHalf;\r",
          "\r",
          "    // Create sprite quad\r",
          "    float4 positions[4] =\r",
          "    {\r",
          "        float4(-scale*right +  scale*up, 0, 0),\r",
          "        float4( scale*right +  scale*up, 0, 0),\r",
          "        float4(-scale*right + -scale*up, 0, 0),\r",
          "        float4( scale*right + -scale*up, 0, 0),\r",
          "    };\r",
          "\r",
          "    for (int i = 0; i < 4; ++i)\r",
          "    {\r",
          "\t\toutput.pos = mul(viewposition + positions[i], projMatrix);\r",
          "        float u = column + columnWidthHalf*g_texcoords[i].x;\r",
          "        float v = row + rowHeightHalf*g_texcoords[i].y;\r",
          "        output.texCoord = float2(u, v);\r",
          "        output.color = color;\r",
          "        SpriteStream.Append(output);\r",
          "    }\r",
          "    \r",
          "\tSpriteStream.RestartStrip();\r",
          "}\r",
          "//<<< __GS\r",
          "\r",
          "//>>> __PS\r",
          "float4 PS( in PS_INPUT input ) : SV_TARGET\r",
          "{\r",
          "    float4 c = Texture.Sample(samLinear, input.texCoord) * input.color;\r",
          "    //c.a *= input.opacity; // Hack\r",
          "    \r",
          "    //c= float4(1,1,1,1);\r",
          "    return c;\r",
          "}\r",
          "//<<< __PS\r",
          "\r",
          "//>>> __technique\r",
          "technique10 Render",
          "{",
          "    pass P0",
          "    {",
          "        SetVertexShader( CompileShader( vs_5_0, VS() ) );",
          "        SetGeometryShader( CompileShader( gs_5_0, GS() ) );",
          "        SetPixelShader( CompileShader( ps_5_0, PS() ) );",
          "    }",
          "}",
          "//<<< __technique\r",
          "\r",
          "",
          "//<<< RenderParticle\r",
          ""
        ]
      },
      "MetaID": "c522a66e-3260-4692-b3e3-79fd0361fa3d",
      "IsMultiInput": "False",
      "Relevance": "Optional",
      "Description": "",
      "Min": "-100000",
      "Max": "100000",
      "Scale": "0.1",
      "ScaleType": "Linear",
      "EnumValues": []
    },
    {
      "Name": "Texture",
      "MetaInstanceID": "410359ff-e9bf-43c6-baea-ca7e509e0913",
      "DefaultValue": {
        "Type": "Image",
        "Value": "Framefield.Core.Image"
      },
      "MetaID": "9848060d-fd84-45b0-b658-d0d531c61dab",
      "IsMultiInput": "False",
      "Relevance": "Required",
      "Description": "",
      "Min": "-100000",
      "Max": "100000",
      "Scale": "0.1",
      "ScaleType": "Linear",
      "EnumValues": []
    },
    {
      "Name": "ParticleCount",
      "MetaInstanceID": "e65de08d-ac22-498f-b73f-de5ed88e04c2",
      "DefaultValue": {
        "Type": "Float",
        "Value": "10000"
      },
      "MetaID": "3f76dee3-3897-44ac-82d6-25ce9f53a506",
      "IsMultiInput": "False",
      "Relevance": "Optional",
      "Description": "",
      "Min": "1",
      "Max": "1E+08",
      "Scale": "1",
      "ScaleType": "Quadratic",
      "EnumValues": []
    },
    {
      "Name": "LifeTime",
      "MetaInstanceID": "8fd75bbf-15d0-40ac-8cb1-4e7603d4a249",
      "DefaultValue": {
        "Type": "Float",
        "Value": "0"
      },
      "MetaID": "3f76dee3-3897-44ac-82d6-25ce9f53a506",
      "IsMultiInput": "False",
      "Relevance": "Optional",
      "Description": "",
      "Min": "0",
      "Max": "100000",
      "Scale": "0.1",
      "ScaleType": "Linear",
      "EnumValues": []
    },
    {
      "Name": "EmitRate",
      "MetaInstanceID": "bbac9642-ce0f-4bb1-a1b0-daca80cae2ea",
      "DefaultValue": {
        "Type": "Float",
        "Value": "10"
      },
      "MetaID": "3f76dee3-3897-44ac-82d6-25ce9f53a506",
      "IsMultiInput": "False",
      "Relevance": "Optional",
      "Description": "",
      "Min": "0",
      "Max": "100000",
      "Scale": "1",
      "ScaleType": "Linear",
      "EnumValues": []
    },
    {
      "Name": "EmitPosition.X",
      "MetaInstanceID": "5cd1a563-18c5-4920-ae50-bf1fca30d4e5",
      "DefaultValue": {
        "Type": "Float",
        "Value": "0"
      },
      "MetaID": "3f76dee3-3897-44ac-82d6-25ce9f53a506",
      "IsMultiInput": "False",
      "Relevance": "Optional",
      "Description": "",
      "Min": "-10000",
      "Max": "10000",
      "Scale": "0.1",
      "ScaleType": "Linear",
      "EnumValues": []
    },
    {
      "Name": "EmitPosition.Y",
      "MetaInstanceID": "fee9730f-56b1-489a-93d1-49ce428c73d5",
      "DefaultValue": {
        "Type": "Float",
        "Value": "0"
      },
      "MetaID": "3f76dee3-3897-44ac-82d6-25ce9f53a506",
      "IsMultiInput": "False",
      "Relevance": "Optional",
      "Description": "",
      "Min": "-10000",
      "Max": "10000",
      "Scale": "0.1",
      "ScaleType": "Linear",
      "EnumValues": []
    },
    {
      "Name": "EmitPosition.Z",
      "MetaInstanceID": "24733734-fb2d-4f89-8325-9d9d20d7674e",
      "DefaultValue": {
        "Type": "Float",
        "Value": "0"
      },
      "MetaID": "3f76dee3-3897-44ac-82d6-25ce9f53a506",
      "IsMultiInput": "False",
      "Relevance": "Optional",
      "Description": "",
      "Min": "-10000",
      "Max": "10000",
      "Scale": "0.1",
      "ScaleType": "Linear",
      "EnumValues": []
    },
    {
      "Name": "ResetTrigger",
      "MetaInstanceID": "8a40ede4-bd63-4a28-9619-ff1205806e20",
      "DefaultValue": {
        "Type": "Float",
        "Value": "0"
      },
      "MetaID": "3f76dee3-3897-44ac-82d6-25ce9f53a506",
      "IsMultiInput": "False",
      "Relevance": "Optional",
      "Description": "",
      "Min": "0",
      "Max": "1",
      "Scale": "1",
      "ScaleType": "Linear",
      "EnumValues": []
    },
    {
      "Name": "EmitFrom",
      "MetaInstanceID": "fd03531d-bbcf-47d9-8eb6-fd448ea53cb5",
      "DefaultValue": {
        "Type": "Float",
        "Value": "0"
      },
      "MetaID": "3f76dee3-3897-44ac-82d6-25ce9f53a506",
      "IsMultiInput": "False",
      "Relevance": "Optional",
      "Description": "",
      "Min": "-100000",
      "Max": "100000",
      "Scale": "0.1",
      "ScaleType": "Linear",
      "EnumValues": [
        {
          "Name": "Box",
          "Value": "0"
        },
        {
          "Name": "Sphere",
          "Value": "1"
        },
        {
          "Name": "Ring",
          "Value": "2"
        }
      ]
    },
    {
      "Name": "EmitterSize.X",
      "MetaInstanceID": "ea4cef2e-b33a-49b0-82da-5ae8fe06bd5a",
      "DefaultValue": {
        "Type": "Float",
        "Value": "1"
      },
      "MetaID": "3f76dee3-3897-44ac-82d6-25ce9f53a506",
      "IsMultiInput": "False",
      "Relevance": "Optional",
      "Description": "",
      "Min": "-100000",
      "Max": "100000",
      "Scale": "0.1",
      "ScaleType": "Linear",
      "EnumValues": []
    },
    {
      "Name": "EmitterSize.Y",
      "MetaInstanceID": "bb2b4fc6-8541-411f-b666-2e78db59c5ad",
      "DefaultValue": {
        "Type": "Float",
        "Value": "1"
      },
      "MetaID": "3f76dee3-3897-44ac-82d6-25ce9f53a506",
      "IsMultiInput": "False",
      "Relevance": "Optional",
      "Description": "",
      "Min": "-100000",
      "Max": "100000",
      "Scale": "0.1",
      "ScaleType": "Linear",
      "EnumValues": []
    },
    {
      "Name": "EmitterSize.Z",
      "MetaInstanceID": "7aba8c56-6ffd-4e88-b325-292aafe0acfb",
      "DefaultValue": {
        "Type": "Float",
        "Value": "1"
      },
      "MetaID": "3f76dee3-3897-44ac-82d6-25ce9f53a506",
      "IsMultiInput": "False",
      "Relevance": "Optional",
      "Description": "",
      "Min": "-100000",
      "Max": "100000",
      "Scale": "0.1",
      "ScaleType": "Linear",
      "EnumValues": []
    },
    {
      "Name": "LimitPositions",
      "MetaInstanceID": "5bae7684-5779-4a15-861a-0387b03ec749",
      "DefaultValue": {
        "Type": "Float",
        "Value": "0"
      },
      "MetaID": "3f76dee3-3897-44ac-82d6-25ce9f53a506",
      "IsMultiInput": "False",
      "Relevance": "Optional",
      "Description": "",
      "Min": "0",
      "Max": "100000",
      "Scale": "0.1",
      "ScaleType": "Linear",
      "EnumValues": []
    },
    {
      "Name": "Scatter.X",
      "MetaInstanceID": "acdd1a42-9a92-4a77-b827-f0895a317408",
      "DefaultValue": {
        "Type": "Float",
        "Value": "0"
      },
      "MetaID": "3f76dee3-3897-44ac-82d6-25ce9f53a506",
      "IsMultiInput": "False",
      "Relevance": "Optional",
      "Description": "",
      "Min": "-100000",
      "Max": "100000",
      "Scale": "0.1",
      "ScaleType": "Linear",
      "EnumValues": []
    },
    {
      "Name": "Scatter.Y",
      "MetaInstanceID": "b19328f2-9425-4e76-8855-15f5c80bb3e5",
      "DefaultValue": {
        "Type": "Float",
        "Value": "0"
      },
      "MetaID": "3f76dee3-3897-44ac-82d6-25ce9f53a506",
      "IsMultiInput": "False",
      "Relevance": "Optional",
      "Description": "",
      "Min": "-100000",
      "Max": "100000",
      "Scale": "0.1",
      "ScaleType": "Linear",
      "EnumValues": []
    },
    {
      "Name": "Scatter.Z",
      "MetaInstanceID": "fa0f8b29-7a9f-4385-806c-c778ffff51d8",
      "DefaultValue": {
        "Type": "Float",
        "Value": "0"
      },
      "MetaID": "3f76dee3-3897-44ac-82d6-25ce9f53a506",
      "IsMultiInput": "False",
      "Relevance": "Optional",
      "Description": "",
      "Min": "-100000",
      "Max": "100000",
      "Scale": "0.1",
      "ScaleType": "Linear",
      "EnumValues": []
    },
    {
      "Name": "EmitVelocity.Value",
      "MetaInstanceID": "8d7fcf75-e50d-47a6-9a03-853f34b12766",
      "DefaultValue": {
        "Type": "Float",
        "Value": "1"
      },
      "MetaID": "3f76dee3-3897-44ac-82d6-25ce9f53a506",
      "IsMultiInput": "False",
      "Relevance": "Optional",
      "Description": "",
      "Min": "-100000",
      "Max": "100000",
      "Scale": "0.01",
      "ScaleType": "Linear",
      "EnumValues": []
    },
    {
      "Name": "EmitAngleA.Angle",
      "MetaInstanceID": "34d0049c-2ff7-4081-8176-8e079e8f51d7",
      "DefaultValue": {
        "Type": "Float",
        "Value": "0"
      },
      "MetaID": "3f76dee3-3897-44ac-82d6-25ce9f53a506",
      "IsMultiInput": "False",
      "Relevance": "Optional",
      "Description": "",
      "Min": "-100000",
      "Max": "100000",
      "Scale": "0.1",
      "ScaleType": "Linear",
      "EnumValues": []
    },
    {
      "Name": "EmitAngleA.Scatter",
      "MetaInstanceID": "553ef4ad-9b68-41d8-8f33-cf576eabf13a",
      "DefaultValue": {
        "Type": "Float",
        "Value": "0"
      },
      "MetaID": "3f76dee3-3897-44ac-82d6-25ce9f53a506",
      "IsMultiInput": "False",
      "Relevance": "Optional",
      "Description": "",
      "Min": "-100000",
      "Max": "100000",
      "Scale": "0.1",
      "ScaleType": "Linear",
      "EnumValues": []
    },
    {
      "Name": "EmitAngleB.Angle",
      "MetaInstanceID": "2118646c-858d-4d15-bb98-e6d1ff7c96cf",
      "DefaultValue": {
        "Type": "Float",
        "Value": "0"
      },
      "MetaID": "3f76dee3-3897-44ac-82d6-25ce9f53a506",
      "IsMultiInput": "False",
      "Relevance": "Optional",
      "Description": "",
      "Min": "-100000",
      "Max": "100000",
      "Scale": "0.1",
      "ScaleType": "Linear",
      "EnumValues": []
    },
    {
      "Name": "EmitAngleB.Scatter",
      "MetaInstanceID": "5504f821-5b4b-4853-855a-bf9d2959cec5",
      "DefaultValue": {
        "Type": "Float",
        "Value": "0"
      },
      "MetaID": "3f76dee3-3897-44ac-82d6-25ce9f53a506",
      "IsMultiInput": "False",
      "Relevance": "Optional",
      "Description": "",
      "Min": "-100000",
      "Max": "100000",
      "Scale": "0.1",
      "ScaleType": "Linear",
      "EnumValues": []
    },
    {
      "Name": "Size.Value",
      "MetaInstanceID": "1a889058-027f-46b4-953f-dcdfa87e392a",
      "DefaultValue": {
        "Type": "Float",
        "Value": "1"
      },
      "MetaID": "3f76dee3-3897-44ac-82d6-25ce9f53a506",
      "IsMultiInput": "False",
      "Relevance": "Optional",
      "Description": "",
      "Min": "0",
      "Max": "100000",
      "Scale": "0.1",
      "ScaleType": "Linear",
      "EnumValues": []
    },
    {
      "Name": "Size.Variation",
      "MetaInstanceID": "a5215f8e-3c59-4d65-8131-4a4a86863128",
      "DefaultValue": {
        "Type": "Float",
        "Value": "0"
      },
      "MetaID": "3f76dee3-3897-44ac-82d6-25ce9f53a506",
      "IsMultiInput": "False",
      "Relevance": "Optional",
      "Description": "",
      "Min": "0",
      "Max": "100000",
      "Scale": "0.1",
      "ScaleType": "Linear",
      "EnumValues": []
    },
    {
      "Name": "Stretch.X",
      "MetaInstanceID": "5f1ff9a9-2754-44a7-9839-1063cf72c320",
      "DefaultValue": {
        "Type": "Float",
        "Value": "1"
      },
      "MetaID": "3f76dee3-3897-44ac-82d6-25ce9f53a506",
      "IsMultiInput": "False",
      "Relevance": "Optional",
      "Description": "",
      "Min": "-100000",
      "Max": "100000",
      "Scale": "0.01",
      "ScaleType": "Linear",
      "EnumValues": []
    },
    {
      "Name": "Stretch.Y",
      "MetaInstanceID": "ebef9570-7324-41a1-9809-5a3ca658adba",
      "DefaultValue": {
        "Type": "Float",
        "Value": "1"
      },
      "MetaID": "3f76dee3-3897-44ac-82d6-25ce9f53a506",
      "IsMultiInput": "False",
      "Relevance": "Optional",
      "Description": "",
      "Min": "-100000",
      "Max": "100000",
      "Scale": "0.01",
      "ScaleType": "Linear",
      "EnumValues": []
    },
    {
      "Name": "Stretch.Z",
      "MetaInstanceID": "a67a16c4-a84b-4ae6-8603-3302b93df240",
      "DefaultValue": {
        "Type": "Float",
        "Value": "1"
      },
      "MetaID": "3f76dee3-3897-44ac-82d6-25ce9f53a506",
      "IsMultiInput": "False",
      "Relevance": "Optional",
      "Description": "",
      "Min": "-100000",
      "Max": "100000",
      "Scale": "0.01",
      "ScaleType": "Linear",
      "EnumValues": []
    },
    {
      "Name": "StretchByMotion",
      "MetaInstanceID": "f4f9da06-4f8c-4be9-8c3e-fe625295dbc4",
      "DefaultValue": {
        "Type": "Float",
        "Value": "0"
      },
      "MetaID": "3f76dee3-3897-44ac-82d6-25ce9f53a506",
      "IsMultiInput": "False",
      "Relevance": "Optional",
      "Description": "",
      "Min": "-100000",
      "Max": "100000",
      "Scale": "0.1",
      "ScaleType": "Linear",
      "EnumValues": []
    },
    {
      "Name": "ShrinkOverTime.AtBeginning",
      "MetaInstanceID": "0f552f7a-9d15-4e77-ba93-ba97956f5638",
      "DefaultValue": {
        "Type": "Float",
        "Value": "0.1"
      },
      "MetaID": "3f76dee3-3897-44ac-82d6-25ce9f53a506",
      "IsMultiInput": "False",
      "Relevance": "Optional",
      "Description": "",
      "Min": "0",
      "Max": "1",
      "Scale": "0.01",
      "ScaleType": "Linear",
      "EnumValues": []
    },
    {
      "Name": "ShrinkOverTime.AtEnd",
      "MetaInstanceID": "f446ff08-7ee0-4831-bd4b-40409b844c97",
      "DefaultValue": {
        "Type": "Float",
        "Value": "0.9"
      },
      "MetaID": "3f76dee3-3897-44ac-82d6-25ce9f53a506",
      "IsMultiInput": "False",
      "Relevance": "Optional",
      "Description": "",
      "Min": "0",
      "Max": "1",
      "Scale": "0.01",
      "ScaleType": "Linear",
      "EnumValues": []
    },
    {
      "Name": "Orientation",
      "MetaInstanceID": "05ad8272-4442-4289-9001-428135effe00",
      "DefaultValue": {
        "Type": "Float",
        "Value": "0"
      },
      "MetaID": "3f76dee3-3897-44ac-82d6-25ce9f53a506",
      "IsMultiInput": "False",
      "Relevance": "Optional",
      "Description": "",
      "Min": "-100000",
      "Max": "100000",
      "Scale": "0.1",
      "ScaleType": "Linear",
      "EnumValues": [
        {
          "Name": "Billboard",
          "Value": "0"
        },
        {
          "Name": "Random",
          "Value": "1"
        },
        {
          "Name": "Motion",
          "Value": "2"
        },
        {
          "Name": "EmitDirection",
          "Value": "3"
        }
      ]
    },
    {
      "Name": "VelocityFriction",
      "MetaInstanceID": "951e0160-452a-4e3f-9f17-c30224ab11ad",
      "DefaultValue": {
        "Type": "Float",
        "Value": "0"
      },
      "MetaID": "3f76dee3-3897-44ac-82d6-25ce9f53a506",
      "IsMultiInput": "False",
      "Relevance": "Optional",
      "Description": "",
      "Min": "-100000",
      "Max": "100000",
      "Scale": "0.01",
      "ScaleType": "Linear",
      "EnumValues": []
    },
    {
      "Name": "Gravity.X",
      "MetaInstanceID": "c41771bf-f048-4853-8779-fd9c91590814",
      "DefaultValue": {
        "Type": "Float",
        "Value": "0"
      },
      "MetaID": "3f76dee3-3897-44ac-82d6-25ce9f53a506",
      "IsMultiInput": "False",
      "Relevance": "Optional",
      "Description": "",
      "Min": "-100000",
      "Max": "100000",
      "Scale": "0.01",
      "ScaleType": "Linear",
      "EnumValues": []
    },
    {
      "Name": "Gravity.Y",
      "MetaInstanceID": "cb07f19e-096c-4616-ae29-9c19cfce6c7f",
      "DefaultValue": {
        "Type": "Float",
        "Value": "0"
      },
      "MetaID": "3f76dee3-3897-44ac-82d6-25ce9f53a506",
      "IsMultiInput": "False",
      "Relevance": "Optional",
      "Description": "",
      "Min": "-100000",
      "Max": "100000",
      "Scale": "0.01",
      "ScaleType": "Linear",
      "EnumValues": []
    },
    {
      "Name": "Gravity.Z",
      "MetaInstanceID": "76293e2f-7019-45fd-af30-c8eaf0010607",
      "DefaultValue": {
        "Type": "Float",
        "Value": "0"
      },
      "MetaID": "3f76dee3-3897-44ac-82d6-25ce9f53a506",
      "IsMultiInput": "False",
      "Relevance": "Optional",
      "Description": "",
      "Min": "-100000",
      "Max": "100000",
      "Scale": "0.01",
      "ScaleType": "Linear",
      "EnumValues": []
    },
    {
      "Name": "Turbulence.Amount",
      "MetaInstanceID": "b0df09fe-5402-4188-9cf9-21d0d9c9036c",
      "DefaultValue": {
        "Type": "Float",
        "Value": "0"
      },
      "MetaID": "3f76dee3-3897-44ac-82d6-25ce9f53a506",
      "IsMultiInput": "False",
      "Relevance": "Optional",
      "Description": "",
      "Min": "0",
      "Max": "100000",
      "Scale": "0.1",
      "ScaleType": "Linear",
      "EnumValues": []
    },
    {
      "Name": "Turbulence.Time",
      "MetaInstanceID": "0c1a5695-d6a3-4dd0-950e-59173e845949",
      "DefaultValue": {
        "Type": "Float",
        "Value": "0"
      },
      "MetaID": "3f76dee3-3897-44ac-82d6-25ce9f53a506",
      "IsMultiInput": "False",
      "Relevance": "Optional",
      "Description": "",
      "Min": "-100000",
      "Max": "100000",
      "Scale": "0.1",
      "ScaleType": "Linear",
      "EnumValues": []
    },
    {
      "Name": "Turbulence.Scale",
      "MetaInstanceID": "47a93874-73ed-42b9-982b-97b36ff2f8b7",
      "DefaultValue": {
        "Type": "Float",
        "Value": "20"
      },
      "MetaID": "3f76dee3-3897-44ac-82d6-25ce9f53a506",
      "IsMultiInput": "False",
      "Relevance": "Optional",
      "Description": "",
      "Min": "-100000",
      "Max": "100000",
      "Scale": "0.1",
      "ScaleType": "Linear",
      "EnumValues": []
    },
    {
      "Name": "TextureCells.Columns",
      "MetaInstanceID": "2b8762b3-bd82-4977-a578-9359f732ed39",
      "DefaultValue": {
        "Type": "Float",
        "Value": "1"
      },
      "MetaID": "3f76dee3-3897-44ac-82d6-25ce9f53a506",
      "IsMultiInput": "False",
      "Relevance": "Optional",
      "Description": "",
      "Min": "1",
      "Max": "100000",
      "Scale": "0.1",
      "ScaleType": "Linear",
      "EnumValues": []
    },
    {
      "Name": "TextureCells.Rows",
      "MetaInstanceID": "83cc6209-f9ec-4aa2-86ef-4708b0c5e307",
      "DefaultValue": {
        "Type": "Float",
        "Value": "1"
      },
      "MetaID": "3f76dee3-3897-44ac-82d6-25ce9f53a506",
      "IsMultiInput": "False",
      "Relevance": "Optional",
      "Description": "",
      "Min": "1",
      "Max": "100000",
      "Scale": "0.1",
      "ScaleType": "Linear",
      "EnumValues": []
    },
    {
      "Name": "ColorStart.R",
      "MetaInstanceID": "456089f9-81b1-4cef-85eb-841853ad3c15",
      "DefaultValue": {
        "Type": "Float",
        "Value": "1"
      },
      "MetaID": "3f76dee3-3897-44ac-82d6-25ce9f53a506",
      "IsMultiInput": "False",
      "Relevance": "Optional",
      "Description": "",
      "Min": "0",
      "Max": "1",
      "Scale": "0.01",
      "ScaleType": "Linear",
      "EnumValues": []
    },
    {
      "Name": "ColorStart.G",
      "MetaInstanceID": "541b9305-b714-4c2b-91dd-229d77dc5f6f",
      "DefaultValue": {
        "Type": "Float",
        "Value": "0.997"
      },
      "MetaID": "3f76dee3-3897-44ac-82d6-25ce9f53a506",
      "IsMultiInput": "False",
      "Relevance": "Optional",
      "Description": "",
      "Min": "0",
      "Max": "1",
      "Scale": "0.01",
      "ScaleType": "Linear",
      "EnumValues": []
    },
    {
      "Name": "ColorStart.B",
      "MetaInstanceID": "81dd75a7-18df-4ff2-8ab1-1efa935e66d3",
      "DefaultValue": {
        "Type": "Float",
        "Value": "1"
      },
      "MetaID": "3f76dee3-3897-44ac-82d6-25ce9f53a506",
      "IsMultiInput": "False",
      "Relevance": "Optional",
      "Description": "",
      "Min": "0",
      "Max": "1",
      "Scale": "0.01",
      "ScaleType": "Linear",
      "EnumValues": []
    },
    {
      "Name": "ColorStart.A",
      "MetaInstanceID": "e432db99-d748-4a4c-b191-f231a9e02321",
      "DefaultValue": {
        "Type": "Float",
        "Value": "1"
      },
      "MetaID": "3f76dee3-3897-44ac-82d6-25ce9f53a506",
      "IsMultiInput": "False",
      "Relevance": "Optional",
      "Description": "",
      "Min": "0",
      "Max": "1",
      "Scale": "0.01",
      "ScaleType": "Linear",
      "EnumValues": []
    },
    {
      "Name": "ColorVariation.Hue",
      "MetaInstanceID": "03b906df-b228-4902-9e43-9ff20d5ab96e",
      "DefaultValue": {
        "Type": "Float",
        "Value": "0"
      },
      "MetaID": "3f76dee3-3897-44ac-82d6-25ce9f53a506",
      "IsMultiInput": "False",
      "Relevance": "Optional",
      "Description": "",
      "Min": "0",
      "Max": "1",
      "Scale": "0.01",
      "ScaleType": "Linear",
      "EnumValues": []
    },
    {
      "Name": "ColorVariation.Saturation",
      "MetaInstanceID": "90bc34f9-61bd-4731-acc6-6e1bb191afb2",
      "DefaultValue": {
        "Type": "Float",
        "Value": "0"
      },
      "MetaID": "3f76dee3-3897-44ac-82d6-25ce9f53a506",
      "IsMultiInput": "False",
      "Relevance": "Optional",
      "Description": "",
      "Min": "0",
      "Max": "1",
      "Scale": "0.01",
      "ScaleType": "Linear",
      "EnumValues": []
    },
    {
      "Name": "ColorVariation.Brightness",
      "MetaInstanceID": "b6f0916f-1bb5-41ee-9063-ecf566f53460",
      "DefaultValue": {
        "Type": "Float",
        "Value": "0"
      },
      "MetaID": "3f76dee3-3897-44ac-82d6-25ce9f53a506",
      "IsMultiInput": "False",
      "Relevance": "Optional",
      "Description": "",
      "Min": "0",
      "Max": "1",
      "Scale": "0.01",
      "ScaleType": "Linear",
      "EnumValues": []
    },
    {
      "Name": "ColorVariation.Alpha",
      "MetaInstanceID": "d2b276db-eb2c-41a9-97f9-5ed5c4c0f872",
      "DefaultValue": {
        "Type": "Float",
        "Value": "0"
      },
      "MetaID": "3f76dee3-3897-44ac-82d6-25ce9f53a506",
      "IsMultiInput": "False",
      "Relevance": "Optional",
      "Description": "",
      "Min": "0",
      "Max": "1",
      "Scale": "0.01",
      "ScaleType": "Linear",
      "EnumValues": []
    },
    {
      "Name": "ColorEnd.R",
      "MetaInstanceID": "7d151ed9-9f94-4031-917d-70404f475eff",
      "DefaultValue": {
        "Type": "Float",
        "Value": "1"
      },
      "MetaID": "3f76dee3-3897-44ac-82d6-25ce9f53a506",
      "IsMultiInput": "False",
      "Relevance": "Optional",
      "Description": "",
      "Min": "0",
      "Max": "1",
      "Scale": "0.01",
      "ScaleType": "Linear",
      "EnumValues": []
    },
    {
      "Name": "ColorEnd.G",
      "MetaInstanceID": "cf4ff932-a9a7-4af7-a673-41430305d297",
      "DefaultValue": {
        "Type": "Float",
        "Value": "1"
      },
      "MetaID": "3f76dee3-3897-44ac-82d6-25ce9f53a506",
      "IsMultiInput": "False",
      "Relevance": "Optional",
      "Description": "",
      "Min": "0",
      "Max": "1",
      "Scale": "0.01",
      "ScaleType": "Linear",
      "EnumValues": []
    },
    {
      "Name": "ColorEnd.B",
      "MetaInstanceID": "5f2cf399-8db0-48a6-8128-92a6cab61eac",
      "DefaultValue": {
        "Type": "Float",
        "Value": "1"
      },
      "MetaID": "3f76dee3-3897-44ac-82d6-25ce9f53a506",
      "IsMultiInput": "False",
      "Relevance": "Optional",
      "Description": "",
      "Min": "0",
      "Max": "1",
      "Scale": "0.01",
      "ScaleType": "Linear",
      "EnumValues": []
    },
    {
      "Name": "ColorEnd.A",
      "MetaInstanceID": "b17dc87e-c849-4cdc-b84a-8361175db96c",
      "DefaultValue": {
        "Type": "Float",
        "Value": "1"
      },
      "MetaID": "3f76dee3-3897-44ac-82d6-25ce9f53a506",
      "IsMultiInput": "False",
      "Relevance": "Optional",
      "Description": "",
      "Min": "0",
      "Max": "1",
      "Scale": "0.01",
      "ScaleType": "Linear",
      "EnumValues": []
    },
    {
      "Name": "FadeWithAge.AtBeginning",
      "MetaInstanceID": "20248110-0e47-4334-8e00-077c8d4294f2",
      "DefaultValue": {
        "Type": "Float",
        "Value": "0"
      },
      "MetaID": "3f76dee3-3897-44ac-82d6-25ce9f53a506",
      "IsMultiInput": "False",
      "Relevance": "Optional",
      "Description": "",
      "Min": "0",
      "Max": "10",
      "Scale": "0.01",
      "ScaleType": "Linear",
      "EnumValues": []
    },
    {
      "Name": "FadeWithAge.AtEnd",
      "MetaInstanceID": "c690bc57-15d9-4c58-b7d9-863f89389391",
      "DefaultValue": {
        "Type": "Float",
        "Value": "0"
      },
      "MetaID": "3f76dee3-3897-44ac-82d6-25ce9f53a506",
      "IsMultiInput": "False",
      "Relevance": "Optional",
      "Description": "",
      "Min": "0",
      "Max": "10000",
      "Scale": "0.01",
      "ScaleType": "Linear",
      "EnumValues": []
    },
    {
      "Name": "Focus.Distance",
      "MetaInstanceID": "dc12486c-89c5-4b22-9eb1-24237828b607",
      "DefaultValue": {
        "Type": "Float",
        "Value": "0"
      },
      "MetaID": "3f76dee3-3897-44ac-82d6-25ce9f53a506",
      "IsMultiInput": "False",
      "Relevance": "Optional",
      "Description": "",
      "Min": "0",
      "Max": "10000",
      "Scale": "0.1",
      "ScaleType": "Linear",
      "EnumValues": []
    },
    {
      "Name": "Focus.Range",
      "MetaInstanceID": "7f852638-d6cb-4a33-b616-32a2505daee0",
      "DefaultValue": {
        "Type": "Float",
        "Value": "0"
      },
      "MetaID": "3f76dee3-3897-44ac-82d6-25ce9f53a506",
      "IsMultiInput": "False",
      "Relevance": "Optional",
      "Description": "",
      "Min": "-10000",
      "Max": "10000",
      "Scale": "0.1",
      "ScaleType": "Linear",
      "EnumValues": []
    },
    {
      "Name": "FadeTooClose.Distance",
      "MetaInstanceID": "0a4ac162-eaa4-4aa0-9bd4-a9583a86bb59",
      "DefaultValue": {
        "Type": "Float",
        "Value": "0"
      },
      "MetaID": "3f76dee3-3897-44ac-82d6-25ce9f53a506",
      "IsMultiInput": "False",
      "Relevance": "Optional",
      "Description": "",
      "Min": "-10000",
      "Max": "10000",
      "Scale": "0.1",
      "ScaleType": "Linear",
      "EnumValues": []
    },
    {
      "Name": "FadeTooClose.Range",
      "MetaInstanceID": "6ce39408-8537-4463-8120-55228e0e0f26",
      "DefaultValue": {
        "Type": "Float",
        "Value": "0"
      },
      "MetaID": "3f76dee3-3897-44ac-82d6-25ce9f53a506",
      "IsMultiInput": "False",
      "Relevance": "Optional",
      "Description": "",
      "Min": "-10000",
      "Max": "10000",
      "Scale": "0.1",
      "ScaleType": "Linear",
      "EnumValues": []
    },
    {
      "Name": "ParametersAffect",
      "MetaInstanceID": "9505b3a7-cb1c-43f1-8f84-a731beeab29b",
      "DefaultValue": {
        "Type": "Float",
        "Value": "0"
      },
      "MetaID": "3f76dee3-3897-44ac-82d6-25ce9f53a506",
      "IsMultiInput": "False",
      "Relevance": "Optional",
      "Description": "",
      "Min": "-10000",
      "Max": "10000",
      "Scale": "0.1",
      "ScaleType": "Linear",
      "EnumValues": [
        {
          "Name": "AllParticles",
          "Value": "0"
        },
        {
          "Name": "Emitted",
          "Value": "1"
        }
      ]
    },
    {
      "Name": "NoiseTextureRGB",
      "MetaInstanceID": "fee088c0-d531-47ad-b0af-4d48a1ade328",
      "DefaultValue": {
        "Type": "Image",
        "Value": "Framefield.Core.Image"
      },
      "MetaID": "9848060d-fd84-45b0-b658-d0d531c61dab",
      "IsMultiInput": "False",
      "Relevance": "Required",
      "Description": "",
      "Min": "-100000",
      "Max": "100000",
      "Scale": "0.1",
      "ScaleType": "Linear",
      "EnumValues": []
    },
    {
      "Name": "Trails.Length",
      "MetaInstanceID": "4f6514d7-bd3a-48fe-8976-70f71a718e25",
      "DefaultValue": {
        "Type": "Float",
        "Value": "0"
      },
      "MetaID": "3f76dee3-3897-44ac-82d6-25ce9f53a506",
      "IsMultiInput": "False",
      "Relevance": "Optional",
      "Description": "",
      "Min": "0",
      "Max": "1000",
      "Scale": "0.1",
      "ScaleType": "Linear",
      "EnumValues": []
    },
    {
      "Name": "Trails.Spread",
      "MetaInstanceID": "c765937b-796f-4e66-86eb-fef5d8898a30",
      "DefaultValue": {
        "Type": "Float",
        "Value": "0.01"
      },
      "MetaID": "3f76dee3-3897-44ac-82d6-25ce9f53a506",
      "IsMultiInput": "False",
      "Relevance": "Optional",
      "Description": "",
      "Min": "-10000",
      "Max": "10000",
      "Scale": "0.001",
      "ScaleType": "Linear",
      "EnumValues": []
    },
    {
      "Name": "EmitVelocity.Random",
      "MetaInstanceID": "c507d670-f5d2-4276-9052-85e840484c07",
      "DefaultValue": {
        "Type": "Float",
        "Value": "0"
      },
      "MetaID": "3f76dee3-3897-44ac-82d6-25ce9f53a506",
      "IsMultiInput": "False",
      "Relevance": "Optional",
      "Description": "",
      "Min": "-100000",
      "Max": "100000",
      "Scale": "0.1",
      "ScaleType": "Linear",
      "EnumValues": []
    },
    {
      "Name": "Turbulence.Variation",
      "MetaInstanceID": "7ce2c754-5c7b-4903-b82a-bdf87d503c9f",
      "DefaultValue": {
        "Type": "Float",
        "Value": "0"
      },
      "MetaID": "3f76dee3-3897-44ac-82d6-25ce9f53a506",
      "IsMultiInput": "False",
      "Relevance": "Optional",
      "Description": "",
      "Min": "0",
      "Max": "100000",
      "Scale": "0.01",
      "ScaleType": "Linear",
      "EnumValues": []
    },
    {
      "Name": "FadeTooFar.Distance",
      "MetaInstanceID": "a5318180-2dd0-46f2-8725-9571a38c0190",
      "DefaultValue": {
        "Type": "Float",
        "Value": "0"
      },
      "MetaID": "3f76dee3-3897-44ac-82d6-25ce9f53a506",
      "IsMultiInput": "False",
      "Relevance": "Optional",
      "Description": "",
      "Min": "-10000",
      "Max": "10000",
      "Scale": "0.1",
      "ScaleType": "Linear",
      "EnumValues": []
    },
    {
      "Name": "FadeTooFar.Range",
      "MetaInstanceID": "c6d7a462-2ffc-4cb2-9298-ae6dff355c2b",
      "DefaultValue": {
        "Type": "Float",
        "Value": "0"
      },
      "MetaID": "3f76dee3-3897-44ac-82d6-25ce9f53a506",
      "IsMultiInput": "False",
      "Relevance": "Optional",
      "Description": "",
      "Min": "-10000",
      "Max": "10000",
      "Scale": "0.1",
      "ScaleType": "Linear",
      "EnumValues": []
    },
    {
      "Name": "TurbulenceFadeIn",
      "MetaInstanceID": "d4381166-758a-488f-aedd-6b4bc26e441e",
      "DefaultValue": {
        "Type": "Float",
        "Value": "0"
      },
      "MetaID": "3f76dee3-3897-44ac-82d6-25ce9f53a506",
      "IsMultiInput": "False",
      "Relevance": "Optional",
      "Description": "",
      "Min": "0",
      "Max": "10000",
      "Scale": "0.01",
      "ScaleType": "Linear",
      "EnumValues": []
    }
  ],
  "Outputs": [
    {
      "Name": "Scene",
      "MetaInstanceID": "db950649-fe60-4670-8f73-fb0e2d4ffddb",
      "MetaID": "79122951-7bc4-4c68-b085-866eab828248"
    }
  ],
  "OperatorParts": [
    {
      "MetaInstanceID": "fd7038bc-0fc8-4d49-86d5-125f15da7f52",
      "MetaID": "7c8523f5-5b67-4bca-a335-ba2476c40c17",
      "Name": "_renderFasterParticlesFunc",
      "Version": "cbb5c00e-27bb-4c79-9f50-7b21318e95cc",
      "Type": "Float",
      "IsMultiInput": "True",
      "Script": [
        "//>>> _using",
        "using System;",
        "using System.Collections.Generic;",
        "using System.Linq;",
        "using System.Text;",
        "using SharpDX;",
        "using SharpDX.Direct3D11;",
        "using SharpDX.Windows;",
        "//<<< _using",
        "",
        "using System.Runtime.InteropServices;",
        "using Framefield.Core;",
        "using Framefield.Core.Rendering;",
        "using SharpDX.DXGI;",
        "using SharpDX.Direct3D;",
        "using SharpDX.D3DCompiler;",
        "using System.CodeDom.Compiler;",
        "using Buffer = SharpDX.Direct3D11.Buffer;",
        "",
        "namespace Framefield.Core.ID7c8523f5_5b67_4bca_a335_ba2476c40c17",
        "{",
        "    public class Class__renderFasterParticles : FXSourceCodeFunction, IFXSceneSourceCode",
        "    {",
        "        //structured buffer element type. size must be multiple of 4",
        "        [StructLayout(LayoutKind.Explicit, Size = 16*4)]",
        "        public struct ParticleStateLayout",
        "        {",
        "            public ParticleStateLayout(Vector3 emitPosition, Vector3 emitVelocity, float emitTime)",
        "            {",
        "                EmitPosition = emitPosition; ",
        "                TrailIndex = 1;",
        "                EmitVelocity = emitVelocity;",
        "                EmitTime = emitTime;",
        "                EmitIndex= 1;             ",
        "                __fillUp1= new Vector3();                ",
        "                __fillUp2= new Vector4();",
        "            }",
        "            [FieldOffset(    0)]    Vector3 EmitPosition;",
        "            [FieldOffset( 3 *3)]    float TrailIndex;",
        "            [FieldOffset( 4 *4)]    Vector3 EmitVelocity;",
        "            [FieldOffset( 7 *4)]    float EmitTime;",
        "            [FieldOffset( 8 *4)]    float EmitIndex;",
        "            [FieldOffset( 9 *4)]    Vector3 __fillUp1;",
        "            [FieldOffset( 12 *4)]   Vector4 __fillUp2;",
        "        }",
        "",
        "        //constant buffer element type. size must be multiple of 16",
        "        [StructLayout(LayoutKind.Explicit, Size = 32*4)]",
        "        public struct ParticleInitParametersBufferLayout",
        "        {",
        "            public ParticleInitParametersBufferLayout(int particlesStartIndex, ",
        "                                                    int emitCount, ",
        "                                                    float time, ",
        "                                                      Vector3 emitPosition, ",
        "                                                      Vector3 previousEmitPosition, ",
        "                                                      int particleCount, ",
        "                                                      Vector3 emitterSize, ",
        "                                                      float limitPositions, ",
        "                                                      Vector3 scatter, ",
        "                                                      Vector2 emitVelocity, ",
        "                                                      Vector2 emitAngleA, ",
        "                                                      float previousEmitAngleA,",
        "                                                      Vector2 emitAngleB, ",
        "                                                      float previousEmitAngleB,",
        "                                                      float emitStartTime, ",
        "                                                      float emitPeriod,",
        "                                                      int trailsLength,",
        "                                                      int emitterShape)",
        "            {",
        "                StartIndex = particlesStartIndex;",
        "                EmitCount = emitCount;",
        "                Time = time;",
        "                EmitPosition = emitPosition;",
        "                PreviousEmitPosition = previousEmitPosition;",
        "                ParticleCount = particleCount;",
        "                EmitterSize = emitterSize;",
        "                LimitPositions = limitPositions;",
        "                Scatter = scatter;",
        "                EmitVelocity = emitVelocity;",
        "                EmitAngleA = emitAngleA;",
        "                PreviousEmitAngleA = previousEmitAngleA;",
        "                EmitAngleB = emitAngleB;",
        "                PreviousEmitAngleB = previousEmitAngleB;",
        "                EmitStartTime = emitStartTime;",
        "                EmitPeriod = emitPeriod;",
        "                TrailsLength = trailsLength;",
        "                EmitterShape = emitterShape;",
        "                ",
        "                BoxSubDivision = limitPositions>0.5? ComputeSubdivisionOfBox( emitterSize, (int)limitPositions)",
        "                                                    : Vector3.Zero;",
        "                //__dummy1=0;",
        "            }",
        "            ",
        "            [FieldOffset( 0 *4)]     int StartIndex;            ",
        "            [FieldOffset( 1 *4)]     int EmitCount;            ",
        "            [FieldOffset( 2 *4)]     float Time;",
        "            [FieldOffset( 3 *4)]     int ParticleCount;",
        "            ",
        "            [FieldOffset( 4 *4)]     Vector3 EmitPosition;",
        "            [FieldOffset( 7 *4)]     float LimitPositions;                        ",
        "",
        "            [FieldOffset( 8 *4)]     Vector3 PreviousEmitPosition;",
        "            [FieldOffset(11 *4)]     float EmitStartTime;",
        "",
        "            [FieldOffset(12 *4)]     Vector3 EmitterSize;",
        "            [FieldOffset(15 *4)]     float EmitPeriod;",
        "            ",
        "            [FieldOffset(16 *4)]     Vector2 EmitVelocity;            ",
        "            [FieldOffset(18 *4)]     int TrailsLength;",
        "            [FieldOffset(19 *4)]     int EmitterShape;",
        "                        ",
        "            [FieldOffset(20 *4)]     Vector2 EmitAngleA;",
        "            [FieldOffset(22 *4)]     Vector2 EmitAngleB; ",
        "",
        "            [FieldOffset(24 *4)]     Vector3 BoxSubDivision;",
        "            [FieldOffset(27 *4)]     float PreviousEmitAngleA;            ",
        "",
        "            [FieldOffset(28 *4)]     Vector3 Scatter;",
        "            [FieldOffset(31 *4)]     float PreviousEmitAngleB;",
        "",
        "            //[FieldOffset(32 *4)]     float __dummy1;",
        "            ",
        "            ",
        "",
        "            ",
        "        }",
        "        private Buffer _particleInitParametersBuffer;",
        "",
        "        //constant buffer element type. size must be multiple of 16",
        "        [StructLayout(LayoutKind.Explicit, Size = 208)] // was 208",
        "        public struct ParticleUpdateParametersBufferLayout",
        "        {",
        "            public ParticleUpdateParametersBufferLayout(float deltaTime)",
        "            {",
        "                DeltaTime = deltaTime;",
        "            }",
        "            [FieldOffset(0)]",
        "            float DeltaTime;",
        "        }",
        "        private Buffer _particleUpdateParametersBuffer;",
        "",
        "        //>>> _inputids",
        "        private enum InputId",
        "        {",
        "            InitCode = 0,",
        "            RenderCode = 1,",
        "            Texture = 2,",
        "            ParticleCount = 3,",
        "            LifeTime = 4,",
        "            EmitRate = 5,",
        "            EmitPositionX = 6,",
        "            EmitPositionY = 7,",
        "            EmitPositionZ = 8,",
        "            ResetTrigger = 9,",
        "            EmitterSizeX = 10,",
        "            EmitterSizeY = 11,",
        "            EmitterSizeZ = 12,",
        "            LimitPositions = 13,",
        "            ScatterX = 14,",
        "            ScatterY = 15,",
        "            ScatterZ = 16,",
        "            EmitVelocityValue = 17,",
        "            EmitAngleAAngle = 18,",
        "            EmitAngleAScatter = 19,",
        "            EmitAngleBAngle = 20,",
        "            EmitAngleBScatter = 21,",
        "            EmitFrom = 22,",
        "            SizeValue = 23,",
        "            SizeVariation = 24,",
        "            StretchX = 25,",
        "            StretchY = 26,",
        "            StretchZ = 27,",
        "            StretchByMotion = 28,",
        "            ShrinkOverTimeAtBeginning = 29,",
        "            ShrinkOverTimeAtEnd = 30,",
        "            Orientation = 31,",
        "            VelocityFriction = 32,",
        "            GravityX = 33,",
        "            GravityY = 34,",
        "            GravityZ = 35,",
        "            TurbulenceAmount = 36,",
        "            TurbulenceTime = 37,",
        "            TurbulenceScale = 38,",
        "            TextureCellsColumns = 39,",
        "            TextureCellsRows = 40,",
        "            ColorStartR = 41,",
        "            ColorStartG = 42,",
        "            ColorStartB = 43,",
        "            ColorStartA = 44,",
        "            ColorVariationHue = 45,",
        "            ColorVariationSaturation = 46,",
        "            ColorVariationBrightness = 47,",
        "            ColorVariationAlpha = 48,",
        "            ColorEndR = 49,",
        "            ColorEndG = 50,",
        "            ColorEndB = 51,",
        "            ColorEndA = 52,",
        "            FadeWithAgeAtBeginning = 53,",
        "            FadeWithAgeAtEnd = 54,",
        "            FocusDistance = 55,",
        "            FocusRange = 56,",
        "            FadeTooCloseDistance = 57,",
        "            FadeTooCloseRange = 58,",
        "            ParametersAffect = 59,",
        "            NoiseTextureRGB = 60,",
        "            TrailsLength = 61,",
        "            TrailsSpread = 62,",
        "            EmitVelocityRandom = 63,",
        "            TurbulenceVariation = 64,",
        "            FadeTooFarDistance = 65,",
        "            FadeTooFarRange = 66,",
        "            TurbulenceFadeIn = 67",
        "        }",
        "        //<<< _inputids",
        "",
        "        public override void Dispose()",
        "        {",
        "            Utilities.DisposeObj(ref _csInitParticles);",
        "            Utilities.DisposeObj(ref _csUpdateParticles);",
        "            Utilities.DisposeObj(ref _fxRenderParticles);",
        "            Utilities.DisposeObj(ref _particleStateBuffer);",
        "            Utilities.DisposeObj(ref _particleStateUAV);",
        "            Utilities.DisposeObj(ref _particleStateSRV);",
        "            base.Dispose();",
        "        }",
        "",
        "        bool _firstEval = true;",
        "        private SamplerState _linearSamplerState;",
        "        public override OperatorPartContext Eval(OperatorPartContext context, List<OperatorPart> inputs, int outputIdx)",
        "        {",
        "            if (_firstEval)",
        "            {",
        "                for (int i = 0; i < NumCodes(); ++i)",
        "                    Compile(i);",
        "                _firstEval = false;",
        "                Changed = true;",
        "                    ",
        "                // create sampler state",
        "                var samplerDesc = new SamplerStateDescription()",
        "                                      {",
        "                                          Filter = Filter.MinMagMipLinear,",
        "                                          AddressU = TextureAddressMode.Wrap,",
        "                                          AddressV = TextureAddressMode.Wrap,",
        "                                          AddressW = TextureAddressMode.Wrap,",
        "                                          //BorderColor = new Color4(0, 0, 0, 0),",
        "                                          MipLodBias = 0,",
        "                                          ComparisonFunction = Comparison.Never,",
        "                                          MaximumAnisotropy = 16,",
        "                                          MinimumLod = 0,",
        "                                          MaximumLod = Single.MaxValue",
        "                                      };",
        "                Utilities.DisposeObj(ref _linearSamplerState);",
        "                _linearSamplerState = new SamplerState(context.D3DDevice, samplerDesc);                ",
        "",
        "            }",
        "",
        "            //>>> _params",
        "            var InitCode = inputs[(int)InputId.InitCode].Eval(context).Text;",
        "            var RenderCode = inputs[(int)InputId.RenderCode].Eval(context).Text;",
        "            var Texture = inputs[(int)InputId.Texture].Eval(context).Image; // Needs to be checked for null!",
        "            var ParticleCount = inputs[(int)InputId.ParticleCount].Eval(context).Value;",
        "            var LifeTime = inputs[(int)InputId.LifeTime].Eval(context).Value;",
        "            var EmitRate = inputs[(int)InputId.EmitRate].Eval(context).Value;",
        "            var EmitPositionX = inputs[(int)InputId.EmitPositionX].Eval(context).Value;",
        "            var EmitPositionY = inputs[(int)InputId.EmitPositionY].Eval(context).Value;",
        "            var EmitPositionZ = inputs[(int)InputId.EmitPositionZ].Eval(context).Value;",
        "            var EmitPosition = new Vector3(EmitPositionX, EmitPositionY, EmitPositionZ);",
        "            var ResetTrigger = inputs[(int)InputId.ResetTrigger].Eval(context).Value;",
        "            var EmitterSizeX = inputs[(int)InputId.EmitterSizeX].Eval(context).Value;",
        "            var EmitterSizeY = inputs[(int)InputId.EmitterSizeY].Eval(context).Value;",
        "            var EmitterSizeZ = inputs[(int)InputId.EmitterSizeZ].Eval(context).Value;",
        "            var EmitterSize = new Vector3(EmitterSizeX, EmitterSizeY, EmitterSizeZ);",
        "            var LimitPositions = inputs[(int)InputId.LimitPositions].Eval(context).Value;",
        "            var ScatterX = inputs[(int)InputId.ScatterX].Eval(context).Value;",
        "            var ScatterY = inputs[(int)InputId.ScatterY].Eval(context).Value;",
        "            var ScatterZ = inputs[(int)InputId.ScatterZ].Eval(context).Value;",
        "            var Scatter = new Vector3(ScatterX, ScatterY, ScatterZ);",
        "            var EmitVelocityValue = inputs[(int)InputId.EmitVelocityValue].Eval(context).Value;",
        "            var EmitVelocityRandom = inputs[(int)InputId.EmitVelocityRandom].Eval(context).Value;",
        "            var EmitVelocity = new Vector2(EmitVelocityValue, EmitVelocityRandom);",
        "            var EmitAngleAAngle = inputs[(int)InputId.EmitAngleAAngle].Eval(context).Value;",
        "            var EmitAngleAScatter = inputs[(int)InputId.EmitAngleAScatter].Eval(context).Value;",
        "            var EmitAngleA = new Vector2(EmitAngleAAngle, EmitAngleAScatter);",
        "            var EmitAngleBAngle = inputs[(int)InputId.EmitAngleBAngle].Eval(context).Value;",
        "            var EmitAngleBScatter = inputs[(int)InputId.EmitAngleBScatter].Eval(context).Value;",
        "            var EmitAngleB = new Vector2(EmitAngleBAngle, EmitAngleBScatter);",
        "            var EmitFrom = (int) inputs[(int)InputId.EmitFrom].Eval(context).Value;",
        "            var SizeValue = inputs[(int)InputId.SizeValue].Eval(context).Value;",
        "            var SizeVariation = inputs[(int)InputId.SizeVariation].Eval(context).Value;",
        "            var Size = new Vector2(SizeValue, SizeVariation);",
        "            var StretchX = inputs[(int)InputId.StretchX].Eval(context).Value;",
        "            var StretchY = inputs[(int)InputId.StretchY].Eval(context).Value;",
        "            var StretchZ = inputs[(int)InputId.StretchZ].Eval(context).Value;",
        "            var Stretch = new Vector3(StretchX, StretchY, StretchZ);",
        "            var StretchByMotion = inputs[(int)InputId.StretchByMotion].Eval(context).Value;",
        "            var ShrinkOverTimeAtBeginning = inputs[(int)InputId.ShrinkOverTimeAtBeginning].Eval(context).Value;",
        "            var ShrinkOverTimeAtEnd = inputs[(int)InputId.ShrinkOverTimeAtEnd].Eval(context).Value;",
        "            var ShrinkOverTime = new Vector2(ShrinkOverTimeAtBeginning, ShrinkOverTimeAtEnd);",
        "            var Orientation = (int) inputs[(int)InputId.Orientation].Eval(context).Value;",
        "            var VelocityFriction = inputs[(int)InputId.VelocityFriction].Eval(context).Value;",
        "            var GravityX = inputs[(int)InputId.GravityX].Eval(context).Value;",
        "            var GravityY = inputs[(int)InputId.GravityY].Eval(context).Value;",
        "            var GravityZ = inputs[(int)InputId.GravityZ].Eval(context).Value;",
        "            var Gravity = new Vector3(GravityX, GravityY, GravityZ);",
        "            var TurbulenceAmount = inputs[(int)InputId.TurbulenceAmount].Eval(context).Value;",
        "            var TurbulenceTime = inputs[(int)InputId.TurbulenceTime].Eval(context).Value;",
        "            var TurbulenceScale = inputs[(int)InputId.TurbulenceScale].Eval(context).Value;",
        "            var TurbulenceVariation = inputs[(int)InputId.TurbulenceVariation].Eval(context).Value;",
        "            var Turbulence = new Vector4(TurbulenceAmount, TurbulenceTime, TurbulenceScale, TurbulenceVariation);",
        "            var TextureCellsColumns = inputs[(int)InputId.TextureCellsColumns].Eval(context).Value;",
        "            var TextureCellsRows = inputs[(int)InputId.TextureCellsRows].Eval(context).Value;",
        "            var TextureCells = new Vector2(TextureCellsColumns, TextureCellsRows);",
        "            var ColorStartR = inputs[(int)InputId.ColorStartR].Eval(context).Value;",
        "            var ColorStartG = inputs[(int)InputId.ColorStartG].Eval(context).Value;",
        "            var ColorStartB = inputs[(int)InputId.ColorStartB].Eval(context).Value;",
        "            var ColorStartA = inputs[(int)InputId.ColorStartA].Eval(context).Value;",
        "            var ColorStart = new Color4(ColorStartR, ColorStartG, ColorStartB, ColorStartA);",
        "            var ColorVariationHue = inputs[(int)InputId.ColorVariationHue].Eval(context).Value;",
        "            var ColorVariationSaturation = inputs[(int)InputId.ColorVariationSaturation].Eval(context).Value;",
        "            var ColorVariationBrightness = inputs[(int)InputId.ColorVariationBrightness].Eval(context).Value;",
        "            var ColorVariationAlpha = inputs[(int)InputId.ColorVariationAlpha].Eval(context).Value;",
        "            var ColorVariation = new Vector4(ColorVariationHue, ColorVariationSaturation, ColorVariationBrightness, ColorVariationAlpha);",
        "            var ColorEndR = inputs[(int)InputId.ColorEndR].Eval(context).Value;",
        "            var ColorEndG = inputs[(int)InputId.ColorEndG].Eval(context).Value;",
        "            var ColorEndB = inputs[(int)InputId.ColorEndB].Eval(context).Value;",
        "            var ColorEndA = inputs[(int)InputId.ColorEndA].Eval(context).Value;",
        "            var ColorEnd = new Color4(ColorEndR, ColorEndG, ColorEndB, ColorEndA);",
        "            var FadeWithAgeAtBeginning = inputs[(int)InputId.FadeWithAgeAtBeginning].Eval(context).Value;",
        "            var FadeWithAgeAtEnd = inputs[(int)InputId.FadeWithAgeAtEnd].Eval(context).Value;",
        "            var FadeWithAge = new Vector2(FadeWithAgeAtBeginning, FadeWithAgeAtEnd);",
        "            var FocusDistance = inputs[(int)InputId.FocusDistance].Eval(context).Value;",
        "            var FocusRange = inputs[(int)InputId.FocusRange].Eval(context).Value;",
        "            var Focus = new Vector2(FocusDistance, FocusRange);",
        "            var FadeTooCloseDistance = inputs[(int)InputId.FadeTooCloseDistance].Eval(context).Value;",
        "            var FadeTooCloseRange = inputs[(int)InputId.FadeTooCloseRange].Eval(context).Value;",
        "            var FadeTooClose = new Vector2(FadeTooCloseDistance, FadeTooCloseRange);",
        "            var ParametersAffect = (int) inputs[(int)InputId.ParametersAffect].Eval(context).Value;",
        "            var NoiseTextureRGB = inputs[(int)InputId.NoiseTextureRGB].Eval(context).Image; // Needs to be checked for null!",
        "            var TrailsLength = inputs[(int)InputId.TrailsLength].Eval(context).Value;",
        "            var TrailsSpread = inputs[(int)InputId.TrailsSpread].Eval(context).Value;",
        "            var Trails = new Vector2(TrailsLength, TrailsSpread);",
        "            var FadeTooFarDistance = inputs[(int)InputId.FadeTooFarDistance].Eval(context).Value;",
        "            var FadeTooFarRange = inputs[(int)InputId.FadeTooFarRange].Eval(context).Value;",
        "            var FadeTooFar = new Vector2(FadeTooFarDistance, FadeTooFarRange);",
        "            var TurbulenceFadeIn = inputs[(int)InputId.TurbulenceFadeIn].Eval(context).Value;",
        "            //<<< _params",
        "",
        "            float lastTime = _time;",
        "            _time = context.Time;",
        "            float deltaTime = _time - lastTime;",
        "",
        "            InitializeBuffer(context, (int)ParticleCount); ",
        "",
        "            var deviceContext = context.D3DDevice.ImmediateContext;",
        "            ",
        "            float emitPeriod = 1.0f/EmitRate;",
        "            float emitStartTime = lastTime - (lastTime % emitPeriod); //- ParticleCount * emitPeriod;",
        "            var numberOfParticlesToEmit = Math.Max(0, (int) ((_time - emitStartTime)*EmitRate )) * (int)( Math.Max(0, TrailsLength)+1);",
        "            ",
        "            // Re-emit all particles...",
        "            var reEmitAll = Math.Abs(ParametersAffect -0 ) < 0.5f || deltaTime < 0 || ResetTrigger > 0.5;",
        "            if(reEmitAll) {",
        "                _currentParticleIndex = 0;",
        "                numberOfParticlesToEmit = (int)ParticleCount-1;",
        "                emitStartTime -=  ParticleCount/(TrailsLength+1) * emitPeriod;",
        "                //Logger.Info(\"reemit\");                ",
        "            }",
        "            ",
        "            //numberOfParticlesToEmit *= ;",
        "",
        "            ",
        "            //emitStartTime = _time - numberOfParticlesToEmit * emitPeriod;",
        "            ",
        "            //float lastParticleEmitTime = _time - ParticleCount - (lastTime % emitPeriod);",
        "            //float emitStartTime = lastParticleEmitTime + emitPeriod;",
        "            ",
        "//            Vector3 emitCenterDelta = (EmitCenter - _previousEmitCenter);",
        "//            if (emitTime < context.Time)",
        "//            {",
        "                //Logger.Info(\"n:{0}\" , emitCenterDelta);",
        "//            }",
        "",
        "            if(Texture == null) {",
        "                Logger.Info(this, \"Missing Particle-Texture\");",
        "                return context;",
        "            }",
        "            if(NoiseTextureRGB == null) {",
        "                Logger.Info(this, \"Missing RGBNoise-Texture\");",
        "                return context;",
        "            }",
        "",
        "            using (var imageSRV = new ShaderResourceView(context.D3DDevice, Texture))",
        "            using (var noiseTextureSRV = new ShaderResourceView(context.D3DDevice, NoiseTextureRGB))",
        "            {",
        "               if(numberOfParticlesToEmit > 0) ",
        "               {",
        "                    //Logger.Info(\"EmitCount: {0}  T:{1} StartTime:{2} dt:{3}, @{4}\", numberOfParticlesToEmit, _time, emitStartTime, emitPeriod, _currentParticleIndex);",
        "                    int particleEmitCountForFrame = numberOfParticlesToEmit;",
        "                        ",
        "                    //int particleEndIndex = (_currentParticleIndex + particleEmitCountForFrame) % _particleCount;",
        "                    var param = new ParticleInitParametersBufferLayout(",
        "                                        _currentParticleIndex, ",
        "                                        numberOfParticlesToEmit, ",
        "                                        _time, ",
        "                                        EmitPosition, ",
        "                                        _previousEmitPosition,",
        "                                        _particleCount, ",
        "                                        EmitterSize, ",
        "                                        LimitPositions, ",
        "                                        Scatter, ",
        "                                        EmitVelocity, ",
        "                                        EmitAngleA, ",
        "                                        _previousEmitAngleA,",
        "                                        EmitAngleB, ",
        "                                        _previousEmitAngleB,",
        "                                        emitStartTime, ",
        "                                        emitPeriod,",
        "                                        (int)TrailsLength,",
        "                                        (int)EmitFrom ",
        "                    );",
        "                    BaseRenderer.SetupConstBufferForCS<ParticleInitParametersBufferLayout>(context, param, ref _particleInitParametersBuffer, 0);",
        "        ",
        "                    _currentParticleIndex = (_currentParticleIndex + numberOfParticlesToEmit) % _particleCount;",
        "                            ",
        "                    deviceContext.ComputeShader.Set(_csInitParticles);",
        "                    deviceContext.ComputeShader.SetUnorderedAccessView(0, _particleStateUAV);",
        "                    deviceContext.ComputeShader.SetShaderResource(0, noiseTextureSRV);",
        "                    deviceContext.ComputeShader.SetConstantBuffer(0, _particleInitParametersBuffer);                    ",
        "                    deviceContext.ComputeShader.SetSampler(0, _linearSamplerState);",
        "        ",
        "                    deviceContext.Dispatch(_particleCount/512+1, 1, 1);",
        "        ",
        "                    deviceContext.ComputeShader.SetShaderResource(0, null);",
        "                    deviceContext.ComputeShader.SetConstantBuffer(0, null);",
        "                    deviceContext.ComputeShader.SetSampler(0, null);",
        "        ",
        "                    _previousEmitPosition = EmitPosition;",
        "                    _previousEmitAngleA = EmitAngleAAngle;",
        "                    _previousEmitAngleB = EmitAngleBAngle;",
        "                }",
        "    ",
        "                // Particle updating",
        "                deviceContext.ComputeShader.SetUnorderedAccessView(0, null);",
        "                deviceContext.ComputeShader.SetConstantBuffer(1, null);",
        "            ",
        "",
        "                // Particle rendering",
        "                try",
        "                {                ",
        "                    var lifeTime = LifeTime <=0 ?  ParticleCount/(EmitRate* (TrailsLength+1)) : LifeTime;",
        "",
        "                    // Note: Emit paramaters are passed with ConstantBuffer above                    ",
        "                    _fxRenderParticles.GetVariableByName(\"ParticleStates\").AsShaderResource().SetResource(_particleStateSRV);",
        "",
        "                    _fxRenderParticles.GetVariableByName(\"NoiseTextureRGB\").AsShaderResource().SetResource(noiseTextureSRV);",
        "                    _fxRenderParticles.GetVariableByName(\"Texture\").AsShaderResource().SetResource(imageSRV);",
        "                    _fxRenderParticles.GetVariableByName(\"Time\").AsScalar().Set((float)_time);",
        "                    _fxRenderParticles.GetVariableByName(\"LifeTime\").AsScalar().Set((float)lifeTime);",
        "                    _fxRenderParticles.GetVariableByName(\"EmitRate\").AsScalar().Set(EmitRate);",
        "",
        "                    _fxRenderParticles.GetVariableByName(\"ShrinkOverTime\").AsVector().Set(ShrinkOverTime);",
        "                    _fxRenderParticles.GetVariableByName(\"Size\").AsVector().Set(Size);",
        "                    _fxRenderParticles.GetVariableByName(\"Stretch\").AsVector().Set(Stretch);",
        "                    ",
        "                    _fxRenderParticles.GetVariableByName(\"Orientation\").AsScalar().Set(Orientation);",
        "                    _fxRenderParticles.GetVariableByName(\"StretchByMotion\").AsScalar().Set(StretchByMotion);",
        "                    _fxRenderParticles.GetVariableByName(\"VelocityFriction\").AsScalar().Set(VelocityFriction);",
        "                    _fxRenderParticles.GetVariableByName(\"Gravity\").AsVector().Set(Gravity);",
        "                    _fxRenderParticles.GetVariableByName(\"Turbulence\").AsVector().Set(Turbulence);",
        "                    _fxRenderParticles.GetVariableByName(\"TextureCells\").AsVector().Set( new Vector2( (float)Math.Round(TextureCells.X), (float)Math.Round(TextureCells.Y)) );",
        "                    _fxRenderParticles.GetVariableByName(\"ColorStart\").AsVector().Set(ColorStart);",
        "                    _fxRenderParticles.GetVariableByName(\"ColorEnd\").AsVector().Set(ColorEnd);",
        "                    _fxRenderParticles.GetVariableByName(\"ColorVariation\").AsVector().Set(ColorVariation);",
        "                    _fxRenderParticles.GetVariableByName(\"FadeWithAge\").AsVector().Set(FadeWithAge);",
        "                    _fxRenderParticles.GetVariableByName(\"Focus\").AsVector().Set(Focus);",
        "                    _fxRenderParticles.GetVariableByName(\"FadeTooClose\").AsVector().Set(FadeTooClose);",
        "                    _fxRenderParticles.GetVariableByName(\"FadeTooFar\").AsVector().Set(FadeTooFar);",
        "                    _fxRenderParticles.GetVariableByName(\"Trails\").AsVector().Set(Trails);",
        "                    _fxRenderParticles.GetVariableByName(\"TurbulenceFadeIn\").AsScalar().Set(TurbulenceFadeIn);",
        "                    //SetScalar(\"TurbulenceFadeIn\",TurbulenceFadeIn);",
        "                    ",
        "                    var previousEffect = context.Effect;",
        "                    context.Effect = _fxRenderParticles;",
        "                    context.Renderer.SetupEffect(context);",
        "",
        "                    if (context.DepthStencilView != null)",
        "                        deviceContext.OutputMerger.SetTargets(context.DepthStencilView, context.RenderTargetView);",
        "                    else",
        "                        deviceContext.OutputMerger.SetTargets(context.RenderTargetView);",
        "",
        "                    if (context.BlendState != null) {",
        "                        deviceContext.OutputMerger.BlendState = context.BlendState;",
        "                        deviceContext.OutputMerger.BlendFactor = context.BlendFactor;",
        "                    }",
        "",
        "                    if (context.DepthStencilState != null) {",
        "                        deviceContext.OutputMerger.DepthStencilState = context.DepthStencilState;",
        "                    }",
        "",
        "                    if (context.RasterizerState != null) {",
        "                        deviceContext.Rasterizer.State = context.RasterizerState;",
        "                    }",
        "",
        "                    deviceContext.Rasterizer.SetViewport(context.Viewport);",
        "                    deviceContext.InputAssembler.InputLayout = context.InputLayout;",
        "                    deviceContext.InputAssembler.PrimitiveTopology = PrimitiveTopology.PointList;",
        "                    deviceContext.InputAssembler.SetVertexBuffers(0, new VertexBufferBinding(null, 0, 0));",
        "",
        "                    var technique = context.Effect.GetTechniqueByIndex(0);",
        "                    for (int i = 0; i < technique.Description.PassCount; ++i) {",
        "                        technique.GetPassByIndex(i).Apply(deviceContext);",
        "                        deviceContext.Draw(_particleCount, 0);",
        "                    }",
        "",
        "                    // remove target views that they are no longer bound as output and can be used also as input",
        "                    DepthStencilView dsv = null;",
        "                    RenderTargetView rtv = null;",
        "                    deviceContext.OutputMerger.SetTargets(dsv, rtv);",
        "                    deviceContext.VertexShader.SetShaderResource(0, null);",
        "                    deviceContext.PixelShader.SetShaderResource(0, null);",
        "                    context.Effect = previousEffect;",
        "                }",
        "                catch (Exception exception)",
        "                {",
        "                    Logger.Error(this,\"render error: {0}\", exception.Message);",
        "                }",
        "            }",
        "",
        "            Changed = false;",
        "            return context;",
        "        }",
        "",
        "        void InitializeBuffer(OperatorPartContext context, int newMaxNumParticles)",
        "        {",
        "            newMaxNumParticles = Math.Max(1, newMaxNumParticles); //at least we need to have 512 particles",
        "",
        "            if (_particleStateBuffer == null || _particleCount != newMaxNumParticles)",
        "            {",
        "          ",
        "                Utilities.DisposeObj(ref _particleStateBuffer);",
        "                using (var data = new DataStream(Marshal.SizeOf(typeof(ParticleStateLayout))*newMaxNumParticles, true, true))",
        "                {",
        "                    for (int i = 0; i < newMaxNumParticles; ++i) {",
        "                        data.Write(new ParticleStateLayout(new Vector3(0), new Vector3(0), 0.0f));",
        "                    ",
        "                    }",
        "                    data.Position = 0;",
        "",
        "                    var bufferDesc = new BufferDescription",
        "                                         {",
        "                                             Usage = ResourceUsage.Default,",
        "                                             SizeInBytes = Marshal.SizeOf(typeof(ParticleStateLayout))*newMaxNumParticles,",
        "                                             StructureByteStride = Marshal.SizeOf(typeof(ParticleStateLayout)),",
        "                                             BindFlags = BindFlags.ShaderResource | BindFlags.UnorderedAccess,",
        "                                             OptionFlags = ResourceOptionFlags.BufferStructured",
        "                                         };",
        "                    _particleStateBuffer = new Buffer(context.D3DDevice, data, bufferDesc);",
        "                }",
        "                _particleCount = newMaxNumParticles;",
        "",
        "                var uavDesc = new UnorderedAccessViewDescription",
        "                                  {",
        "                                      Format = Format.Unknown, ",
        "                                      Dimension = UnorderedAccessViewDimension.Buffer,",
        "                                      Buffer = new UnorderedAccessViewDescription.BufferResource",
        "                                                   {",
        "                                                       FirstElement = 0,",
        "                                                       ElementCount = _particleCount,",
        "                                                       Flags = UnorderedAccessViewBufferFlags.None",
        "                                                   }",
        "                                  };",
        "",
        "                Utilities.DisposeObj(ref _particleStateUAV);",
        "                _particleStateUAV = new UnorderedAccessView(context.D3DDevice, _particleStateBuffer, uavDesc);",
        "",
        "                Utilities.DisposeObj(ref _particleStateSRV);",
        "                _particleStateSRV = new ShaderResourceView(context.D3DDevice, _particleStateBuffer);",
        "",
        "            }",
        "        }",
        "",
        "        public override int NumCodes()",
        "        {",
        "            return 2;",
        "        }",
        "",
        "        public override CompilerErrorCollection Compile(int codeIdx)",
        "        {",
        "            var errors = new CompilerErrorCollection();",
        "            try",
        "            {",
        "                if (codeIdx == (int)InputId.InitCode)",
        "                {",
        "                    Utilities.DisposeObj(ref _csInitParticles);",
        "                    var t = GetCode(codeIdx);",
        "                    using (var bytecode = ShaderBytecode.Compile(GetCode(codeIdx), \"CSInitParticles\", \"cs_5_0\", ShaderFlags.Debug))",
        "                        _csInitParticles = new ComputeShader(D3DDevice.Device, bytecode);",
        "",
        "                    Utilities.DisposeObj(ref _csUpdateParticles);",
        "//                    using (var bytecode = ShaderBytecode.Compile(GetCode(codeIdx), \"CSUpdateParticles\", \"cs_5_0\", ShaderFlags.Debug))",
        "//                        _csUpdateParticles = new ComputeShader(D3DDevice.Device, bytecode);",
        "                }",
        "                else",
        "                {",
        "                    Utilities.DisposeObj(ref _fxRenderParticles);",
        "                    using (var bytecode = ShaderBytecode.Compile(GetCode(codeIdx), \"fx_5_0\", ShaderFlags.Debug, EffectFlags.None, null, null))",
        "                        _fxRenderParticles = new Effect(D3DDevice.Device, bytecode);",
        "                }",
        "            }",
        "            catch (SharpDX.CompilationException ex)",
        "            {",
        "                errors = ErrorsFromString(ex.Message);",
        "                Logger.Error(this,\"Fx compile error: {0}\", ex.Message);",
        "            }",
        "            return errors;",
        "        }",
        "        ",
        "        private static Vector3 ComputeSubdivisionOfBox( Vector3 VolumeSize, int Count) ",
        "        {",
        "            var volume = Math.Abs(VolumeSize.X) * Math.Abs(VolumeSize.Y) * Math.Abs(VolumeSize.Z);            ",
        "            var s1= new Vector3(Math.Abs(VolumeSize.X), Math.Abs(VolumeSize.Y), Math.Abs(VolumeSize.Z));",
        "            var a= s1.Y/s1.X;",
        "            var b= s1.Z/s1.X;",
        "            ",
        "            var xx = (float)Math.Pow( 1/ (a*b), 1.0/3.0);",
        "            var s2 = s1 * (xx/s1.X);",
        "                                        ",
        "            var edgeCount= Math.Pow(Count,1.0/3.0);",
        "            ",
        "            var itemsX= (float)Math.Max(1, Math.Round(edgeCount * s2.X));",
        "            var itemsY= (float)Math.Max(1, Math.Round(edgeCount * s2.Y));",
        "            var itemsZ= (float)Math.Max(1, Math.Round(edgeCount * s2.Z));",
        "",
        "            if( itemsZ> itemsX && itemsZ> itemsY) {",
        "                itemsZ= Count/itemsX/itemsY;",
        "            }",
        "            else if( itemsX > itemsY && itemsX > itemsZ) {",
        "                itemsX= Count/itemsY/itemsZ;",
        "            }",
        "            else {",
        "                itemsY= Count/itemsX/itemsZ;",
        "            }",
        "",
        "            //var x = (int)(i % itemsX)/ itemsX;",
        "            //var y = (int)((i/itemsX) % itemsY) / itemsY;",
        "            //var z = (int)((i/itemsX/itemsY)) / itemsZ;",
        "                                                                    ",
        "            //t = new Vector3((float) (x- (itemsX > 1 ? 0.5 : 0)),",
        "            //                (float) (y- (itemsY > 1 ? 0.5 : 0)),",
        "            //               (float) (z- (itemsZ > 1 ? 0.5 : 0))) * Stretch;",
        "            //Logger.Info(\"{0} {1} {2} \",itemsX, itemsY, itemsZ);",
        "            return new Vector3(itemsX, itemsY, itemsZ);",
        "                                            ",
        "        ",
        "        }",
        "",
        "        ComputeShader _csInitParticles;",
        "        ComputeShader _csUpdateParticles;",
        "        Effect _fxRenderParticles;",
        "        Buffer _particleStateBuffer;",
        "        UnorderedAccessView _particleStateUAV;",
        "        ShaderResourceView _particleStateSRV;",
        "        int _particleCount;",
        "        int _currentParticleIndex;",
        "        Vector3 _previousEmitPosition;",
        "        float _previousEmitAngleA= 0;",
        "        float _previousEmitAngleB = 0;",
        "        //Vector3 _previousEmitDirection;",
        "",
        "        float _time;",
        "    }",
        "}",
        "",
        "",
        ""
      ],
      "AdditionalAssemblies": []
    }
  ],
  "Operators": [],
  "Connections": [
    {
      "SourceOp": "00000000-0000-0000-0000-000000000000",
      "SourceOpPart": "fd7038bc-0fc8-4d49-86d5-125f15da7f52",
      "TargetOp": "00000000-0000-0000-0000-000000000000",
      "TargetOpPart": "db950649-fe60-4670-8f73-fb0e2d4ffddb"
    },
    {
      "SourceOp": "00000000-0000-0000-0000-000000000000",
      "SourceOpPart": "fec785ec-4383-4337-9f32-3cf9c1d29199",
      "TargetOp": "00000000-0000-0000-0000-000000000000",
      "TargetOpPart": "fd7038bc-0fc8-4d49-86d5-125f15da7f52"
    },
    {
      "SourceOp": "00000000-0000-0000-0000-000000000000",
      "SourceOpPart": "1acc27f4-d3f9-4d0b-892f-0edbedb72625",
      "TargetOp": "00000000-0000-0000-0000-000000000000",
      "TargetOpPart": "fd7038bc-0fc8-4d49-86d5-125f15da7f52"
    },
    {
      "SourceOp": "00000000-0000-0000-0000-000000000000",
      "SourceOpPart": "410359ff-e9bf-43c6-baea-ca7e509e0913",
      "TargetOp": "00000000-0000-0000-0000-000000000000",
      "TargetOpPart": "fd7038bc-0fc8-4d49-86d5-125f15da7f52"
    },
    {
      "SourceOp": "00000000-0000-0000-0000-000000000000",
      "SourceOpPart": "e65de08d-ac22-498f-b73f-de5ed88e04c2",
      "TargetOp": "00000000-0000-0000-0000-000000000000",
      "TargetOpPart": "fd7038bc-0fc8-4d49-86d5-125f15da7f52"
    },
    {
      "SourceOp": "00000000-0000-0000-0000-000000000000",
      "SourceOpPart": "8fd75bbf-15d0-40ac-8cb1-4e7603d4a249",
      "TargetOp": "00000000-0000-0000-0000-000000000000",
      "TargetOpPart": "fd7038bc-0fc8-4d49-86d5-125f15da7f52"
    },
    {
      "SourceOp": "00000000-0000-0000-0000-000000000000",
      "SourceOpPart": "bbac9642-ce0f-4bb1-a1b0-daca80cae2ea",
      "TargetOp": "00000000-0000-0000-0000-000000000000",
      "TargetOpPart": "fd7038bc-0fc8-4d49-86d5-125f15da7f52"
    },
    {
      "SourceOp": "00000000-0000-0000-0000-000000000000",
      "SourceOpPart": "5cd1a563-18c5-4920-ae50-bf1fca30d4e5",
      "TargetOp": "00000000-0000-0000-0000-000000000000",
      "TargetOpPart": "fd7038bc-0fc8-4d49-86d5-125f15da7f52"
    },
    {
      "SourceOp": "00000000-0000-0000-0000-000000000000",
      "SourceOpPart": "fee9730f-56b1-489a-93d1-49ce428c73d5",
      "TargetOp": "00000000-0000-0000-0000-000000000000",
      "TargetOpPart": "fd7038bc-0fc8-4d49-86d5-125f15da7f52"
    },
    {
      "SourceOp": "00000000-0000-0000-0000-000000000000",
      "SourceOpPart": "24733734-fb2d-4f89-8325-9d9d20d7674e",
      "TargetOp": "00000000-0000-0000-0000-000000000000",
      "TargetOpPart": "fd7038bc-0fc8-4d49-86d5-125f15da7f52"
    },
    {
      "SourceOp": "00000000-0000-0000-0000-000000000000",
      "SourceOpPart": "8a40ede4-bd63-4a28-9619-ff1205806e20",
      "TargetOp": "00000000-0000-0000-0000-000000000000",
      "TargetOpPart": "fd7038bc-0fc8-4d49-86d5-125f15da7f52"
    },
    {
      "SourceOp": "00000000-0000-0000-0000-000000000000",
      "SourceOpPart": "ea4cef2e-b33a-49b0-82da-5ae8fe06bd5a",
      "TargetOp": "00000000-0000-0000-0000-000000000000",
      "TargetOpPart": "fd7038bc-0fc8-4d49-86d5-125f15da7f52"
    },
    {
      "SourceOp": "00000000-0000-0000-0000-000000000000",
      "SourceOpPart": "bb2b4fc6-8541-411f-b666-2e78db59c5ad",
      "TargetOp": "00000000-0000-0000-0000-000000000000",
      "TargetOpPart": "fd7038bc-0fc8-4d49-86d5-125f15da7f52"
    },
    {
      "SourceOp": "00000000-0000-0000-0000-000000000000",
      "SourceOpPart": "7aba8c56-6ffd-4e88-b325-292aafe0acfb",
      "TargetOp": "00000000-0000-0000-0000-000000000000",
      "TargetOpPart": "fd7038bc-0fc8-4d49-86d5-125f15da7f52"
    },
    {
      "SourceOp": "00000000-0000-0000-0000-000000000000",
      "SourceOpPart": "5bae7684-5779-4a15-861a-0387b03ec749",
      "TargetOp": "00000000-0000-0000-0000-000000000000",
      "TargetOpPart": "fd7038bc-0fc8-4d49-86d5-125f15da7f52"
    },
    {
      "SourceOp": "00000000-0000-0000-0000-000000000000",
      "SourceOpPart": "acdd1a42-9a92-4a77-b827-f0895a317408",
      "TargetOp": "00000000-0000-0000-0000-000000000000",
      "TargetOpPart": "fd7038bc-0fc8-4d49-86d5-125f15da7f52"
    },
    {
      "SourceOp": "00000000-0000-0000-0000-000000000000",
      "SourceOpPart": "b19328f2-9425-4e76-8855-15f5c80bb3e5",
      "TargetOp": "00000000-0000-0000-0000-000000000000",
      "TargetOpPart": "fd7038bc-0fc8-4d49-86d5-125f15da7f52"
    },
    {
      "SourceOp": "00000000-0000-0000-0000-000000000000",
      "SourceOpPart": "fa0f8b29-7a9f-4385-806c-c778ffff51d8",
      "TargetOp": "00000000-0000-0000-0000-000000000000",
      "TargetOpPart": "fd7038bc-0fc8-4d49-86d5-125f15da7f52"
    },
    {
      "SourceOp": "00000000-0000-0000-0000-000000000000",
      "SourceOpPart": "8d7fcf75-e50d-47a6-9a03-853f34b12766",
      "TargetOp": "00000000-0000-0000-0000-000000000000",
      "TargetOpPart": "fd7038bc-0fc8-4d49-86d5-125f15da7f52"
    },
    {
      "SourceOp": "00000000-0000-0000-0000-000000000000",
      "SourceOpPart": "34d0049c-2ff7-4081-8176-8e079e8f51d7",
      "TargetOp": "00000000-0000-0000-0000-000000000000",
      "TargetOpPart": "fd7038bc-0fc8-4d49-86d5-125f15da7f52"
    },
    {
      "SourceOp": "00000000-0000-0000-0000-000000000000",
      "SourceOpPart": "553ef4ad-9b68-41d8-8f33-cf576eabf13a",
      "TargetOp": "00000000-0000-0000-0000-000000000000",
      "TargetOpPart": "fd7038bc-0fc8-4d49-86d5-125f15da7f52"
    },
    {
      "SourceOp": "00000000-0000-0000-0000-000000000000",
      "SourceOpPart": "2118646c-858d-4d15-bb98-e6d1ff7c96cf",
      "TargetOp": "00000000-0000-0000-0000-000000000000",
      "TargetOpPart": "fd7038bc-0fc8-4d49-86d5-125f15da7f52"
    },
    {
      "SourceOp": "00000000-0000-0000-0000-000000000000",
      "SourceOpPart": "5504f821-5b4b-4853-855a-bf9d2959cec5",
      "TargetOp": "00000000-0000-0000-0000-000000000000",
      "TargetOpPart": "fd7038bc-0fc8-4d49-86d5-125f15da7f52"
    },
    {
      "SourceOp": "00000000-0000-0000-0000-000000000000",
      "SourceOpPart": "fd03531d-bbcf-47d9-8eb6-fd448ea53cb5",
      "TargetOp": "00000000-0000-0000-0000-000000000000",
      "TargetOpPart": "fd7038bc-0fc8-4d49-86d5-125f15da7f52"
    },
    {
      "SourceOp": "00000000-0000-0000-0000-000000000000",
      "SourceOpPart": "1a889058-027f-46b4-953f-dcdfa87e392a",
      "TargetOp": "00000000-0000-0000-0000-000000000000",
      "TargetOpPart": "fd7038bc-0fc8-4d49-86d5-125f15da7f52"
    },
    {
      "SourceOp": "00000000-0000-0000-0000-000000000000",
      "SourceOpPart": "a5215f8e-3c59-4d65-8131-4a4a86863128",
      "TargetOp": "00000000-0000-0000-0000-000000000000",
      "TargetOpPart": "fd7038bc-0fc8-4d49-86d5-125f15da7f52"
    },
    {
      "SourceOp": "00000000-0000-0000-0000-000000000000",
      "SourceOpPart": "5f1ff9a9-2754-44a7-9839-1063cf72c320",
      "TargetOp": "00000000-0000-0000-0000-000000000000",
      "TargetOpPart": "fd7038bc-0fc8-4d49-86d5-125f15da7f52"
    },
    {
      "SourceOp": "00000000-0000-0000-0000-000000000000",
      "SourceOpPart": "ebef9570-7324-41a1-9809-5a3ca658adba",
      "TargetOp": "00000000-0000-0000-0000-000000000000",
      "TargetOpPart": "fd7038bc-0fc8-4d49-86d5-125f15da7f52"
    },
    {
      "SourceOp": "00000000-0000-0000-0000-000000000000",
      "SourceOpPart": "a67a16c4-a84b-4ae6-8603-3302b93df240",
      "TargetOp": "00000000-0000-0000-0000-000000000000",
      "TargetOpPart": "fd7038bc-0fc8-4d49-86d5-125f15da7f52"
    },
    {
      "SourceOp": "00000000-0000-0000-0000-000000000000",
      "SourceOpPart": "f4f9da06-4f8c-4be9-8c3e-fe625295dbc4",
      "TargetOp": "00000000-0000-0000-0000-000000000000",
      "TargetOpPart": "fd7038bc-0fc8-4d49-86d5-125f15da7f52"
    },
    {
      "SourceOp": "00000000-0000-0000-0000-000000000000",
      "SourceOpPart": "0f552f7a-9d15-4e77-ba93-ba97956f5638",
      "TargetOp": "00000000-0000-0000-0000-000000000000",
      "TargetOpPart": "fd7038bc-0fc8-4d49-86d5-125f15da7f52"
    },
    {
      "SourceOp": "00000000-0000-0000-0000-000000000000",
      "SourceOpPart": "f446ff08-7ee0-4831-bd4b-40409b844c97",
      "TargetOp": "00000000-0000-0000-0000-000000000000",
      "TargetOpPart": "fd7038bc-0fc8-4d49-86d5-125f15da7f52"
    },
    {
      "SourceOp": "00000000-0000-0000-0000-000000000000",
      "SourceOpPart": "05ad8272-4442-4289-9001-428135effe00",
      "TargetOp": "00000000-0000-0000-0000-000000000000",
      "TargetOpPart": "fd7038bc-0fc8-4d49-86d5-125f15da7f52"
    },
    {
      "SourceOp": "00000000-0000-0000-0000-000000000000",
      "SourceOpPart": "951e0160-452a-4e3f-9f17-c30224ab11ad",
      "TargetOp": "00000000-0000-0000-0000-000000000000",
      "TargetOpPart": "fd7038bc-0fc8-4d49-86d5-125f15da7f52"
    },
    {
      "SourceOp": "00000000-0000-0000-0000-000000000000",
      "SourceOpPart": "c41771bf-f048-4853-8779-fd9c91590814",
      "TargetOp": "00000000-0000-0000-0000-000000000000",
      "TargetOpPart": "fd7038bc-0fc8-4d49-86d5-125f15da7f52"
    },
    {
      "SourceOp": "00000000-0000-0000-0000-000000000000",
      "SourceOpPart": "cb07f19e-096c-4616-ae29-9c19cfce6c7f",
      "TargetOp": "00000000-0000-0000-0000-000000000000",
      "TargetOpPart": "fd7038bc-0fc8-4d49-86d5-125f15da7f52"
    },
    {
      "SourceOp": "00000000-0000-0000-0000-000000000000",
      "SourceOpPart": "76293e2f-7019-45fd-af30-c8eaf0010607",
      "TargetOp": "00000000-0000-0000-0000-000000000000",
      "TargetOpPart": "fd7038bc-0fc8-4d49-86d5-125f15da7f52"
    },
    {
      "SourceOp": "00000000-0000-0000-0000-000000000000",
      "SourceOpPart": "b0df09fe-5402-4188-9cf9-21d0d9c9036c",
      "TargetOp": "00000000-0000-0000-0000-000000000000",
      "TargetOpPart": "fd7038bc-0fc8-4d49-86d5-125f15da7f52"
    },
    {
      "SourceOp": "00000000-0000-0000-0000-000000000000",
      "SourceOpPart": "0c1a5695-d6a3-4dd0-950e-59173e845949",
      "TargetOp": "00000000-0000-0000-0000-000000000000",
      "TargetOpPart": "fd7038bc-0fc8-4d49-86d5-125f15da7f52"
    },
    {
      "SourceOp": "00000000-0000-0000-0000-000000000000",
      "SourceOpPart": "47a93874-73ed-42b9-982b-97b36ff2f8b7",
      "TargetOp": "00000000-0000-0000-0000-000000000000",
      "TargetOpPart": "fd7038bc-0fc8-4d49-86d5-125f15da7f52"
    },
    {
      "SourceOp": "00000000-0000-0000-0000-000000000000",
      "SourceOpPart": "2b8762b3-bd82-4977-a578-9359f732ed39",
      "TargetOp": "00000000-0000-0000-0000-000000000000",
      "TargetOpPart": "fd7038bc-0fc8-4d49-86d5-125f15da7f52"
    },
    {
      "SourceOp": "00000000-0000-0000-0000-000000000000",
      "SourceOpPart": "83cc6209-f9ec-4aa2-86ef-4708b0c5e307",
      "TargetOp": "00000000-0000-0000-0000-000000000000",
      "TargetOpPart": "fd7038bc-0fc8-4d49-86d5-125f15da7f52"
    },
    {
      "SourceOp": "00000000-0000-0000-0000-000000000000",
      "SourceOpPart": "456089f9-81b1-4cef-85eb-841853ad3c15",
      "TargetOp": "00000000-0000-0000-0000-000000000000",
      "TargetOpPart": "fd7038bc-0fc8-4d49-86d5-125f15da7f52"
    },
    {
      "SourceOp": "00000000-0000-0000-0000-000000000000",
      "SourceOpPart": "541b9305-b714-4c2b-91dd-229d77dc5f6f",
      "TargetOp": "00000000-0000-0000-0000-000000000000",
      "TargetOpPart": "fd7038bc-0fc8-4d49-86d5-125f15da7f52"
    },
    {
      "SourceOp": "00000000-0000-0000-0000-000000000000",
      "SourceOpPart": "81dd75a7-18df-4ff2-8ab1-1efa935e66d3",
      "TargetOp": "00000000-0000-0000-0000-000000000000",
      "TargetOpPart": "fd7038bc-0fc8-4d49-86d5-125f15da7f52"
    },
    {
      "SourceOp": "00000000-0000-0000-0000-000000000000",
      "SourceOpPart": "e432db99-d748-4a4c-b191-f231a9e02321",
      "TargetOp": "00000000-0000-0000-0000-000000000000",
      "TargetOpPart": "fd7038bc-0fc8-4d49-86d5-125f15da7f52"
    },
    {
      "SourceOp": "00000000-0000-0000-0000-000000000000",
      "SourceOpPart": "03b906df-b228-4902-9e43-9ff20d5ab96e",
      "TargetOp": "00000000-0000-0000-0000-000000000000",
      "TargetOpPart": "fd7038bc-0fc8-4d49-86d5-125f15da7f52"
    },
    {
      "SourceOp": "00000000-0000-0000-0000-000000000000",
      "SourceOpPart": "90bc34f9-61bd-4731-acc6-6e1bb191afb2",
      "TargetOp": "00000000-0000-0000-0000-000000000000",
      "TargetOpPart": "fd7038bc-0fc8-4d49-86d5-125f15da7f52"
    },
    {
      "SourceOp": "00000000-0000-0000-0000-000000000000",
      "SourceOpPart": "b6f0916f-1bb5-41ee-9063-ecf566f53460",
      "TargetOp": "00000000-0000-0000-0000-000000000000",
      "TargetOpPart": "fd7038bc-0fc8-4d49-86d5-125f15da7f52"
    },
    {
      "SourceOp": "00000000-0000-0000-0000-000000000000",
      "SourceOpPart": "d2b276db-eb2c-41a9-97f9-5ed5c4c0f872",
      "TargetOp": "00000000-0000-0000-0000-000000000000",
      "TargetOpPart": "fd7038bc-0fc8-4d49-86d5-125f15da7f52"
    },
    {
      "SourceOp": "00000000-0000-0000-0000-000000000000",
      "SourceOpPart": "7d151ed9-9f94-4031-917d-70404f475eff",
      "TargetOp": "00000000-0000-0000-0000-000000000000",
      "TargetOpPart": "fd7038bc-0fc8-4d49-86d5-125f15da7f52"
    },
    {
      "SourceOp": "00000000-0000-0000-0000-000000000000",
      "SourceOpPart": "cf4ff932-a9a7-4af7-a673-41430305d297",
      "TargetOp": "00000000-0000-0000-0000-000000000000",
      "TargetOpPart": "fd7038bc-0fc8-4d49-86d5-125f15da7f52"
    },
    {
      "SourceOp": "00000000-0000-0000-0000-000000000000",
      "SourceOpPart": "5f2cf399-8db0-48a6-8128-92a6cab61eac",
      "TargetOp": "00000000-0000-0000-0000-000000000000",
      "TargetOpPart": "fd7038bc-0fc8-4d49-86d5-125f15da7f52"
    },
    {
      "SourceOp": "00000000-0000-0000-0000-000000000000",
      "SourceOpPart": "b17dc87e-c849-4cdc-b84a-8361175db96c",
      "TargetOp": "00000000-0000-0000-0000-000000000000",
      "TargetOpPart": "fd7038bc-0fc8-4d49-86d5-125f15da7f52"
    },
    {
      "SourceOp": "00000000-0000-0000-0000-000000000000",
      "SourceOpPart": "20248110-0e47-4334-8e00-077c8d4294f2",
      "TargetOp": "00000000-0000-0000-0000-000000000000",
      "TargetOpPart": "fd7038bc-0fc8-4d49-86d5-125f15da7f52"
    },
    {
      "SourceOp": "00000000-0000-0000-0000-000000000000",
      "SourceOpPart": "c690bc57-15d9-4c58-b7d9-863f89389391",
      "TargetOp": "00000000-0000-0000-0000-000000000000",
      "TargetOpPart": "fd7038bc-0fc8-4d49-86d5-125f15da7f52"
    },
    {
      "SourceOp": "00000000-0000-0000-0000-000000000000",
      "SourceOpPart": "dc12486c-89c5-4b22-9eb1-24237828b607",
      "TargetOp": "00000000-0000-0000-0000-000000000000",
      "TargetOpPart": "fd7038bc-0fc8-4d49-86d5-125f15da7f52"
    },
    {
      "SourceOp": "00000000-0000-0000-0000-000000000000",
      "SourceOpPart": "7f852638-d6cb-4a33-b616-32a2505daee0",
      "TargetOp": "00000000-0000-0000-0000-000000000000",
      "TargetOpPart": "fd7038bc-0fc8-4d49-86d5-125f15da7f52"
    },
    {
      "SourceOp": "00000000-0000-0000-0000-000000000000",
      "SourceOpPart": "0a4ac162-eaa4-4aa0-9bd4-a9583a86bb59",
      "TargetOp": "00000000-0000-0000-0000-000000000000",
      "TargetOpPart": "fd7038bc-0fc8-4d49-86d5-125f15da7f52"
    },
    {
      "SourceOp": "00000000-0000-0000-0000-000000000000",
      "SourceOpPart": "6ce39408-8537-4463-8120-55228e0e0f26",
      "TargetOp": "00000000-0000-0000-0000-000000000000",
      "TargetOpPart": "fd7038bc-0fc8-4d49-86d5-125f15da7f52"
    },
    {
      "SourceOp": "00000000-0000-0000-0000-000000000000",
      "SourceOpPart": "9505b3a7-cb1c-43f1-8f84-a731beeab29b",
      "TargetOp": "00000000-0000-0000-0000-000000000000",
      "TargetOpPart": "fd7038bc-0fc8-4d49-86d5-125f15da7f52"
    },
    {
      "SourceOp": "00000000-0000-0000-0000-000000000000",
      "SourceOpPart": "fee088c0-d531-47ad-b0af-4d48a1ade328",
      "TargetOp": "00000000-0000-0000-0000-000000000000",
      "TargetOpPart": "fd7038bc-0fc8-4d49-86d5-125f15da7f52"
    },
    {
      "SourceOp": "00000000-0000-0000-0000-000000000000",
      "SourceOpPart": "4f6514d7-bd3a-48fe-8976-70f71a718e25",
      "TargetOp": "00000000-0000-0000-0000-000000000000",
      "TargetOpPart": "fd7038bc-0fc8-4d49-86d5-125f15da7f52"
    },
    {
      "SourceOp": "00000000-0000-0000-0000-000000000000",
      "SourceOpPart": "c765937b-796f-4e66-86eb-fef5d8898a30",
      "TargetOp": "00000000-0000-0000-0000-000000000000",
      "TargetOpPart": "fd7038bc-0fc8-4d49-86d5-125f15da7f52"
    },
    {
      "SourceOp": "00000000-0000-0000-0000-000000000000",
      "SourceOpPart": "c507d670-f5d2-4276-9052-85e840484c07",
      "TargetOp": "00000000-0000-0000-0000-000000000000",
      "TargetOpPart": "fd7038bc-0fc8-4d49-86d5-125f15da7f52"
    },
    {
      "SourceOp": "00000000-0000-0000-0000-000000000000",
      "SourceOpPart": "7ce2c754-5c7b-4903-b82a-bdf87d503c9f",
      "TargetOp": "00000000-0000-0000-0000-000000000000",
      "TargetOpPart": "fd7038bc-0fc8-4d49-86d5-125f15da7f52"
    },
    {
      "SourceOp": "00000000-0000-0000-0000-000000000000",
      "SourceOpPart": "a5318180-2dd0-46f2-8725-9571a38c0190",
      "TargetOp": "00000000-0000-0000-0000-000000000000",
      "TargetOpPart": "fd7038bc-0fc8-4d49-86d5-125f15da7f52"
    },
    {
      "SourceOp": "00000000-0000-0000-0000-000000000000",
      "SourceOpPart": "c6d7a462-2ffc-4cb2-9298-ae6dff355c2b",
      "TargetOp": "00000000-0000-0000-0000-000000000000",
      "TargetOpPart": "fd7038bc-0fc8-4d49-86d5-125f15da7f52"
    },
    {
      "SourceOp": "00000000-0000-0000-0000-000000000000",
      "SourceOpPart": "d4381166-758a-488f-aedd-6b4bc26e441e",
      "TargetOp": "00000000-0000-0000-0000-000000000000",
      "TargetOpPart": "fd7038bc-0fc8-4d49-86d5-125f15da7f52"
    }
  ]
}