<commit_before>LOI = LandsOfIllusions

class LOI.Engine.RadianceState.Probe
  @cubeResolution: 256
  @octahedronMapMaxLevel: 9
  @octahedronMapResolution: 2 ** @octahedronMapMaxLevel

  @initialize: ->
    # Prepare rendering of the radiance cube.
    @cubeCamera = new THREE.CubeCamera 0.001, 1000, @cubeResolution,
      # Note: Support for RGB Float textures is not as wide as RGBA so
      # we don't enable RGB, even though we don't need the alpha channel.
      type: THREE.FloatType
      stencilBuffer: false

    # Create render target for extracting the probe cube to an octahedron map.
    @octahedronMapRenderTarget = new THREE.WebGLRenderTarget @octahedronMapResolution, @octahedronMapResolution * 2,
      type: THREE.FloatType
      stencilBuffer: false
      depthBuffer: false
      minFilter: THREE.LinearMipmapNearestFilter

    @octahedronMap = @octahedronMapRenderTarget.texture

    @octahedronMapMaterial = new @OctahedronMapMaterial
    octahedronMapQuad = new THREE.Mesh new THREE.PlaneBufferGeometry(2, 2), @octahedronMapMaterial

    @octahedronMapScene = new THREE.Scene()
    @octahedronMapScene.add octahedronMapQuad

    @octahedronMapCamera = new THREE.OrthographicCamera 0, 1, 0, 1, 0.5, 1.5

  @update: (renderer) ->
    # Update octahedron map (it is assumed cube camera was used to render new data prior to this).
    renderer.setRenderTarget @octahedronMapRenderTarget
    renderer.render @octahedronMapScene, @octahedronMapCamera<commit_msg>Fix for probe map, reverting to generating mipmaps.<commit_after>LOI = LandsOfIllusions

class LOI.Engine.RadianceState.Probe
  @cubeResolution: 256
  @octahedronMapMaxLevel: 9
  @octahedronMapResolution: 2 ** @octahedronMapMaxLevel

  @initialize: ->
    # Prepare rendering of the radiance cube.
    @cubeCamera = new THREE.CubeCamera 0.001, 1000, @cubeResolution,
      # Note: Support for RGB Float textures is not as wide as RGBA so
      # we don't enable RGB, even though we don't need the alpha channel.
      type: THREE.FloatType
      stencilBuffer: false

    # Create render target for extracting the probe cube to an octahedron map.
    @octahedronMapRenderTarget = new THREE.WebGLRenderTarget @octahedronMapResolution, @octahedronMapResolution * 2,
      type: THREE.FloatType
      stencilBuffer: false
      depthBuffer: false
      generateMipmaps: true
      minFilter: THREE.LinearMipmapNearestFilter

    @octahedronMap = @octahedronMapRenderTarget.texture

    @octahedronMapMaterial = new @OctahedronMapMaterial
    octahedronMapQuad = new THREE.Mesh new THREE.PlaneBufferGeometry(2, 2), @octahedronMapMaterial

    @octahedronMapScene = new THREE.Scene()
    @octahedronMapScene.add octahedronMapQuad

    @octahedronMapCamera = new THREE.OrthographicCamera 0, 1, 0, 1, 0.5, 1.5

  @update: (renderer) ->
    # Update octahedron map (it is assumed cube camera was used to render new data prior to this).
    renderer.setRenderTarget @octahedronMapRenderTarget
    renderer.render @octahedronMapScene, @octahedronMapCamera
{'fraction_non_alphanumeric': 0.06977513227513228, 'fraction_numerical': 0.015873015873015872, 'mean_word_length': 4.101180438448567, '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': '5395864', 'n_tokens_mistral': 1042, 'n_tokens_neox': 907, 'n_words': 266}