描画シェーダーの定数に名前を付ける

このコミットが含まれているのは:
routersys committed 2026-10-20 18:36:11 +09:00
1 親 8d8168e4aa
コミット 9200f36925
2ファイル変更
+5 -2

検索条件に一致するファイルはありません

+2 -2
ファイルの表示
@@ -752,7 +752,7 @@ internal readonly partial struct RenderShader(
var highlight = Hlsl.Pow(Hlsl.Saturate(Hlsl.Dot(normal, halfVector)), specularExponent) * specular * (lightCosine > 0f ? 1f : 0f);
var mirrorY = 2f * facing * normal.Y;
var skyAmount = Hlsl.SmoothStep(0.25f, 0.75f, 0.5f - 0.5f * mirrorY);
var skyAmount = Hlsl.SmoothStep(InflateSettings.SkyBlendStart, InflateSettings.SkyBlendEnd, 0.5f - 0.5f * mirrorY);
var sky = new Float3(InflateSettings.SkyRed, InflateSettings.SkyGreen, InflateSettings.SkyBlue);
var ground = new Float3(InflateSettings.GroundRed, InflateSettings.GroundGreen, InflateSettings.GroundBlue);
var environment = Hlsl.Lerp(ground, sky, skyAmount);
@@ -768,7 +768,7 @@ internal readonly partial struct RenderShader(
var color = albedo * lit;
color = Hlsl.Lerp(color, environment, reflectionAmount);
color += new Float3(highlight, highlight, highlight);
color += Hlsl.Lerp(albedo, new Float3(1f, 1f, 1f), 0.5f) * (rim * edgeCubed);
color += Hlsl.Lerp(albedo, new Float3(1f, 1f, 1f), InflateSettings.RimWhiteMix) * (rim * edgeCubed);
color = Hlsl.Saturate(color);
output[new Int2(x, y)] = new Float4(color.X * alpha, color.Y * alpha, color.Z * alpha, alpha);
+3
ファイルの表示
@@ -32,6 +32,9 @@ internal static class InflateSettings
public const float LightWrap = 0.35f;
public const float ReflectionBase = 0.15f;
public const float SurfaceWhite = 0.9f;
public const float SkyBlendStart = 0.25f;
public const float SkyBlendEnd = 0.75f;
public const float RimWhiteMix = 0.5f;
public const float MinimumSpecularExponent = 4f;
public const float MaximumSpecularExponent = 1024f;
public const float SkyRed = 0.82f;