<commit_before>define([
	'goo/renderer/MeshData',
	'goo/renderer/light/PointLight',
	'goo/renderer/light/DirectionalLight',
	'goo/renderer/light/SpotLight',
	'goo/renderer/Texture',
	'goo/math/MathUtils',
	'goo/util/TangentGenerator'
],
/** @lends */
function(
	MeshData,
	PointLight,
	DirectionalLight,
	SpotLight,
	Texture,
	MathUtils,
	TangentGenerator
) {
	'use strict';

	/**
	 * @class Builds shaders
	 */
	function ShaderBuilder() {
	}

	var defaultLight = new DirectionalLight();
	defaultLight.translation.setd(10, 10, 10);
	defaultLight.direction.setd(1, 1, 1).normalize();
	ShaderBuilder.defaultLight = defaultLight;

	ShaderBuilder.SKYBOX = null;
	ShaderBuilder.SKYSPHERE = null;
	ShaderBuilder.ENVIRONMENT_TYPE = 0;
	ShaderBuilder.GLOBAL_AMBIENT = [0, 0, 0];
	ShaderBuilder.USE_FOG = false;
	ShaderBuilder.FOG_SETTINGS = [0, 10000];
	ShaderBuilder.FOG_COLOR = [1, 1, 1];

	ShaderBuilder.uber = {
		processor: function (shader, shaderInfo) {
			var attributeMap = shaderInfo.meshData.attributeMap;
			var material = shaderInfo.material;
			var textureMaps = material._textureMaps;

			shader.defines = shader.defines || {};

			if (ShaderBuilder.SKYBOX && material.uniforms.reflectivity > 0) {
				material.setTexture('ENVIRONMENT_CUBE', ShaderBuilder.SKYBOX);
			} else {
				material.removeTexture('ENVIRONMENT_CUBE');
			}
			if (ShaderBuilder.SKYSPHERE && material.uniforms.reflectivity > 0) {
				material.setTexture('ENVIRONMENT_SPHERE', ShaderBuilder.SKYSPHERE);
				shader.defines.ENVIRONMENT_TYPE = ShaderBuilder.ENVIRONMENT_TYPE;
			} else {
				material.removeTexture('ENVIRONMENT_SPHERE');
			}

			for (var attribute in attributeMap) {
				if (!shader.defines[attribute]) {
					shader.defines[attribute] = true;
				}
			}

			for (var type in textureMaps) {
				if (textureMaps[type] === undefined) {
					continue;
				}

				if (type === 'SHADOW_MAP') {
					continue;
				}

				if (!shader.defines[type]) {<commit_msg>Slight performance fix in ubershader<commit_after>define([
	'goo/renderer/MeshData',
	'goo/renderer/light/PointLight',
	'goo/renderer/light/DirectionalLight',
	'goo/renderer/light/SpotLight',
	'goo/renderer/Texture',
	'goo/math/MathUtils',
	'goo/util/TangentGenerator'
],
/** @lends */
function(
	MeshData,
	PointLight,
	DirectionalLight,
	SpotLight,
	Texture,
	MathUtils,
	TangentGenerator
) {
	'use strict';

	/**
	 * @class Builds shaders
	 */
	function ShaderBuilder() {
	}

	var defaultLight = new DirectionalLight();
	defaultLight.translation.setd(10, 10, 10);
	defaultLight.direction.setd(1, 1, 1).normalize();
	ShaderBuilder.defaultLight = defaultLight;

	ShaderBuilder.SKYBOX = null;
	ShaderBuilder.SKYSPHERE = null;
	ShaderBuilder.ENVIRONMENT_TYPE = 0;
	ShaderBuilder.GLOBAL_AMBIENT = [0, 0, 0];
	ShaderBuilder.USE_FOG = false;
	ShaderBuilder.FOG_SETTINGS = [0, 10000];
	ShaderBuilder.FOG_COLOR = [1, 1, 1];

	ShaderBuilder.uber = {
		processor: function (shader, shaderInfo) {
			var attributeMap = shaderInfo.meshData.attributeMap;
			var material = shaderInfo.material;
			var textureMaps = material._textureMaps;

			shader.defines = shader.defines || {};

			if (ShaderBuilder.SKYBOX && material.uniforms.reflectivity > 0) {
				material.setTexture('ENVIRONMENT_CUBE', ShaderBuilder.SKYBOX);
			} else if (material.getTexture('ENVIRONMENT_CUBE')) {
				material.removeTexture('ENVIRONMENT_CUBE');
			}
			if (ShaderBuilder.SKYSPHERE && material.uniforms.reflectivity > 0) {
				material.setTexture('ENVIRONMENT_SPHERE', ShaderBuilder.SKYSPHERE);
				shader.defines.ENVIRONMENT_TYPE = ShaderBuilder.ENVIRONMENT_TYPE;
			} else if (material.getTexture('ENVIRONMENT_SPHERE')) {
				material.removeTexture('ENVIRONMENT_SPHERE');
			}

			for (var attribute in attributeMap) {
				if (!shader.defines[attribute]) {
					shader.defines[attribute] = true;
				}
			}

			for (var type in textureMaps) {
				if (textureMaps[type] === undefined) {
					continue;
				}

				if (type === 'SHADOW_MAP') {
					continue;
				}

				if (!shader.defines[type]) {
{'fraction_non_alphanumeric': 0.13263525305410123, 'fraction_numerical': 0.011967090501121914, 'mean_word_length': 4.299867899603699, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, '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': '1356784', 'n_tokens_mistral': 1618, 'n_tokens_neox': 1421, 'n_words': 234}