|
@@ -12,6 +12,9 @@ void VS(float4 iPos : POSITION,
|
|
|
#ifndef NOUV
|
|
#ifndef NOUV
|
|
|
float2 iTexCoord : TEXCOORD0,
|
|
float2 iTexCoord : TEXCOORD0,
|
|
|
#endif
|
|
#endif
|
|
|
|
|
+ #ifdef VERTEXCOLOR
|
|
|
|
|
+ float4 iColor : COLOR0,
|
|
|
|
|
+ #endif
|
|
|
#if defined(LIGHTMAP) || defined(AO)
|
|
#if defined(LIGHTMAP) || defined(AO)
|
|
|
float2 iTexCoord2 : TEXCOORD1,
|
|
float2 iTexCoord2 : TEXCOORD1,
|
|
|
#endif
|
|
#endif
|
|
@@ -56,6 +59,9 @@ void VS(float4 iPos : POSITION,
|
|
|
out float2 oTexCoord2 : TEXCOORD7,
|
|
out float2 oTexCoord2 : TEXCOORD7,
|
|
|
#endif
|
|
#endif
|
|
|
#endif
|
|
#endif
|
|
|
|
|
+ #ifdef VERTEXCOLOR
|
|
|
|
|
+ out float4 oColor : COLOR0,
|
|
|
|
|
+ #endif
|
|
|
#if defined(D3D11) && defined(CLIPPLANE)
|
|
#if defined(D3D11) && defined(CLIPPLANE)
|
|
|
out float oClip : SV_CLIPDISTANCE0,
|
|
out float oClip : SV_CLIPDISTANCE0,
|
|
|
#endif
|
|
#endif
|
|
@@ -76,6 +82,10 @@ void VS(float4 iPos : POSITION,
|
|
|
oClip = dot(oPos, cClipPlane);
|
|
oClip = dot(oPos, cClipPlane);
|
|
|
#endif
|
|
#endif
|
|
|
|
|
|
|
|
|
|
+ #ifdef VERTEXCOLOR
|
|
|
|
|
+ oColor = iColor;
|
|
|
|
|
+ #endif
|
|
|
|
|
+
|
|
|
#ifdef NORMALMAP
|
|
#ifdef NORMALMAP
|
|
|
float3 tangent = GetWorldTangent(modelMatrix);
|
|
float3 tangent = GetWorldTangent(modelMatrix);
|
|
|
float3 bitangent = cross(tangent, oNormal) * iTangent.w;
|
|
float3 bitangent = cross(tangent, oNormal) * iTangent.w;
|
|
@@ -155,6 +165,9 @@ void PS(
|
|
|
float2 iTexCoord2 : TEXCOORD7,
|
|
float2 iTexCoord2 : TEXCOORD7,
|
|
|
#endif
|
|
#endif
|
|
|
#endif
|
|
#endif
|
|
|
|
|
+ #ifdef VERTEXCOLOR
|
|
|
|
|
+ float4 iColor : COLOR0,
|
|
|
|
|
+ #endif
|
|
|
#if defined(D3D11) && defined(CLIPPLANE)
|
|
#if defined(D3D11) && defined(CLIPPLANE)
|
|
|
float iClip : SV_CLIPDISTANCE0,
|
|
float iClip : SV_CLIPDISTANCE0,
|
|
|
#endif
|
|
#endif
|
|
@@ -180,6 +193,10 @@ void PS(
|
|
|
float4 diffColor = cMatDiffColor;
|
|
float4 diffColor = cMatDiffColor;
|
|
|
#endif
|
|
#endif
|
|
|
|
|
|
|
|
|
|
+ #ifdef VERTEXCOLOR
|
|
|
|
|
+ diffColor *= iColor;
|
|
|
|
|
+ #endif
|
|
|
|
|
+
|
|
|
// Get material specular albedo
|
|
// Get material specular albedo
|
|
|
#ifdef SPECMAP
|
|
#ifdef SPECMAP
|
|
|
float3 specColor = cMatSpecColor.rgb * Sample2D(SpecMap, iTexCoord.xy).rgb;
|
|
float3 specColor = cMatSpecColor.rgb * Sample2D(SpecMap, iTexCoord.xy).rgb;
|