Browse Source

Merge pull request #1436 from Azaezel/ribbonShadersEmpty

Agreed, it makes sense that the shaders are common, so that people can start with empty and add their own art without worrying about stuff not working as expected.
Areloch 10 years ago
parent
commit
aba6cf2d9e

+ 20 - 0
Templates/Empty/game/shaders/common/ribbons/texRibbonShaderP.hlsl

@@ -0,0 +1,20 @@
+#define IN_HLSL
+#include "../shdrConsts.h"
+#include "../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);
+}

+ 34 - 0
Templates/Empty/game/shaders/common/ribbons/texRibbonShaderV.hlsl

@@ -0,0 +1,34 @@
+#define IN_HLSL
+#include "../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;
+}