<commit_before>define([
        '../Core/Cartesian3',
        '../Core/ComponentDatatype',
        '../Core/defined',
        '../Core/defineProperties',
        '../Core/destroyObject',
        '../Core/IndexDatatype',
        '../Renderer/Buffer',
        '../Renderer/BufferUsage',
        '../Renderer/ComputeCommand',
        '../Renderer/ShaderProgram',
        '../Renderer/Texture',
        '../Renderer/VertexArray',
        '../Shaders/OctahedralProjectionAtlasFS',
        '../Shaders/OctahedralProjectionFS',
        '../Shaders/OctahedralProjectionVS'
    ], function(
        Cartesian3,
        ComponentDatatype,
        defined,
        defineProperties,
        destroyObject,
        IndexDatatype,
        Buffer,
        BufferUsage,
        ComputeCommand,
        ShaderProgram,
        Texture,
        VertexArray,
        OctahedralProjectionAtlasFS,
        OctahedralProjectionFS,
        OctahedralProjectionVS) {
    'use strict';

    /**
     * Packs all mip levels of a cube map into a 2D texture atlas.
     *
     * Octahedral projection is a way of putting the cube maps onto a 2D texture
     * with minimal distortion and easy look up.
     * See Chapter 16 of WebGL Insights "HDR Image-Based Lighting on the Web" by <NAME>
     * and "Octahedron Environment Maps" for reference.
     *
     * @param {CubeMap[]} cubeMaps An array of {@link CubeMap}s to pack.
     *
     * @private
     */
    function OctahedralProjectedCubeMap(cubeMaps) {
        this._cubeMaps = cubeMaps;

        this._texture = undefined;
        this._mipTextures = undefined;
        this._va = undefined;
        this._sp = undefined;

        this._maximumMipmapLevel = undefined;
    }

    defineProperties(OctahedralProjectedCubeMap.prototype, {
        /**
         * A texture containing all the packed convolutions.
         * @memberof {OctahedralProjectedCubeMap.prototype}
         * @type {Texture}
         */
        texture : {
            get : function() {
                return this._texture;
            }
        },
        /**
         * The maximum number of mip levels.
         * @memberOf {OctahedralProjectedMap}
         * @type {Number}
         */
        maximumMipmapLevel : {
            get : function() {
                return this._maximumMipmapLevel;
            }
        }
    });

    // These vertices are based on figure 1 from "Octahedron Environment Maps".
    var v1 = new Cartesian3(1.0, 0.0, 0.0);
    var v2 = new Cartesian3(0.0, 0.0, -1.0);
    var v3 = new Cartesian3(-1.0, 0.0, 0.0);
    var v4 = new Cartesian3(0.0, 0.0, 1.0);
    var v5 = new Cartesian3(0.0, 1.0, 0.0);
    var v6 = new Cartesian3(0.0, -1.0, 0.0);

    // top left, left, top, center, right, top right, bottom, bottom left, bottom right
    var cubeMapCoordinates = [v5, v3, v2, v6, v1, v5, v4, v5, v5];
    var length = cubeMapCoordinates.length;
    var flatCubeMapCoordinates = new Float32Array(length * 3);

    var offset = 0;
    for (var i = 0; i < length; ++i, offset += 3) {
        Cartesian3.pack(cubeMapCoordinates[i], flatCubeMapCoordinates, offset);
    }

    var flatPositions = new Float32Array([
        -1.0,  1.0, // top left
        -1.0,  0.0, // left
         0.0,  1.0, // top
         0.0,  0.0, // center<commit_msg>Reverse Z axis in cubemap<commit_after>define([
        '../Core/Cartesian3',
        '../Core/ComponentDatatype',
        '../Core/defined',
        '../Core/defineProperties',
        '../Core/destroyObject',
        '../Core/IndexDatatype',
        '../Renderer/Buffer',
        '../Renderer/BufferUsage',
        '../Renderer/ComputeCommand',
        '../Renderer/ShaderProgram',
        '../Renderer/Texture',
        '../Renderer/VertexArray',
        '../Shaders/OctahedralProjectionAtlasFS',
        '../Shaders/OctahedralProjectionFS',
        '../Shaders/OctahedralProjectionVS'
    ], function(
        Cartesian3,
        ComponentDatatype,
        defined,
        defineProperties,
        destroyObject,
        IndexDatatype,
        Buffer,
        BufferUsage,
        ComputeCommand,
        ShaderProgram,
        Texture,
        VertexArray,
        OctahedralProjectionAtlasFS,
        OctahedralProjectionFS,
        OctahedralProjectionVS) {
    'use strict';

    /**
     * Packs all mip levels of a cube map into a 2D texture atlas.
     *
     * Octahedral projection is a way of putting the cube maps onto a 2D texture
     * with minimal distortion and easy look up.
     * See Chapter 16 of WebGL Insights "HDR Image-Based Lighting on the Web" by <NAME>
     * and "Octahedron Environment Maps" for reference.
     *
     * @param {CubeMap[]} cubeMaps An array of {@link CubeMap}s to pack.
     *
     * @private
     */
    function OctahedralProjectedCubeMap(cubeMaps) {
        this._cubeMaps = cubeMaps;

        this._texture = undefined;
        this._mipTextures = undefined;
        this._va = undefined;
        this._sp = undefined;

        this._maximumMipmapLevel = undefined;
    }

    defineProperties(OctahedralProjectedCubeMap.prototype, {
        /**
         * A texture containing all the packed convolutions.
         * @memberof {OctahedralProjectedCubeMap.prototype}
         * @type {Texture}
         */
        texture : {
            get : function() {
                return this._texture;
            }
        },
        /**
         * The maximum number of mip levels.
         * @memberOf {OctahedralProjectedMap}
         * @type {Number}
         */
        maximumMipmapLevel : {
            get : function() {
                return this._maximumMipmapLevel;
            }
        }
    });

    // These vertices are based on figure 1 from "Octahedron Environment Maps".
    var v1 = new Cartesian3(1.0, 0.0, 0.0);
    var v2 = new Cartesian3(0.0, 0.0, 1.0);
    var v3 = new Cartesian3(-1.0, 0.0, 0.0);
    var v4 = new Cartesian3(0.0, 0.0, -1.0);
    var v5 = new Cartesian3(0.0, 1.0, 0.0);
    var v6 = new Cartesian3(0.0, -1.0, 0.0);

    // top left, left, top, center, right, top right, bottom, bottom left, bottom right
    var cubeMapCoordinates = [v5, v3, v2, v6, v1, v5, v4, v5, v5];
    var length = cubeMapCoordinates.length;
    var flatCubeMapCoordinates = new Float32Array(length * 3);

    var offset = 0;
    for (var i = 0; i < length; ++i, offset += 3) {
        Cartesian3.pack(cubeMapCoordinates[i], flatCubeMapCoordinates, offset);
    }

    var flatPositions = new Float32Array([
        -1.0,  1.0, // top left
        -1.0,  0.0, // left
         0.0,  1.0, // top
         0.0,  0.0, // center
{'fraction_non_alphanumeric': 0.11906211936662607, 'fraction_numerical': 0.02710109622411693, 'mean_word_length': 1.8798772468215694, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4030503', 'n_tokens_mistral': 2109, 'n_tokens_neox': 2045, 'n_words': 515}