diff options
| author | JMC47 <JMC4789@gmail.com> | 2025-03-15 17:26:32 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-03-15 17:26:32 -0400 |
| commit | e3deb14156cee95a9f4119aa11857731f3687ad2 (patch) | |
| tree | 52b49aa074862d6c8185b7cd7b17a8afe1a969f0 /Source/Core/VideoCommon/VertexShaderGen.cpp | |
| parent | 225039f742d14eacd704490bb1a66dc119a91320 (diff) | |
| parent | 15372dc835a2c387f8f566fa86d6cc60b2534a7d (diff) | |
Merge pull request #13347 from iwubcode/custom_shader_overhaul_lighting
VideoCommon: move lighting shader logic to callable functions
Diffstat (limited to 'Source/Core/VideoCommon/VertexShaderGen.cpp')
| -rw-r--r-- | Source/Core/VideoCommon/VertexShaderGen.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/Source/Core/VideoCommon/VertexShaderGen.cpp b/Source/Core/VideoCommon/VertexShaderGen.cpp index 41512cd489..ace5cb514e 100644 --- a/Source/Core/VideoCommon/VertexShaderGen.cpp +++ b/Source/Core/VideoCommon/VertexShaderGen.cpp @@ -190,6 +190,7 @@ ShaderCode GenerateVertexShaderCode(APIType api_type, const ShaderHostConfig& ho out.Write("}};\n\n"); WriteIsNanHeader(out, api_type); + GenerateLightingShaderHeader(out, uid_data->lighting); if (uid_data->vs_expand == VSExpand::None) { @@ -434,7 +435,12 @@ ShaderCode GenerateVertexShaderCode(APIType api_type, const ShaderHostConfig& ho "float3 ldir, h, cosAttn, distAttn;\n" "float dist, dist2, attn;\n"); - GenerateLightingShaderCode(out, uid_data->lighting, "vertex_color_", "o.colors_"); + for (u32 chan = 0; chan < NUM_XF_COLOR_CHANNELS; chan++) + { + out.Write( + "\to.colors_{0} = dolphin_calculate_lighting_chn{0}(vertex_color_{0}, pos.xyz, _normal);\n", + chan); + } // transform texcoords out.Write("float4 coord = float4(0.0, 0.0, 1.0, 1.0);\n"); |
