Browse Source

Apply fog before tonemapping

Olli Etuaho 1 year ago
parent
commit
785b1918e3

+ 1 - 1
examples/jsm/effects/OutlineEffect.js

@@ -164,8 +164,8 @@ class OutlineEffect {
 
 			'	gl_FragColor = vec4( outlineColor, outlineAlpha );',
 
-			'	#include <tonemapping_fragment>',
 			'	#include <fog_fragment>',
+			'	#include <tonemapping_fragment>',
 			'	#include <colorspace_fragment>',
 			'	#include <premultiplied_alpha_fragment>',
 

+ 1 - 1
examples/jsm/lines/LineMaterial.js

@@ -425,8 +425,8 @@ ShaderLib[ 'line' ] = {
 
 			gl_FragColor = vec4( diffuseColor.rgb, alpha );
 
-			#include <tonemapping_fragment>
 			#include <fog_fragment>
+			#include <tonemapping_fragment>
 			#include <colorspace_fragment>
 			#include <premultiplied_alpha_fragment>
 

+ 1 - 1
examples/jsm/loaders/LDrawLoader.js

@@ -132,8 +132,8 @@ class LDrawConditionalLineMaterial extends ShaderMaterial {
 				#include <color_fragment>
 				outgoingLight = diffuseColor.rgb; // simple shader
 				gl_FragColor = vec4( outgoingLight, diffuseColor.a );
-				#include <tonemapping_fragment>
 				#include <fog_fragment>
+				#include <tonemapping_fragment>
 				#include <colorspace_fragment>
 				#include <premultiplied_alpha_fragment>
 			}

+ 1 - 1
examples/jsm/materials/MeshGouraudMaterial.js

@@ -293,8 +293,8 @@ const GouraudShader = {
 			#include <envmap_fragment>
 
 			#include <opaque_fragment>
-			#include <tonemapping_fragment>
 			#include <fog_fragment>
+			#include <tonemapping_fragment>
 			#include <colorspace_fragment>
 			#include <premultiplied_alpha_fragment>
 			#include <dithering_fragment>

+ 1 - 1
examples/jsm/objects/Water.js

@@ -180,8 +180,8 @@ class Water extends Mesh {
 					vec3 outgoingLight = albedo;
 					gl_FragColor = vec4( outgoingLight, alpha );
 
-					#include <tonemapping_fragment>
 					#include <fog_fragment>
+					#include <tonemapping_fragment>
 					#include <colorspace_fragment>
 				}`
 

+ 1 - 1
examples/jsm/objects/Water2.js

@@ -347,8 +347,8 @@ Water.WaterShader = {
 			// multiply water color with the mix of both textures
 			gl_FragColor = vec4( color, 1.0 ) * mix( refractColor, reflectColor, reflectance );
 
-			#include <tonemapping_fragment>
 			#include <fog_fragment>
+			#include <tonemapping_fragment>
 			#include <colorspace_fragment>
 
 		}`

+ 1 - 1
src/renderers/shaders/ShaderLib/linedashed.glsl.js

@@ -66,8 +66,8 @@ void main() {
 	outgoingLight = diffuseColor.rgb; // simple shader
 
 	#include <opaque_fragment>
-	#include <tonemapping_fragment>
 	#include <fog_fragment>
+	#include <tonemapping_fragment>
 	#include <colorspace_fragment>
 	#include <premultiplied_alpha_fragment>
 

+ 1 - 1
src/renderers/shaders/ShaderLib/meshbasic.glsl.js

@@ -104,8 +104,8 @@ void main() {
 	#include <envmap_fragment>
 
 	#include <opaque_fragment>
-	#include <tonemapping_fragment>
 	#include <fog_fragment>
+	#include <tonemapping_fragment>
 	#include <colorspace_fragment>
 	#include <premultiplied_alpha_fragment>
 	#include <dithering_fragment>

+ 1 - 1
src/renderers/shaders/ShaderLib/meshlambert.glsl.js

@@ -112,8 +112,8 @@ void main() {
 
 	#include <envmap_fragment>
 	#include <opaque_fragment>
-	#include <tonemapping_fragment>
 	#include <fog_fragment>
+	#include <tonemapping_fragment>
 	#include <colorspace_fragment>
 	#include <premultiplied_alpha_fragment>
 	#include <dithering_fragment>

+ 1 - 1
src/renderers/shaders/ShaderLib/meshmatcap.glsl.js

@@ -99,8 +99,8 @@ void main() {
 	vec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb;
 
 	#include <opaque_fragment>
-	#include <tonemapping_fragment>
 	#include <fog_fragment>
+	#include <tonemapping_fragment>
 	#include <colorspace_fragment>
 	#include <premultiplied_alpha_fragment>
 	#include <dithering_fragment>

+ 1 - 1
src/renderers/shaders/ShaderLib/meshphong.glsl.js

@@ -114,8 +114,8 @@ void main() {
 
 	#include <envmap_fragment>
 	#include <opaque_fragment>
-	#include <tonemapping_fragment>
 	#include <fog_fragment>
+	#include <tonemapping_fragment>
 	#include <colorspace_fragment>
 	#include <premultiplied_alpha_fragment>
 	#include <dithering_fragment>

+ 1 - 1
src/renderers/shaders/ShaderLib/meshphysical.glsl.js

@@ -212,8 +212,8 @@ void main() {
 	#endif
 
 	#include <opaque_fragment>
-	#include <tonemapping_fragment>
 	#include <fog_fragment>
+	#include <tonemapping_fragment>
 	#include <colorspace_fragment>
 	#include <premultiplied_alpha_fragment>
 	#include <dithering_fragment>

+ 1 - 1
src/renderers/shaders/ShaderLib/meshtoon.glsl.js

@@ -106,8 +106,8 @@ void main() {
 	vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;
 
 	#include <opaque_fragment>
-	#include <tonemapping_fragment>
 	#include <fog_fragment>
+	#include <tonemapping_fragment>
 	#include <colorspace_fragment>
 	#include <premultiplied_alpha_fragment>
 	#include <dithering_fragment>

+ 1 - 1
src/renderers/shaders/ShaderLib/points.glsl.js

@@ -77,8 +77,8 @@ void main() {
 	outgoingLight = diffuseColor.rgb;
 
 	#include <opaque_fragment>
-	#include <tonemapping_fragment>
 	#include <fog_fragment>
+	#include <tonemapping_fragment>
 	#include <colorspace_fragment>
 	#include <premultiplied_alpha_fragment>
 

+ 1 - 1
src/renderers/shaders/ShaderLib/shadow.glsl.js

@@ -46,8 +46,8 @@ void main() {
 
 	gl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );
 
-	#include <tonemapping_fragment>
 	#include <fog_fragment>
+	#include <tonemapping_fragment>
 	#include <colorspace_fragment>
 
 }

+ 1 - 1
src/renderers/shaders/ShaderLib/sprite.glsl.js

@@ -73,8 +73,8 @@ void main() {
 	outgoingLight = diffuseColor.rgb;
 
 	#include <opaque_fragment>
-	#include <tonemapping_fragment>
 	#include <fog_fragment>
+	#include <tonemapping_fragment>
 	#include <colorspace_fragment>
 
 }