Direct3D11 common shader changes.

This commit is contained in:
rextimmy 2016-03-20 21:50:21 +10:00
parent 1ff6f221fb
commit 3a9b50f702
283 changed files with 3547 additions and 1834 deletions

View file

@ -1,15 +1,16 @@
#define IN_HLSL
#include "../shdrConsts.h"
#include "../shaderModel.hlsl"
struct v2f
{
float4 hpos : TORQUE_POSITION;
float4 color : COLOR0;
float2 texCoord : TEXCOORD0;
float2 shiftdata : TEXCOORD1;
float4 color : COLOR0;
};
float4 main(v2f IN) : COLOR0
float4 main(v2f IN) : TORQUE_TARGET0
{
float fade = 1.0 - abs(IN.shiftdata.y - 0.5) * 2.0;
IN.color.xyz = IN.color.xyz + pow(fade, 4) / 10;

View file

@ -1,21 +1,22 @@
#define IN_HLSL
#include "../shdrConsts.h"
#include "../shaderModel.hlsl"
struct a2v
{
float2 texCoord : TEXCOORD0;
float2 shiftdata : TEXCOORD1;
float3 normal : NORMAL;
float4 position : POSITION;
float4 color : COLOR0;
float3 position : POSITION;
float3 normal : NORMAL;
float4 color : COLOR0;
float2 texCoord : TEXCOORD0;
float2 shiftdata : TEXCOORD1;
};
struct v2f
{
float4 hpos : POSITION;
float2 texCoord : TEXCOORD0;
float2 shiftdata : TEXCOORD1;
float4 color : COLOR0;
float4 hpos : TORQUE_POSITION;
float4 color : COLOR0;
float2 texCoord : TEXCOORD0;
float2 shiftdata : TEXCOORD1;
};
uniform float4x4 modelview;
@ -25,7 +26,7 @@ v2f main(a2v IN)
{
v2f OUT;
OUT.hpos = mul(modelview, IN.position);
OUT.hpos = mul(modelview, float4(IN.position, 1.0));
OUT.color = IN.color;
OUT.texCoord = IN.texCoord;
OUT.shiftdata = IN.shiftdata;

View file

@ -2,19 +2,20 @@
#include "../shdrConsts.h"
#include "../torque.hlsl"
uniform sampler2D ribTex : register(S0);
TORQUE_UNIFORM_SAMPLER2D(ribTex, 0);
struct v2f
{
float4 hpos : TORQUE_POSITION;
float4 color : COLOR0;
float2 texCoord : TEXCOORD0;
float2 shiftdata : TEXCOORD1;
float4 color : COLOR0;
};
float4 main(v2f IN) : COLOR0
float4 main(v2f IN) : TORQUE_TARGET0
{
float4 Tex = tex2D(ribTex,IN.texCoord);
float4 Tex = TORQUE_TEX2D(ribTex,IN.texCoord);
Tex.a *= IN.color.a;
return hdrEncode(Tex);
}

View file

@ -1,21 +1,22 @@
#define IN_HLSL
#include "../shdrConsts.h"
#include "../shaderModel.hlsl"
struct a2v
{
float2 texCoord : TEXCOORD0;
float2 shiftdata : TEXCOORD1;
float3 normal : NORMAL;
float4 position : POSITION;
float4 color : COLOR0;
float3 position : POSITION;
float4 color : COLOR0;
float3 normal : NORMAL;
float2 texCoord : TEXCOORD0;
float2 shiftdata : TEXCOORD1;
};
struct v2f
{
float4 hpos : POSITION;
float2 texCoord : TEXCOORD0;
float2 shiftdata : TEXCOORD1;
float4 color : COLOR0;
float4 hpos : TORQUE_POSITION;
float4 color : COLOR0;
float2 texCoord : TEXCOORD0;
float2 shiftdata : TEXCOORD1;
};
uniform float4x4 modelview;
@ -25,7 +26,7 @@ v2f main(a2v IN)
{
v2f OUT;
OUT.hpos = mul(modelview, IN.position);
OUT.hpos = mul(modelview, float4(IN.position,1.0));
OUT.color = IN.color;
OUT.texCoord = IN.texCoord;
OUT.shiftdata = IN.shiftdata;