diff --git a/Templates/Empty/game/art/ribbons/materials.cs b/Templates/Empty/game/art/ribbons/materials.cs new file mode 100644 index 000000000..a8ee7b19c --- /dev/null +++ b/Templates/Empty/game/art/ribbons/materials.cs @@ -0,0 +1,48 @@ +//----------------------------------------------------------------------------- +// Copyright (c) 2012 GarageGames, LLC +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to +// deal in the Software without restriction, including without limitation the +// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +// sell copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +// IN THE SOFTWARE. +//----------------------------------------------------------------------------- + +// This material should work fine for uniformly colored ribbons. + +//Basic ribbon shader///////////////////////////////////////////// + +new ShaderData( basicRibbonShader ) +{ + DXVertexShaderFile = "shaders/common/ribbons/basicRibbonShaderV.hlsl"; + DXPixelShaderFile = "shaders/common/ribbons/basicRibbonShaderP.hlsl"; + + pixVersion = 2.0; +}; + +singleton CustomMaterial( basicRibbonMat ) +{ + shader = basicRibbonShader; + version = 2.0; + + emissive[0] = true; + + doubleSided = true; + translucent = true; + BlendOp = AddAlpha; + translucentBlendOp = AddAlpha; + + preload = true; +}; \ No newline at end of file diff --git a/Templates/Empty/game/art/ribbons/ribbonExec.cs b/Templates/Empty/game/art/ribbons/ribbonExec.cs new file mode 100644 index 000000000..8193b1b8b --- /dev/null +++ b/Templates/Empty/game/art/ribbons/ribbonExec.cs @@ -0,0 +1,23 @@ +//----------------------------------------------------------------------------- +// Copyright (c) 2012 GarageGames, LLC +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to +// deal in the Software without restriction, including without limitation the +// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +// sell copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +// IN THE SOFTWARE. +//----------------------------------------------------------------------------- + +exec("./ribbons.cs"); \ No newline at end of file diff --git a/Templates/Empty/game/art/ribbons/ribbons.cs b/Templates/Empty/game/art/ribbons/ribbons.cs new file mode 100644 index 000000000..ce65e6fe8 --- /dev/null +++ b/Templates/Empty/game/art/ribbons/ribbons.cs @@ -0,0 +1,44 @@ +//----------------------------------------------------------------------------- +// Copyright (c) 2012 GarageGames, LLC +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to +// deal in the Software without restriction, including without limitation the +// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +// sell copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +// IN THE SOFTWARE. +//----------------------------------------------------------------------------- + +datablock RibbonNodeData(DefaultRibbonNodeData) +{ + timeMultiple = 1.0; +}; + +//ribbon data//////////////////////////////////////// + +datablock RibbonData(basicRibbon) +{ + size[0] = 0.5; + color[0] = "1.0 0.0 0.0 1.0"; + position[0] = 0.0; + + size[1] = 0.0; + color[1] = "1.0 0.0 0.0 0.0"; + position[1] = 1.0; + + RibbonLength = 40; + fadeAwayStep = 0.1; + UseFadeOut = true; + RibbonMaterial = basicRibbonMat; +}; \ No newline at end of file diff --git a/Templates/Empty/game/core/scripts/server/game.cs b/Templates/Empty/game/core/scripts/server/game.cs index d80dd4468..c135e6f99 100644 --- a/Templates/Empty/game/core/scripts/server/game.cs +++ b/Templates/Empty/game/core/scripts/server/game.cs @@ -34,6 +34,7 @@ function onServerCreated() // Load up any objects or datablocks saved to the editor managed scripts %datablockFiles = new ArrayObject(); + %datablockFiles.add( "art/ribbons/ribbonExec.cs" ); %datablockFiles.add( "art/particles/managedParticleData.cs" ); %datablockFiles.add( "art/particles/managedParticleEmitterData.cs" ); %datablockFiles.add( "art/decals/managedDecalData.cs" ); diff --git a/Templates/Empty/game/scripts/server/game.cs b/Templates/Empty/game/scripts/server/game.cs index 4826c0de2..d9529ca01 100644 --- a/Templates/Empty/game/scripts/server/game.cs +++ b/Templates/Empty/game/scripts/server/game.cs @@ -144,6 +144,7 @@ function onServerCreated() // Load up any objects or datablocks saved to the editor managed scripts %datablockFiles = new ArrayObject(); + %datablockFiles.add( "art/ribbons/ribbonExec.cs" ); %datablockFiles.add( "art/particles/managedParticleData.cs" ); %datablockFiles.add( "art/particles/managedParticleEmitterData.cs" ); %datablockFiles.add( "art/decals/managedDecalData.cs" ); diff --git a/Templates/Empty/game/shaders/common/ribbons/basicRibbonShaderP.hlsl b/Templates/Empty/game/shaders/common/ribbons/basicRibbonShaderP.hlsl new file mode 100644 index 000000000..7ce54e3aa --- /dev/null +++ b/Templates/Empty/game/shaders/common/ribbons/basicRibbonShaderP.hlsl @@ -0,0 +1,18 @@ +#define IN_HLSL +#include "../common/shdrConsts.h" + +struct v2f +{ + + float2 texCoord : TEXCOORD0; + float2 shiftdata : TEXCOORD1; + float4 color : COLOR0; +}; + +float4 main(v2f IN) : COLOR0 +{ + float fade = 1.0 - abs(IN.shiftdata.y - 0.5) * 2.0; + IN.color.xyz = IN.color.xyz + pow(fade, 4) / 10; + IN.color.a = IN.color.a * fade; + return IN.color; +} \ No newline at end of file diff --git a/Templates/Empty/game/shaders/common/ribbons/basicRibbonShaderV.hlsl b/Templates/Empty/game/shaders/common/ribbons/basicRibbonShaderV.hlsl new file mode 100644 index 000000000..5fd4ecbc0 --- /dev/null +++ b/Templates/Empty/game/shaders/common/ribbons/basicRibbonShaderV.hlsl @@ -0,0 +1,34 @@ +#define IN_HLSL +#include "../common/shdrConsts.h" + +struct a2v +{ + float2 texCoord : TEXCOORD0; + float2 shiftdata : TEXCOORD1; + float3 normal : NORMAL; + float4 position : POSITION; + float4 color : COLOR0; +}; + +struct v2f +{ + float4 hpos : POSITION; + float2 texCoord : TEXCOORD0; + float2 shiftdata : TEXCOORD1; + float4 color : COLOR0; +}; + +uniform float4x4 modelview; +uniform float3 eyePos; + +v2f main(a2v IN) +{ + v2f OUT; + + OUT.hpos = mul(modelview, IN.position); + OUT.color = IN.color; + OUT.texCoord = IN.texCoord; + OUT.shiftdata = IN.shiftdata; + + return OUT; +} \ No newline at end of file diff --git a/Templates/Empty/game/tools/worldEditor/gui/objectBuilderGui.ed.gui b/Templates/Empty/game/tools/worldEditor/gui/objectBuilderGui.ed.gui index 19c396a57..33cb5de75 100644 --- a/Templates/Empty/game/tools/worldEditor/gui/objectBuilderGui.ed.gui +++ b/Templates/Empty/game/tools/worldEditor/gui/objectBuilderGui.ed.gui @@ -862,6 +862,14 @@ function ObjectBuilderGui::buildParticleEmitterNode(%this) %this.process(); } +function ObjectBuilderGui::buildRibbonNode(%this) +{ + %this.objectClassName = "RibbonNode"; + %this.addField("dataBlock", "TypeDataBlock", "datablock", "RibbonNodeData"); + %this.addField("ribbon", "TypeDataBlock", "Ribbon data", "RibbonData"); + %this.process(); +} + function ObjectBuilderGui::buildParticleSimulation(%this) { %this.objectClassName = "ParticleSimulation"; diff --git a/Templates/Empty/game/tools/worldEditor/scripts/editors/creator.ed.cs b/Templates/Empty/game/tools/worldEditor/scripts/editors/creator.ed.cs index d63542d67..75d41eb53 100644 --- a/Templates/Empty/game/tools/worldEditor/scripts/editors/creator.ed.cs +++ b/Templates/Empty/game/tools/worldEditor/scripts/editors/creator.ed.cs @@ -46,6 +46,7 @@ function EWCreatorWindow::init( %this ) %this.registerMissionObject( "SFXEmitter", "Sound Emitter" ); %this.registerMissionObject( "Precipitation" ); %this.registerMissionObject( "ParticleEmitterNode", "Particle Emitter" ); + %this.registerMissionObject( "RibbonNode", "Ribbon" ); // Legacy features. Users should use Ground Cover and the Forest Editor. //%this.registerMissionObject( "fxShapeReplicator", "Shape Replicator" ); diff --git a/Templates/Full/game/art/ribbons/materials.cs b/Templates/Full/game/art/ribbons/materials.cs new file mode 100644 index 000000000..f9115356f --- /dev/null +++ b/Templates/Full/game/art/ribbons/materials.cs @@ -0,0 +1,77 @@ +//----------------------------------------------------------------------------- +// Copyright (c) 2012 GarageGames, LLC +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to +// deal in the Software without restriction, including without limitation the +// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +// sell copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +// IN THE SOFTWARE. +//----------------------------------------------------------------------------- + +// This material should work fine for uniformly colored ribbons. + +//Basic ribbon shader///////////////////////////////////////////// + +new ShaderData( basicRibbonShader ) +{ + DXVertexShaderFile = "shaders/common/ribbons/basicRibbonShaderV.hlsl"; + DXPixelShaderFile = "shaders/common/ribbons/basicRibbonShaderP.hlsl"; + + pixVersion = 2.0; +}; + +singleton CustomMaterial( basicRibbonMat ) +{ + shader = basicRibbonShader; + version = 2.0; + + emissive[0] = true; + + doubleSided = true; + translucent = true; + BlendOp = AddAlpha; + translucentBlendOp = AddAlpha; + + preload = true; +}; + +// This material can render a texture on top of a ribbon. + +//Texture ribbon shader///////////////////////////////////////////// + +new ShaderData( texRibbonShader ) +{ + DXVertexShaderFile = "shaders/common/ribbons/texRibbonShaderV.hlsl"; + DXPixelShaderFile = "shaders/common/ribbons/texRibbonShaderP.hlsl"; + + pixVersion = 2.0; +}; + +singleton CustomMaterial( texRibbonMat ) +{ + shader = texRibbonShader; + version = 2.0; + + emissive[0] = true; + + doubleSided = true; + translucent = true; + BlendOp = AddAlpha; + translucentBlendOp = AddAlpha; + + sampler["ribTex"] = "art/ribbons/ribTex.png"; + + preload = true; +}; \ No newline at end of file diff --git a/Templates/Full/game/art/ribbons/ribTex.png b/Templates/Full/game/art/ribbons/ribTex.png new file mode 100644 index 000000000..82dffb96a Binary files /dev/null and b/Templates/Full/game/art/ribbons/ribTex.png differ diff --git a/Templates/Full/game/art/ribbons/ribbonExec.cs b/Templates/Full/game/art/ribbons/ribbonExec.cs new file mode 100644 index 000000000..8193b1b8b --- /dev/null +++ b/Templates/Full/game/art/ribbons/ribbonExec.cs @@ -0,0 +1,23 @@ +//----------------------------------------------------------------------------- +// Copyright (c) 2012 GarageGames, LLC +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to +// deal in the Software without restriction, including without limitation the +// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +// sell copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +// IN THE SOFTWARE. +//----------------------------------------------------------------------------- + +exec("./ribbons.cs"); \ No newline at end of file diff --git a/Templates/Full/game/art/ribbons/ribbons.cs b/Templates/Full/game/art/ribbons/ribbons.cs new file mode 100644 index 000000000..aef6204e4 --- /dev/null +++ b/Templates/Full/game/art/ribbons/ribbons.cs @@ -0,0 +1,63 @@ +//----------------------------------------------------------------------------- +// Copyright (c) 2012 GarageGames, LLC +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to +// deal in the Software without restriction, including without limitation the +// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +// sell copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +// IN THE SOFTWARE. +//----------------------------------------------------------------------------- + +datablock RibbonNodeData(DefaultRibbonNodeData) +{ + timeMultiple = 1.0; +}; + +//ribbon data//////////////////////////////////////// + +datablock RibbonData(basicRibbon) +{ + size[0] = 0.5; + color[0] = "1.0 0.0 0.0 1.0"; + position[0] = 0.0; + + size[1] = 0.0; + color[1] = "1.0 0.0 0.0 0.0"; + position[1] = 1.0; + + RibbonLength = 40; + fadeAwayStep = 0.1; + UseFadeOut = true; + RibbonMaterial = basicRibbonMat; +}; + +datablock RibbonData(texRibbon) +{ + RibbonMaterial = texRibbonMat; + size[0] = 0.5; + color[0] = "1.0 1.0 1.0 1.0"; + position[0] = 0.0; + + size[1] = 0.5; + color[1] = "1.0 1.0 1.0 1.0"; + position[1] = 1.0; + + RibbonLength = 40; + fadeAwayStep = 0.1; + UseFadeOut = true; + tileScale = 1; + fixedTexCoords = true; + TexcoordsRelativeToDistance = true; +}; \ No newline at end of file diff --git a/Templates/Full/game/core/scripts/server/game.cs b/Templates/Full/game/core/scripts/server/game.cs index d80dd4468..c135e6f99 100644 --- a/Templates/Full/game/core/scripts/server/game.cs +++ b/Templates/Full/game/core/scripts/server/game.cs @@ -34,6 +34,7 @@ function onServerCreated() // Load up any objects or datablocks saved to the editor managed scripts %datablockFiles = new ArrayObject(); + %datablockFiles.add( "art/ribbons/ribbonExec.cs" ); %datablockFiles.add( "art/particles/managedParticleData.cs" ); %datablockFiles.add( "art/particles/managedParticleEmitterData.cs" ); %datablockFiles.add( "art/decals/managedDecalData.cs" ); diff --git a/Templates/Full/game/scripts/server/game.cs b/Templates/Full/game/scripts/server/game.cs index ace3ac2f8..42d329cd2 100644 --- a/Templates/Full/game/scripts/server/game.cs +++ b/Templates/Full/game/scripts/server/game.cs @@ -50,6 +50,7 @@ function onServerCreated() // Load up any objects or datablocks saved to the editor managed scripts %datablockFiles = new ArrayObject(); + %datablockFiles.add( "art/ribbons/ribbonExec.cs" ); %datablockFiles.add( "art/particles/managedParticleData.cs" ); %datablockFiles.add( "art/particles/managedParticleEmitterData.cs" ); %datablockFiles.add( "art/decals/managedDecalData.cs" ); diff --git a/Templates/Full/game/shaders/common/ribbons/basicRibbonShaderP.hlsl b/Templates/Full/game/shaders/common/ribbons/basicRibbonShaderP.hlsl new file mode 100644 index 000000000..7ce54e3aa --- /dev/null +++ b/Templates/Full/game/shaders/common/ribbons/basicRibbonShaderP.hlsl @@ -0,0 +1,18 @@ +#define IN_HLSL +#include "../common/shdrConsts.h" + +struct v2f +{ + + float2 texCoord : TEXCOORD0; + float2 shiftdata : TEXCOORD1; + float4 color : COLOR0; +}; + +float4 main(v2f IN) : COLOR0 +{ + float fade = 1.0 - abs(IN.shiftdata.y - 0.5) * 2.0; + IN.color.xyz = IN.color.xyz + pow(fade, 4) / 10; + IN.color.a = IN.color.a * fade; + return IN.color; +} \ No newline at end of file diff --git a/Templates/Full/game/shaders/common/ribbons/basicRibbonShaderV.hlsl b/Templates/Full/game/shaders/common/ribbons/basicRibbonShaderV.hlsl new file mode 100644 index 000000000..5fd4ecbc0 --- /dev/null +++ b/Templates/Full/game/shaders/common/ribbons/basicRibbonShaderV.hlsl @@ -0,0 +1,34 @@ +#define IN_HLSL +#include "../common/shdrConsts.h" + +struct a2v +{ + float2 texCoord : TEXCOORD0; + float2 shiftdata : TEXCOORD1; + float3 normal : NORMAL; + float4 position : POSITION; + float4 color : COLOR0; +}; + +struct v2f +{ + float4 hpos : POSITION; + float2 texCoord : TEXCOORD0; + float2 shiftdata : TEXCOORD1; + float4 color : COLOR0; +}; + +uniform float4x4 modelview; +uniform float3 eyePos; + +v2f main(a2v IN) +{ + v2f OUT; + + OUT.hpos = mul(modelview, IN.position); + OUT.color = IN.color; + OUT.texCoord = IN.texCoord; + OUT.shiftdata = IN.shiftdata; + + return OUT; +} \ No newline at end of file diff --git a/Templates/Full/game/shaders/common/ribbons/texRibbonShaderP.hlsl b/Templates/Full/game/shaders/common/ribbons/texRibbonShaderP.hlsl new file mode 100644 index 000000000..a93c6162b --- /dev/null +++ b/Templates/Full/game/shaders/common/ribbons/texRibbonShaderP.hlsl @@ -0,0 +1,20 @@ +#define IN_HLSL +#include "../common/shdrConsts.h" +#include "shaders/common/torque.hlsl" + +uniform sampler2D ribTex : register(S0); + +struct v2f +{ + + float2 texCoord : TEXCOORD0; + float2 shiftdata : TEXCOORD1; + float4 color : COLOR0; +}; + +float4 main(v2f IN) : COLOR0 +{ + float4 Tex = tex2D(ribTex,IN.texCoord); + Tex.a *= IN.color.a; + return hdrEncode(Tex); +} \ No newline at end of file diff --git a/Templates/Full/game/shaders/common/ribbons/texRibbonShaderV.hlsl b/Templates/Full/game/shaders/common/ribbons/texRibbonShaderV.hlsl new file mode 100644 index 000000000..5fd4ecbc0 --- /dev/null +++ b/Templates/Full/game/shaders/common/ribbons/texRibbonShaderV.hlsl @@ -0,0 +1,34 @@ +#define IN_HLSL +#include "../common/shdrConsts.h" + +struct a2v +{ + float2 texCoord : TEXCOORD0; + float2 shiftdata : TEXCOORD1; + float3 normal : NORMAL; + float4 position : POSITION; + float4 color : COLOR0; +}; + +struct v2f +{ + float4 hpos : POSITION; + float2 texCoord : TEXCOORD0; + float2 shiftdata : TEXCOORD1; + float4 color : COLOR0; +}; + +uniform float4x4 modelview; +uniform float3 eyePos; + +v2f main(a2v IN) +{ + v2f OUT; + + OUT.hpos = mul(modelview, IN.position); + OUT.color = IN.color; + OUT.texCoord = IN.texCoord; + OUT.shiftdata = IN.shiftdata; + + return OUT; +} \ No newline at end of file diff --git a/Templates/Full/game/tools/worldEditor/gui/objectBuilderGui.ed.gui b/Templates/Full/game/tools/worldEditor/gui/objectBuilderGui.ed.gui index 19c396a57..33cb5de75 100644 --- a/Templates/Full/game/tools/worldEditor/gui/objectBuilderGui.ed.gui +++ b/Templates/Full/game/tools/worldEditor/gui/objectBuilderGui.ed.gui @@ -862,6 +862,14 @@ function ObjectBuilderGui::buildParticleEmitterNode(%this) %this.process(); } +function ObjectBuilderGui::buildRibbonNode(%this) +{ + %this.objectClassName = "RibbonNode"; + %this.addField("dataBlock", "TypeDataBlock", "datablock", "RibbonNodeData"); + %this.addField("ribbon", "TypeDataBlock", "Ribbon data", "RibbonData"); + %this.process(); +} + function ObjectBuilderGui::buildParticleSimulation(%this) { %this.objectClassName = "ParticleSimulation"; diff --git a/Templates/Full/game/tools/worldEditor/scripts/editors/creator.ed.cs b/Templates/Full/game/tools/worldEditor/scripts/editors/creator.ed.cs index d63542d67..75d41eb53 100644 --- a/Templates/Full/game/tools/worldEditor/scripts/editors/creator.ed.cs +++ b/Templates/Full/game/tools/worldEditor/scripts/editors/creator.ed.cs @@ -46,6 +46,7 @@ function EWCreatorWindow::init( %this ) %this.registerMissionObject( "SFXEmitter", "Sound Emitter" ); %this.registerMissionObject( "Precipitation" ); %this.registerMissionObject( "ParticleEmitterNode", "Particle Emitter" ); + %this.registerMissionObject( "RibbonNode", "Ribbon" ); // Legacy features. Users should use Ground Cover and the Forest Editor. //%this.registerMissionObject( "fxShapeReplicator", "Shape Replicator" );