Skip to content

Commit f96c73f

Browse files
authored
Fix unlit shader flag (#6873)
1 parent 5fd06b4 commit f96c73f

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

code/def_files/data/effects/main-f.sdr

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -413,6 +413,18 @@ void main()
413413
baseColor.rgb += emissiveColor.rgb;
414414
#prereplace ENDIF_FLAG //MODEL_SDR_FLAG_DEFERRED
415415

416+
#prereplace IF_FLAG MODEL_SDR_FLAG_DEFERRED
417+
#prereplace IF_NOT_FLAG MODEL_SDR_FLAG_LIGHT
418+
#prereplace IF_FLAG MODEL_SDR_FLAG_SPEC
419+
baseColor.rgb += pow(1.0 - clamp(dot(eyeDir, normal), 0.0, 1.0), 5.0 * clamp(glossData, 0.01, 1.0)) * specColor.rgb;
420+
glossData = 0;
421+
#prereplace ENDIF_FLAG //MODEL_SDR_FLAG_SPEC
422+
// If there is no lighting then we copy the color data so far into the emissive.
423+
emissiveColor.rgb += baseColor.rgb;
424+
aoFactors.x = 0;
425+
#prereplace ENDIF_FLAG //MODEL_SDR_FLAG_LIGHT
426+
#prereplace ENDIF_FLAG //MODEL_SDR_FLAG_DEFERRED
427+
416428
fragOut0 = baseColor;
417429

418430
#prereplace IF_FLAG MODEL_SDR_FLAG_DEFERRED

0 commit comments

Comments
 (0)