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

@ -20,9 +20,18 @@
// IN THE SOFTWARE.
//-----------------------------------------------------------------------------
float4 main( float4 color_in : COLOR0,
float2 texCoord_in : TEXCOORD0,
uniform sampler2D diffuseMap : register(S0) ) : COLOR0
#include "../shaderModel.hlsl"
struct Conn
{
return float4(color_in.rgb, color_in.a * tex2D(diffuseMap, texCoord_in).a);
float4 HPOS : TORQUE_POSITION;
float4 color : COLOR;
float2 texCoord : TEXCOORD0;
};
TORQUE_UNIFORM_SAMPLER2D(diffuseMap, 0);
float4 main( Conn IN ) : TORQUE_TARGET0
{
return float4(IN.color.rgb, IN.color.a * TORQUE_TEX2D(diffuseMap, IN.texCoord).a);
}

View file

@ -20,22 +20,28 @@
// IN THE SOFTWARE.
//-----------------------------------------------------------------------------
#include "../shaderModel.hlsl"
struct Appdata
{
float4 position : POSITION;
float3 position : POSITION;
float4 color : COLOR;
float2 texCoord : TEXCOORD0;
};
struct Conn
{
float4 HPOS : POSITION;
float4 HPOS : TORQUE_POSITION;
float4 color : COLOR;
float2 texCoord : TEXCOORD0;
};
Conn main( Appdata In, uniform float4x4 modelview : register(C0) )
uniform float4x4 modelview;
Conn main( Appdata In )
{
Conn Out;
Out.HPOS = mul(modelview, In.position);
Out.HPOS = mul(modelview, float4(In.position,1.0));
Out.color = In.color;
Out.texCoord = In.texCoord;
return Out;

View file

@ -20,7 +20,15 @@
// IN THE SOFTWARE.
//-----------------------------------------------------------------------------
float4 main( float4 color_in : COLOR0, uniform sampler2D diffuseMap : register(S0) ) : COLOR0
#include "../shaderModel.hlsl"
struct Conn
{
return color_in;
float4 HPOS : TORQUE_POSITION;
float4 color : COLOR;
};
float4 main(Conn IN) : TORQUE_TARGET0
{
return IN.color;
}

View file

@ -20,20 +20,26 @@
// IN THE SOFTWARE.
//-----------------------------------------------------------------------------
#include "../shaderModel.hlsl"
struct Appdata
{
float4 position : POSITION;
float3 position : POSITION;
float4 color : COLOR;
};
struct Conn
{
float4 HPOS : POSITION;
float4 HPOS : TORQUE_POSITION;
float4 color : COLOR;
};
Conn main( Appdata In, uniform float4x4 modelview : register(C0) )
uniform float4x4 modelview;
Conn main( Appdata In )
{
Conn Out;
Out.HPOS = mul(modelview, In.position);
Out.HPOS = mul(modelview, float4(In.position,1.0));
Out.color = In.color;
return Out;
}

View file

@ -20,9 +20,18 @@
// IN THE SOFTWARE.
//-----------------------------------------------------------------------------
float4 main( float4 color_in : COLOR0,
float2 texCoord_in : TEXCOORD0,
uniform sampler2D diffuseMap : register(S0) ) : COLOR0
#include "../shaderModel.hlsl"
struct Conn
{
return tex2D(diffuseMap, texCoord_in) * color_in;
float4 HPOS : TORQUE_POSITION;
float4 color : COLOR;
float2 texCoord : TEXCOORD0;
};
TORQUE_UNIFORM_SAMPLER2D(diffuseMap, 0);
float4 main( Conn IN ) : TORQUE_TARGET0
{
return TORQUE_TEX2D(diffuseMap, IN.texCoord) * IN.color;
}

View file

@ -20,22 +20,28 @@
// IN THE SOFTWARE.
//-----------------------------------------------------------------------------
#include "../shaderModel.hlsl"
struct Appdata
{
float4 position : POSITION;
float3 position : POSITION;
float4 color : COLOR;
float2 texCoord : TEXCOORD0;
};
struct Conn
{
float4 HPOS : POSITION;
float4 HPOS : TORQUE_POSITION;
float4 color : COLOR;
float2 texCoord : TEXCOORD0;
};
Conn main( Appdata In, uniform float4x4 modelview : register(C0) )
uniform float4x4 modelview;
Conn main( Appdata In )
{
Conn Out;
Out.HPOS = mul(modelview, In.position);
Out.HPOS = mul(modelview, float4(In.position,1.0));
Out.color = In.color;
Out.texCoord = In.texCoord;
return Out;

View file

@ -0,0 +1,36 @@
//-----------------------------------------------------------------------------
// 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.
//-----------------------------------------------------------------------------
#include "../shaderModel.hlsl"
TORQUE_UNIFORM_SAMPLER2D(diffuseMap, 0);
struct Conn
{
float4 hpos : TORQUE_POSITION;
float2 texCoord : TEXCOORD0;
};
float4 main(Conn IN) : TORQUE_TARGET0
{
return TORQUE_TEX2D(diffuseMap, IN.texCoord);
}

View file

@ -0,0 +1,46 @@
//-----------------------------------------------------------------------------
// 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.
//-----------------------------------------------------------------------------
#include "../shaderModel.hlsl"
struct Appdata
{
float3 position : POSITION;
float4 color : COLOR;
float2 texCoord : TEXCOORD0;
};
struct Conn
{
float4 hpos : TORQUE_POSITION;
float2 texCoord : TEXCOORD0;
};
uniform float4x4 modelview;
Conn main( Appdata In )
{
Conn Out;
Out.hpos = mul(modelview, float4(In.position, 1.0));
Out.texCoord = In.texCoord;
return Out;
}