Hey there, if somebody had the same issue:
i'm building my own lit spatial shader with the visual shader graph,
here the graph, (i tested with an expression as well i still have a problem)

here the issue :
when i test with multiple light, for example here with two omni , they are not blending very well in the engine.

Somebody have a way to fix it ?
thanks a lot

  • xyz replied to this.

    UlricL What happens if you disable shadow casting?

      xyz
      yes i tested that, both shadow on the materials flags and omni light are disable.
      Maybe it's a limitation with the actual engine state ?

      • xyz replied to this.

        UlricL More likely it's your shader. Can you post the shader code? (Click on "show generated shader code" icon in the shader editor toolbar and copy paste the code)

          xyz
          Sure !
          here the code

          shader_type spatial;
          render_mode blend_mix, depth_draw_opaque, cull_back, diffuse_lambert, specular_schlick_ggx, shadows_disabled, debug_shadow_splits;
          
          global uniform vec4 Subscene_Darker_color : source_color;
          
          
          
          void fragment() {
          // ColorParameter:2
          	vec4 n_out2p0 = Subscene_Darker_color;
          
          
          // Output:0
          	ALBEDO = vec3(n_out2p0.xyz);
          
          
          }
          
          void light() {
          // Input:51
          	vec3 n_out51p0 = NORMAL;
          
          
          // Input:60
          	vec3 n_out60p0 = LIGHT;
          
          
          // DotProduct:58
          	float n_out58p0 = dot(n_out51p0, n_out60p0);
          
          
          // Clamp:56
          	float n_in56p1 = 0.00000;
          	float n_in56p2 = 1.00000;
          	float n_out56p0 = clamp(n_out58p0, n_in56p1, n_in56p2);
          
          
          // Input:57
          	float n_out57p0 = ATTENUATION;
          
          
          // VectorOp:59
          	vec3 n_out59p0 = vec3(n_out56p0) * vec3(n_out57p0);
          
          
          // Output:0
          	SPECULAR_LIGHT = n_out59p0;
          
          
          }
          • xyz replied to this.

            UlricL Each light pass should add to existing light value. That way the light contribution from each source accumulates properly. So you need to add the calculated value to existing value when assigning to output.

            SPECULAR_LIGHT = SPECULAR_LIGHT + contribution_from_this_pass;

              xyz

              Thanks again ! : ) that's working, just need to convert my visual shader and do the += need there.
              Will try to do it keeping the visual shader as well and share it here when i will