Script integration for Ribbons

This commit is contained in:
LukasPJ 2014-09-18 21:49:25 +02:00
parent a8a141e73c
commit 35f88a77b1
21 changed files with 458 additions and 0 deletions

View file

@ -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;
}

View file

@ -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;
}

View file

@ -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);
}

View file

@ -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;
}