Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 15 additions & 3 deletions Materials/material_common_2.0.fxsub
Original file line number Diff line number Diff line change
Expand Up @@ -1542,11 +1542,17 @@ GbufferParam MaterialPS(
in float2 coord0 : TEXCOORD1,
#if OCCLUSION_MAP_TYPE == 2 || OCCLUSION_MAP_TYPE == 3
in float2 coord1 : TEXCOORD2,
#endif
#ifndef MATERIAL_SINGLESIDE
in float faceside : VFACE,
#endif
in float4 worldPos : TEXCOORD3)
{
normal = normalize(normal);

#ifdef MATERIAL_SINGLESIDE
float faceside = 1;
#endif
#if PARALLAX_MAP_FROM
#if PARALLAX_MAP_UV_FLIP
coord0.y = 1 - coord0.y;
Expand All @@ -1566,7 +1572,7 @@ GbufferParam MaterialPS(

MaterialParam material;
material.albedo = GetSubAlbedo(GetAlbedo(coord0), coord0);
material.normal = GetNormal(normal, worldPos.xyz, coord0);
material.normal = GetNormal(normal, worldPos.xyz, coord0) * faceside;
#if SPECULAR_ANTIALIASING_ENABLE
material.smoothness = GeometricNormalFiltering(GetSmoothness(coord0), material.normal, specularAntiAliasingVariance, specularAntiAliasingThreshold);
#else
Expand Down Expand Up @@ -1594,11 +1600,17 @@ GbufferParam Material2PS(
in float2 coord0 : TEXCOORD1,
#if OCCLUSION_MAP_TYPE == 2 || OCCLUSION_MAP_TYPE == 3
in float2 coord1 : TEXCOORD2,
#endif
#ifndef MATERIAL_SINGLESIDE
in float faceside : VFACE,
#endif
in float4 worldPos : TEXCOORD3)
{
normal = normalize(normal);

#ifdef MATERIAL_SINGLESIDE
float faceside = 1;
#endif
#if PARALLAX_MAP_FROM
#if PARALLAX_MAP_UV_FLIP
coord0.y = 1 - coord0.y;
Expand All @@ -1623,7 +1635,7 @@ GbufferParam Material2PS(

MaterialParam material;
material.albedo = GetSubAlbedo(GetAlbedo(coord0), coord0);
material.normal = GetNormal(normal, worldPos.xyz, coord0);
material.normal = GetNormal(normal, worldPos.xyz, coord0) * faceside;
material.smoothness = min(geometricSmoothness, GetSmoothness(coord0));
material.metalness = GetMetalness(coord0);
material.specular = GetSpecular(coord0);
Expand Down Expand Up @@ -1677,4 +1689,4 @@ OBJECT_TEC(MainTecBS0, "object_ss")

technique EdgeTec<string MMDPass = "edge";>{}
technique ShadowTech<string MMDPass = "shadow";>{}
technique ZplotTec<string MMDPass = "zplot";>{}
technique ZplotTec<string MMDPass = "zplot";>{}