<commit_before>#ifdef USE_SHADOWMAP
	
	uniform sampler2D shadowMap[ MAX_SHADOWS ];
	uniform vec2 shadowMapSize[ MAX_SHADOWS ];

	uniform float shadowDarkness[ MAX_SHADOWS ];
	uniform float shadowBias[ MAX_SHADOWS ];

	varying vec4 vShadowCoord[ MAX_SHADOWS ];

	float unpackDepth( const in vec4 rgba_depth ) {

		const vec4 bit_shift = vec4( 1.0 / ( 256.0 * 256.0 * 256.0 ), 1.0 / ( 256.0 * 256.0 ), 1.0 / 256.0, 1.0 );
		float depth = dot( rgba_depth, bit_shift );
		return depth;

	}

	#if defined(POINT_LIGHT_SHADOWS)

		float unpack1K ( vec4 color ) {
		
			const vec4 bitSh = vec4( 1.0 / (256.0 * 256.0 * 256.0), 1.0 / (256.0 * 256.0), 1.0 / 256.0, 1.0 );
			return dot( color, bitSh ) * 1000.0;
			
		}

		vec2 cubeToUV( vec3 v, float texelSizeX, float texelSizeY ) {

			// Horizontal cross layout:
			const vec2 Squares = vec2( 4.0, 2.0 );
			const vec2 Center = vec2( 1.0, 0.0 );

			// Size of a square in UV space:
			const vec2 TexSquareSize = 1.0 / Squares;

			// UV space offset of the center of the center square of the cross:
			const vec2 TexCoordOffs = TexSquareSize * ( 0.5 + Center );

			// Factors to scale square space (-1..+1 per square) to UV space:
			const vec2 TexSquareScale = TexSquareSize * 0.5;

			// Just less than a texel in square space when divided by resolution:
			const float TexEps = 1.5; // = min(Squares.x, Squares.y) - 0.5;
<commit_msg>Updated comments for cubeToUV() function in shadow mapping shader.<commit_after>#ifdef USE_SHADOWMAP
	
	uniform sampler2D shadowMap[ MAX_SHADOWS ];
	uniform vec2 shadowMapSize[ MAX_SHADOWS ];

	uniform float shadowDarkness[ MAX_SHADOWS ];
	uniform float shadowBias[ MAX_SHADOWS ];

	varying vec4 vShadowCoord[ MAX_SHADOWS ];

	float unpackDepth( const in vec4 rgba_depth ) {

		const vec4 bit_shift = vec4( 1.0 / ( 256.0 * 256.0 * 256.0 ), 1.0 / ( 256.0 * 256.0 ), 1.0 / 256.0, 1.0 );
		float depth = dot( rgba_depth, bit_shift );
		return depth;

	}

	#if defined(POINT_LIGHT_SHADOWS)

		float unpack1K ( vec4 color ) {
		
			const vec4 bitSh = vec4( 1.0 / (256.0 * 256.0 * 256.0), 1.0 / (256.0 * 256.0), 1.0 / 256.0, 1.0 );
			return dot( color, bitSh ) * 1000.0;
			
		}

		/**
		*  cubeToUV() maps a 3D direction vector suitable for cube texture mapping to a 2D
		*  vector suitable for 2D texture mapping. This code uses the following layout for the
		*  2D texture:
		*
		*  Y y
		*  xzXZ
		*
		*  Y - Positive y direction
		*  y - Negative y direction
		*  X - Positive x direction
		*  x - Negative x direction
		*  Z - Positive z direction
		*  z - Negative z direction
		*
		*  Alternate code for different layouts, more compact code arrangement, and seam
		*  skipping can be found here: https://gist.github.com/tschw/da10c43c467ce8afd0c4
		*/

		vec2 cubeToUV( vec3 v, float texelSizeX, float texelSizeY ) {

			// Horizontal cross layout:
			const vec2 Squares = vec2( 4.0, 2.0 );
			const vec2 Center = vec2( 1.0, 0.0 );

			// Size of a square in UV space:
			const vec2 TexSquareSize = 1.0 / Squares;

			// UV space offset of the center of the center square of the cross:
			const vec2 TexCoordOffs = TexSquareSize * ( 0.5 + Center );

			// Factors to scale square space (-1..+1 per square) to UV space:
			const vec2 TexSquareScale = TexSquareSize * 0.5;

			// Just less than a texel in square space when divided by resolution:
			const float TexEps = 1.5; // = min(Squares.x, Squares.y) - 0.5;

{'fraction_non_alphanumeric': 0.11012956419316844, 'fraction_numerical': 0.06772673733804475, 'mean_word_length': 2.812570145903479, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1692639', 'n_tokens_mistral': 1510, 'n_tokens_neox': 1214, 'n_words': 408}