Skip to content

Commit

Permalink
Metallic not working in vertex lighting in Vulkan
Browse files Browse the repository at this point in the history
  • Loading branch information
ywmaa committed May 24, 2024
1 parent d5da7d1 commit 475419e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1699,7 +1699,10 @@ void fragment_shader(in SceneData scene_data) {
vec3 specular_light = vec3(0.0, 0.0, 0.0);
vec3 diffuse_light = vec3(0.0, 0.0, 0.0);
vec3 ambient_light = vec3(0.0, 0.0, 0.0);

#if !defined(MODE_RENDER_DEPTH) && !defined(MODE_UNSHADED) && defined(USE_VERTEX_LIGHTING) // Pass Vertex Lighting colors
specular_light = specular_light_interp.rgb;
diffuse_light = diffuse_light_interp.rgb;
#endif
#ifndef MODE_UNSHADED
// Used in regular draw pass and when drawing SDFs for SDFGI and materials for VoxelGI.
emission *= scene_data.emissive_exposure_normalization;
Expand Down Expand Up @@ -2148,10 +2151,6 @@ void fragment_shader(in SceneData scene_data) {
#endif

// LIGHTING
#if !defined(MODE_RENDER_DEPTH) && !defined(MODE_UNSHADED) && defined(USE_VERTEX_LIGHTING) // Pass Vertex Lighting colors
specular_light = specular_light_interp.rgb;
diffuse_light = diffuse_light_interp.rgb;
#endif
#if !defined(MODE_RENDER_DEPTH) && !defined(MODE_UNSHADED) && !defined(USE_VERTEX_LIGHTING)

{ // Directional light.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1342,7 +1342,10 @@ void main() {
vec3 specular_light = vec3(0.0, 0.0, 0.0);
vec3 diffuse_light = vec3(0.0, 0.0, 0.0);
vec3 ambient_light = vec3(0.0, 0.0, 0.0);

#if !defined(MODE_RENDER_DEPTH) && !defined(MODE_UNSHADED) && defined(USE_VERTEX_LIGHTING) // Pass Vertex Lighting colors
specular_light = specular_light_interp.rgb;
diffuse_light = diffuse_light_interp.rgb;
#endif
#ifndef MODE_UNSHADED
// Used in regular draw pass and when drawing SDFs for SDFGI and materials for VoxelGI.
emission *= scene_data.emissive_exposure_normalization;
Expand Down Expand Up @@ -1597,10 +1600,6 @@ void main() {
#endif

// LIGHTING
#if !defined(MODE_RENDER_DEPTH) && !defined(MODE_UNSHADED) && defined(USE_VERTEX_LIGHTING) // Pass Vertex Lighting colors
specular_light = specular_light_interp.rgb;
diffuse_light = diffuse_light_interp.rgb;
#endif
#if !defined(MODE_RENDER_DEPTH) && !defined(MODE_UNSHADED) && !defined(USE_VERTEX_LIGHTING)

if (!sc_disable_directional_lights) { //directional light
Expand Down

0 comments on commit 475419e

Please sign in to comment.