mirror of
https://mirror.ghproxy.com/https://github.com/dexyfex/CodeWalker
synced 2026-05-16 21:14:43 +08:00
Weapon rendering improvements
This commit is contained in:
@@ -637,6 +637,7 @@ namespace CodeWalker.Rendering
|
||||
detltex = itex;
|
||||
break;
|
||||
case ShaderParamNames.TintPaletteSampler:
|
||||
case ShaderParamNames.TextureSamplerDiffPal:
|
||||
tintpal = itex;
|
||||
if (tintpal.Key != null)
|
||||
{
|
||||
@@ -649,6 +650,7 @@ namespace CodeWalker.Rendering
|
||||
isdistmap = true;
|
||||
break;
|
||||
case ShaderParamNames.DiffuseSampler2:
|
||||
case ShaderParamNames.DiffuseExtraSampler:
|
||||
texture2 = itex;
|
||||
break;
|
||||
case ShaderParamNames.heightSampler:
|
||||
@@ -710,6 +712,14 @@ namespace CodeWalker.Rendering
|
||||
case 1229591973://{trees_normal_spec_tnt.sps}
|
||||
if (usetint) tintflag = 2; //use 2nd vertex colour channel for tint...
|
||||
break;
|
||||
case 3267631682: //weapon_normal_spec_detail_tnt.sps
|
||||
case 14185869: //weapon_normal_spec_tnt.sps
|
||||
break; //regular tinting?
|
||||
case 231364109: //weapon_normal_spec_cutout_palette.sps
|
||||
case 3294641629://weapon_normal_spec_detail_palette.sps
|
||||
case 731050667: //weapon_normal_spec_palette.sps
|
||||
if (usetint) { tintflag = 0; pstintflag = 2; } //use diffuse sampler alpha for tint lookup!
|
||||
break;
|
||||
case 3880384844://{decal_spec_only.sps}w
|
||||
case 600733812://{decal_amb_only.sps}
|
||||
case 2842248626://{spec_decal.sps}
|
||||
@@ -799,6 +809,10 @@ namespace CodeWalker.Rendering
|
||||
{
|
||||
tintpal.SetVSResource(context, 0);
|
||||
}
|
||||
if (pstintflag == 2)
|
||||
{
|
||||
tintpal.SetPSResource(context, 6);
|
||||
}
|
||||
|
||||
|
||||
if (geom.BoneTransforms != null)
|
||||
|
||||
@@ -323,6 +323,7 @@ namespace CodeWalker.Rendering
|
||||
|
||||
|
||||
uint windflag = 0;
|
||||
uint tintflag = 0;
|
||||
var shaderFile = geom.DrawableGeom.Shader.FileName;
|
||||
switch (shaderFile.Hash)
|
||||
{
|
||||
@@ -335,13 +336,18 @@ namespace CodeWalker.Rendering
|
||||
case 4265705004://{trees_normal_diffspec.sps}
|
||||
windflag = 1;
|
||||
break;
|
||||
case 231364109: //weapon_normal_spec_cutout_palette.sps
|
||||
case 3294641629://weapon_normal_spec_detail_palette.sps
|
||||
case 731050667: //weapon_normal_spec_palette.sps
|
||||
tintflag = 2; //use diffuse sampler alpha for tint lookup! (ignore texture alpha in PS)
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
GeomVars.Vars.EnableTexture = usediff ? 1u : 0u;
|
||||
GeomVars.Vars.EnableTint = 0u;// usetint ? 1u : 0u;
|
||||
GeomVars.Vars.EnableTint = tintflag;// usetint ? 1u : 0u;
|
||||
GeomVars.Vars.IsDecal = 0u;// DecalMode ? 1u : 0u;
|
||||
GeomVars.Vars.EnableWind = windflag;
|
||||
GeomVars.Vars.WindOverrideParams = geom.WindOverrideParams;
|
||||
|
||||
Reference in New Issue
Block a user