Sha256: 409a027b8650a055fd399efd5b9e06b74c35ac9d69eee1a79296f96d33f4e280

Contents?: true

Size: 447 Bytes

Versions: 21

Compression:

Stored size: 447 Bytes

Contents

#ifdef USE_FOG

	#ifdef USE_LOGDEPTHBUF_EXT

		float depth = gl_FragDepthEXT / gl_FragCoord.w;

	#else

		float depth = gl_FragCoord.z / gl_FragCoord.w;

	#endif

	#ifdef FOG_EXP2

		float fogFactor = exp2( - square( fogDensity ) * square( depth ) * LOG2 );
		fogFactor = whiteCompliment( fogFactor );

	#else

		float fogFactor = smoothstep( fogNear, fogFar, depth );

	#endif
	
	outgoingLight = mix( outgoingLight, fogColor, fogFactor );

#endif

Version data entries

21 entries across 21 versions & 2 rubygems

Version Path
mittsu-0.1.0 lib/mittsu/renderers/shaders/shader_chunk/fog_fragment.glsl