update
This commit is contained in:
@@ -12,7 +12,7 @@ struct VertextoPixel
|
||||
|
||||
float main(VertextoPixel PSIn) : SV_DEPTH
|
||||
{
|
||||
[branch]if(g_xMat_hasTex)
|
||||
clip( xTextureTex.Sample(sampler_linear_wrap,PSIn.tex).a<0.1?-1:1 );
|
||||
[branch]if (g_xMat_hasTex)
|
||||
ALPHATEST(xTextureTex.Sample(sampler_linear_wrap,PSIn.tex).a);
|
||||
return distance(PSIn.pos3D.xyz,lightPos.xyz)/lightEnerdis.y;
|
||||
}
|
||||
@@ -66,7 +66,7 @@ PixelOutputType main(VertexToPixel PSIn)
|
||||
edgeBlend = abs(edgeBlend);
|
||||
Out.col.a *= 1 - pow(max(max(edgeBlend.x, edgeBlend.y), edgeBlend.z), 8);
|
||||
//Out.col.a *= pow(saturate(-dot(normal,front)), 4);
|
||||
clip( Out.col.a<0.05?-1:1 );
|
||||
ALPHATEST(Out.col.a)
|
||||
if(hasTexNor & 0x0000010)
|
||||
Out.nor.a=Out.col.a;
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ PixelOutputType main(PixelInputType PSIn)
|
||||
}
|
||||
baseColor.rgb *= PSIn.instanceColor;
|
||||
|
||||
clip( baseColor.a - 0.1f );
|
||||
ALPHATEST(baseColor.a)
|
||||
|
||||
if(depth){
|
||||
|
||||
|
||||
@@ -6,19 +6,12 @@
|
||||
float4 main(PixelInputType PSIn) : SV_TARGET
|
||||
{
|
||||
float4 baseColor = float4(0,0,0,0);
|
||||
//uint mat = PSIn.mat;
|
||||
|
||||
//if(mat == matIndex){
|
||||
if(g_xMat_hasTex) {
|
||||
baseColor = xTextureTex.Sample(sampler_aniso_wrap,PSIn.tex);
|
||||
/*else if(mat==1) baseColor = xTextureTex1.Sample(texSampler,PSIn.tex);
|
||||
else if(mat==2) baseColor = xTextureTex2.Sample(texSampler,PSIn.tex);
|
||||
else if(mat==3) baseColor = xTextureTex3.Sample(texSampler,PSIn.tex);*/
|
||||
}
|
||||
if(g_xMat_hasTex) {
|
||||
baseColor = xTextureTex.Sample(sampler_aniso_wrap,PSIn.tex);
|
||||
}
|
||||
|
||||
clip( baseColor.a < 0.1f ? -1:1 );
|
||||
//}
|
||||
//else discard;
|
||||
ALPHATEST(baseColor.a)
|
||||
|
||||
return float4(baseColor.rgb*0,1);
|
||||
return float4(0, 0, 0, 1);
|
||||
}
|
||||
@@ -24,7 +24,7 @@ float4 main(PixelInputType PSIn) : SV_TARGET
|
||||
}
|
||||
baseColor.rgb *= PSIn.instanceColor;
|
||||
|
||||
clip(baseColor.a < 0.1f ? -1 : 1);
|
||||
ALPHATEST(baseColor.a)
|
||||
|
||||
if (!g_xMat_shadeless.x)
|
||||
{
|
||||
|
||||
@@ -12,22 +12,13 @@ float4 main(PixelInputType PSIn) : SV_TARGET
|
||||
PSIn.tex *= g_xMat_texMulAdd.xy;
|
||||
PSIn.tex += g_xMat_texMulAdd.zw;
|
||||
|
||||
//if(PSIn.mat==matIndex){
|
||||
if(g_xMat_hasTex) {
|
||||
baseColor *= xTextureTex.Sample(sampler_aniso_wrap,PSIn.tex);
|
||||
}
|
||||
baseColor.rgb *= PSIn.instanceColor;
|
||||
//baseColor=pow(baseColor,GAMMA);
|
||||
if(g_xMat_hasTex) {
|
||||
baseColor *= xTextureTex.Sample(sampler_aniso_wrap,PSIn.tex);
|
||||
}
|
||||
baseColor.rgb *= PSIn.instanceColor;
|
||||
|
||||
clip( baseColor.a < 0.1f ? -1:1 );
|
||||
ALPHATEST(baseColor.a)
|
||||
|
||||
//float light = saturate( dot(xSun,normalize(PSIn.nor)) );
|
||||
//if(toonshaded) toon(light);
|
||||
//light=clamp(light,xAmbient,1);
|
||||
//if(!shadeless.x) baseColor.rgb*=light*xSunColor;
|
||||
//baseColor=pow(baseColor,INV_GAMMA);
|
||||
//}
|
||||
//else discard;
|
||||
|
||||
return baseColor*(1 + g_xMat_emissive);
|
||||
}
|
||||
|
||||
@@ -19,11 +19,10 @@ float4 main( PixelInputType PSIn) : SV_TARGET
|
||||
|
||||
[branch]if(g_xMat_hasTex){
|
||||
baseColor *= xTextureTex.Sample(sampler_aniso_wrap, PSIn.tex);
|
||||
//baseColor*=baseColor.a;
|
||||
}
|
||||
baseColor.rgb *= PSIn.instanceColor;
|
||||
//baseColor.a=1;
|
||||
clip( baseColor.a < 0.1f ? -1:1 );
|
||||
|
||||
ALPHATEST(baseColor.a)
|
||||
|
||||
float3 eyevector = normalize(g_xCamera_CamPos - PSIn.pos3D);
|
||||
float2 screenPos;
|
||||
@@ -75,10 +74,6 @@ float4 main( PixelInputType PSIn) : SV_TARGET
|
||||
if(g_xMat_hasSpe && !g_xMat_shadeless){
|
||||
spec = xTextureSpe.Sample(sampler_aniso_wrap, PSIn.tex);
|
||||
}
|
||||
/*float3 reflectionVector = reflect(xSun, normal);
|
||||
float specR = dot(normalize(reflectionVector), eyevector);
|
||||
specR = pow(saturate(-specR), specular_power)*spec.w;
|
||||
baseColor.rgb += saturate(xSunColor.rgb * specR);*/
|
||||
[branch]if(!g_xMat_shadeless.x){
|
||||
baseColor.rgb*=clamp( saturate( abs(dot(g_xWorld_SunDir.xyz,PSIn.nor)) * g_xWorld_SunColor.rgb ), g_xWorld_Ambient.rgb,1 );
|
||||
applySpecular(baseColor, g_xWorld_SunColor, normal, eyevector, g_xWorld_SunDir.xyz, 1, g_xMat_specular_power, spec.w, 0);
|
||||
@@ -87,11 +82,6 @@ float4 main( PixelInputType PSIn) : SV_TARGET
|
||||
baseColor.rgb = pow(abs(baseColor.rgb*(1 + g_xMat_emissive)), INV_GAMMA);
|
||||
|
||||
baseColor.rgb = applyFog(baseColor.rgb,getFog(getLinearDepth(depth/PSIn.pos2D.w)));
|
||||
|
||||
//Out.col = saturate(baseColor);
|
||||
//Out.nor = float4((normal),1);
|
||||
//Out.spe = saturate(spec);
|
||||
//Out.vel = float4(PSIn.vel*float3(-1,1,1),1);
|
||||
|
||||
return baseColor;
|
||||
}
|
||||
@@ -21,7 +21,7 @@ float4 main(PSIn input) : SV_TARGET
|
||||
//lighting = saturate(dot(input.nor.xyz, g_xDirLight_direction.xyz));
|
||||
//baseColor.rgb *= lighting;
|
||||
|
||||
clip(baseColor.a < 0.1f ? -1 : 1);
|
||||
ALPHATEST(baseColor.a)
|
||||
|
||||
return baseColor*(1 + g_xMat_emissive);
|
||||
}
|
||||
@@ -93,4 +93,6 @@ CBUFFER(APICB, CBSLOT_API)
|
||||
};
|
||||
|
||||
|
||||
#define ALPHATEST(x) clip((x)-0.1);
|
||||
|
||||
#endif // _SHADERDEF_CONSTANTBUFFERS_
|
||||
@@ -15,7 +15,7 @@ PS_OUT main(QGS_OUT PSIn)
|
||||
|
||||
PS_OUT Out = (PS_OUT)0;
|
||||
float4 col = xTexture.Sample(sampler_linear_clamp,PSIn.tex);
|
||||
clip( col.a < 0.1 ? -1:1 );
|
||||
ALPHATEST(col.a)
|
||||
Out.col = float4(col.rgb,1);
|
||||
Out.nor = float4(PSIn.nor,0);
|
||||
Out.vel = float4(vel,0,0);
|
||||
|
||||
@@ -10,6 +10,6 @@ struct VertextoPixel
|
||||
|
||||
void main(VertextoPixel PSIn)
|
||||
{
|
||||
[branch]if(g_xMat_hasTex)
|
||||
clip( xTextureTex.Sample(sampler_linear_wrap,PSIn.tex).a<0.1?-1:1 );
|
||||
[branch]if (g_xMat_hasTex)
|
||||
ALPHATEST(xTextureTex.Sample(sampler_linear_wrap, PSIn.tex).a);
|
||||
}
|
||||
Reference in New Issue
Block a user