Adjust backpack framing and remove lighting

This commit is contained in:
2026-03-26 17:22:19 +08:00
parent 2e2316aa55
commit 93de4199d1
2 changed files with 2036 additions and 20029 deletions

File diff suppressed because one or more lines are too long

View File

@@ -200,7 +200,7 @@ SceneConstants CreateSceneConstants(const Mesh& mesh) {
const Matrix4x4 scale =
Matrix4x4::Scale(Vector3(uniformScale, uniformScale, uniformScale));
const Matrix4x4 world =
Matrix4x4::Translation(Vector3(0.0f, -0.25f, 3.0f)) *
Matrix4x4::Translation(Vector3(0.0f, 0.08f, 3.0f)) *
rotation *
scale *
centerTranslation;
@@ -304,19 +304,8 @@ PSInput MainVS(VSInput input) {
}
float4 MainPS(PSInput input, bool isFrontFace : SV_IsFrontFace) : SV_TARGET {
float3 normal = normalize(isFrontFace ? input.worldNormal : -input.worldNormal);
float3 lightDir = normalize(gLightDirection.xyz);
float3 viewDir = normalize(gCameraPosition.xyz - input.worldPosition);
float3 halfDir = normalize(lightDir + viewDir);
float3 baseColor = gBaseColorTexture.Sample(gBaseColorSampler, input.texcoord).rgb;
float specularMask = gSpecularTexture.Sample(gSpecularSampler, input.texcoord).r;
float diffuse = saturate(dot(normal, lightDir));
float specular = pow(saturate(dot(normal, halfDir)), 32.0f) * specularMask;
float3 color = baseColor * (gAmbientColor.rgb + gLightColor.rgb * diffuse);
color += gLightColor.rgb * (specular * 0.35f);
return float4(saturate(color), 1.0f);
return float4(baseColor, 1.0f);
}
)";
@@ -370,19 +359,8 @@ in vec2 vTexCoord;
layout(location = 0) out vec4 fragColor;
void main() {
vec3 normal = normalize(gl_FrontFacing ? vWorldNormal : -vWorldNormal);
vec3 lightDir = normalize(gLightDirection.xyz);
vec3 viewDir = normalize(gCameraPosition.xyz - vWorldPosition);
vec3 halfDir = normalize(lightDir + viewDir);
vec3 baseColor = texture(uBaseColorTexture, vTexCoord).rgb;
float specularMask = texture(uSpecularTexture, vTexCoord).r;
float diffuse = max(dot(normal, lightDir), 0.0);
float specular = pow(max(dot(normal, halfDir), 0.0), 32.0) * specularMask;
vec3 color = baseColor * (gAmbientColor.rgb + gLightColor.rgb * diffuse);
color += gLightColor.rgb * (specular * 0.35);
fragColor = vec4(clamp(color, 0.0, 1.0), 1.0);
fragColor = vec4(baseColor, 1.0);
}
)";