-- Leo's gemini proxy
-- Connecting to git.thebackupbox.net:1965...
-- Connected
-- Sending request
-- Meta line: 20 text/gemini
repo: janusweb action: commit revision: path_from: revision_from: 5058c9c78f121957a2257db1c79e83eec22afa16: path_to: revision_to:
commit 5058c9c78f121957a2257db1c79e83eec22afa16 Author: James Baicoianu <james_github@baicoianu.com> Date: Thu May 9 12:28:08 2019 -0700 Support .normalMap and .bumpMap separately diff --git a/scripts/object.js b/scripts/object.js
--- a/scripts/object.js +++ b/scripts/object.js @@ -484,7 +484,21 @@ elation.require(['janusweb.janusbase', 'janusweb.websurface'], function() { this.assignTextureParameters(m.map, modelasset, asset); } } - if (m.bumpMap) { + if (m.normalMap) { + var imagesrc = m.normalMap.sourceFile; + var asset = this.getAsset('image', imagesrc, {id: imagesrc, src: imagesrc, hasalpha: false}); + if (asset) { + m.normalMap = asset.getInstance(); + m.normalMap = asset.getInstance(); + elation.events.add(m.normalMap, 'asset_update', elation.bind(this, function(ev) { + m.normalMap = ev.data; this.refresh(); + m.normalMap.offset.copy(this.texture_offset); + m.normalMap.repeat.copy(this.texture_repeat); + m.normalMap.rotation = this.texture_rotation * THREE.Math.DEG2RAD; + })); + elation.events.add(m.normalMap, 'asset_load', elation.bind(this, function(ev) { m.normalMap = ev.data; this.refresh(); })); + } + } else if (m.bumpMap) { var imagesrc = m.bumpMap.sourceFile; var asset = this.getAsset('image', imagesrc, {id: imagesrc, src: imagesrc, hasalpha: false}); if (asset) {
-----END OF PAGE-----
-- Response ended
-- Page fetched on Sun Jun 2 17:18:41 2024