diff --git a/examples/textures/gainmap/spruit_sunrise_1k.hdr b/examples/textures/equirectangular/spruit_sunrise_1k.hdr similarity index 100% rename from examples/textures/gainmap/spruit_sunrise_1k.hdr rename to examples/textures/equirectangular/spruit_sunrise_1k.hdr diff --git a/examples/textures/gainmap/spruit_sunrise_4k.jpg b/examples/textures/equirectangular/spruit_sunrise_4k.hdr.jpg similarity index 100% rename from examples/textures/gainmap/spruit_sunrise_4k.jpg rename to examples/textures/equirectangular/spruit_sunrise_4k.hdr.jpg diff --git a/examples/textures/gainmap/spruit_sunrise_4k-gainmap.webp b/examples/textures/gainmap/spruit_sunrise_4k-gainmap.webp deleted file mode 100644 index 79c3ae873df416..00000000000000 Binary files a/examples/textures/gainmap/spruit_sunrise_4k-gainmap.webp and /dev/null differ diff --git a/examples/textures/gainmap/spruit_sunrise_4k.json b/examples/textures/gainmap/spruit_sunrise_4k.json deleted file mode 100644 index 3499f1b1ab4f5e..00000000000000 --- a/examples/textures/gainmap/spruit_sunrise_4k.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "gainMapMax": [ - 15.99929538702341, - 15.99929538702341, - 15.99929538702341 - ], - "gainMapMin": [ - 0, - 0, - 0 - ], - "gamma": [ - 1, - 1, - 1 - ], - "hdrCapacityMax": 15.99929538702341, - "hdrCapacityMin": 0, - "offsetHdr": [ - 0.015625, - 0.015625, - 0.015625 - ], - "offsetSdr": [ - 0.015625, - 0.015625, - 0.015625 - ] -} \ No newline at end of file diff --git a/examples/textures/gainmap/spruit_sunrise_4k.webp b/examples/textures/gainmap/spruit_sunrise_4k.webp deleted file mode 100644 index 8757e897c79d6c..00000000000000 Binary files a/examples/textures/gainmap/spruit_sunrise_4k.webp and /dev/null differ diff --git a/examples/webgl_loader_texture_hdrjpg.html b/examples/webgl_loader_texture_hdrjpg.html index 7fec207f879629..e57da4ab7f6d0a 100644 --- a/examples/webgl_loader_texture_hdrjpg.html +++ b/examples/webgl_loader_texture_hdrjpg.html @@ -54,7 +54,7 @@ import { OrbitControls } from 'three/addons/controls/OrbitControls.js'; import { RGBELoader } from 'three/addons/loaders/RGBELoader.js'; - import { GainMapLoader, HDRJPGLoader } from '@monogrid/gainmap-js'; + import { HDRJPGLoader } from '@monogrid/gainmap-js'; const params = { envMap: 'HDR JPG', @@ -68,10 +68,9 @@ let camera, scene, renderer, controls; let torusMesh, planeMesh; let hdrJpg, hdrJpgPMREMRenderTarget, hdrJpgEquirectangularMap; - let gainMap, gainMapPMREMRenderTarget, gainMapBackground; let hdrPMREMRenderTarget, hdrEquirectangularMap; - + const fileSizes = {}; const resolutions = {}; @@ -127,14 +126,15 @@ hdrJpg = new HDRJPGLoader( renderer ) - .load( 'textures/gainmap/spruit_sunrise_4k.jpg', function ( ) { + .load( 'textures/equirectangular/spruit_sunrise_4k.hdr.jpg', function ( ) { resolutions[ 'HDR JPG' ] = hdrJpg.width + 'x' + hdrJpg.height; + displayStats( 'HDR JPG' ); - + hdrJpgEquirectangularMap = hdrJpg.renderTarget.texture; hdrJpgPMREMRenderTarget = pmremGenerator.fromEquirectangular( hdrJpgEquirectangularMap ); - + hdrJpgEquirectangularMap.mapping = THREE.EquirectangularReflectionMapping; hdrJpgEquirectangularMap.needsUpdate = true; @@ -143,37 +143,14 @@ }, function ( progress ) { fileSizes[ 'HDR JPG' ] = humanFileSize( progress.total ); - - } ); - - gainMap = new GainMapLoader( renderer ) - .load( [ - 'textures/gainmap/spruit_sunrise_4k.webp', - 'textures/gainmap/spruit_sunrise_4k-gainmap.webp', - 'textures/gainmap/spruit_sunrise_4k.json' - ], function ( ) { - - resolutions[ 'Webp Gain map (separate)' ] = gainMap.width + 'x' + gainMap.height; - - gainMapBackground = gainMap.renderTarget.texture; - gainMapPMREMRenderTarget = pmremGenerator.fromEquirectangular( gainMapBackground ); - - gainMapBackground.mapping = THREE.EquirectangularReflectionMapping; - gainMapBackground.needsUpdate = true; - - gainMap.dispose(); - - }, function ( progress ) { - - fileSizes[ 'Webp Gain map (separate)' ] = humanFileSize( progress.total ); } ); hdrEquirectangularMap = new RGBELoader() - .load( 'textures/gainmap/spruit_sunrise_1k.hdr', function ( ) { + .load( 'textures/equirectangular/spruit_sunrise_1k.hdr', function ( ) { resolutions[ 'HDR' ] = hdrEquirectangularMap.image.width + 'x' + hdrEquirectangularMap.image.height; - + hdrPMREMRenderTarget = pmremGenerator.fromEquirectangular( hdrEquirectangularMap ); hdrEquirectangularMap.mapping = THREE.EquirectangularReflectionMapping; @@ -202,13 +179,13 @@ const gui = new GUI(); - gui.add( params, 'envMap', [ 'HDR JPG', 'Webp Gain map (separate)', 'HDR' ] ).onChange( displayStats ); + gui.add( params, 'envMap', [ 'HDR JPG', 'HDR' ] ).onChange( displayStats ); gui.add( params, 'roughness', 0, 1, 0.01 ); gui.add( params, 'metalness', 0, 1, 0.01 ); gui.add( params, 'exposure', 0, 2, 0.01 ); gui.add( params, 'debug' ); gui.open(); - + function displayStats( value ) { lbl.innerHTML = value + ' size : ' + fileSizes[ value ] + ', Resolution: ' + resolutions[ value ]; @@ -281,10 +258,6 @@ pmremRenderTarget = hdrJpgPMREMRenderTarget; equirectangularMap = hdrJpgEquirectangularMap; break; - case 'Webp Gain map (separate)': - pmremRenderTarget = gainMapPMREMRenderTarget; - equirectangularMap = gainMapBackground; - break; case 'HDR': pmremRenderTarget = hdrPMREMRenderTarget; equirectangularMap = hdrEquirectangularMap;