From 76165f1afd48743db1ad3c60a99219f69f2b9b10 Mon Sep 17 00:00:00 2001 From: Matthew Cool Date: Thu, 30 Sep 2021 13:56:21 -0700 Subject: [PATCH 1/3] add to dark theme, fix compact more svg --- src/react-components/room/MoreMenuPopover.scss | 10 ++++++++++ themes.json | 9 +++++---- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/src/react-components/room/MoreMenuPopover.scss b/src/react-components/room/MoreMenuPopover.scss index b3a3fa582e..0a6a716d75 100644 --- a/src/react-components/room/MoreMenuPopover.scss +++ b/src/react-components/room/MoreMenuPopover.scss @@ -117,6 +117,16 @@ button:local(.more-menu-item-target) { background-color: theme.$button-bg-color-pressed; } + svg { + *[stroke=\#000] { + stroke: theme.$text1-color; + } + + *[fill=\#000] { + fill: theme.$text1-color; + } + } + @media(min-width: theme.$breakpoint-lg) { display: none; } diff --git a/themes.json b/themes.json index dce79f6c51..ae5a2f4656 100644 --- a/themes.json +++ b/themes.json @@ -48,13 +48,12 @@ "text2-color-hover": "#F5F5F5", "text2-color": "#E7E7E7", "text3-color": "#BBBBBB", - "text4-color": "#E7E7E7", + "text4-color": "#BBBBBB", "secondary-color": "#3A4048", "secondary-color-hover": "#5D646C", "border1-color": "#3A4048", "border2-color": "#5D646C", "border3-color": "#5D646C", - "action-color-highlight": "#ff74a4", "active-color-hover": "#12A4ED", "active-text-color": "#2B313B", "background1-color": "#2B313B", @@ -65,12 +64,14 @@ "accept-color-hover": "#5D646C", "accept-border-color": "#7ED320", "background-hover-color": "#aaaaaa", - "notice-background-color": "#2f80ed", "input-bg-color": "#21242C", "tip-text-color": "#ffffff", "tip-bg-color": "#017ab8", "tip-button-color-hover": "#008bd1", - "action-color": "#ff3464", + "action-color": "#000000", + "action-color-highlight": "#149ce2", + "action-label-color": "#5634ff", + "notice-background-color": "#000000", "toolbar-icon-selected-bg": "#ffffff" } } From 9627be7075266cad5d2bb1a5671013e544444e27 Mon Sep 17 00:00:00 2001 From: Rupert Rawnsley Date: Mon, 4 Oct 2021 12:18:48 +0100 Subject: [PATCH 2/3] Support for OpenEXR textures through the addition of MOZ_texture_exr extension --- src/components/gltf-model-plus.js | 34 ++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/src/components/gltf-model-plus.js b/src/components/gltf-model-plus.js index 0d621a6216..77cae07d37 100644 --- a/src/components/gltf-model-plus.js +++ b/src/components/gltf-model-plus.js @@ -8,6 +8,7 @@ import { disposeNode, cloneObject3D } from "../utils/three-utils"; import HubsTextureLoader from "../loaders/HubsTextureLoader"; import { KTX2Loader } from "three/examples/jsm/loaders/KTX2Loader"; import { RGBELoader } from "three/examples/jsm/loaders/RGBELoader"; +import { EXRLoader } from "three/examples/jsm/loaders/EXRLoader"; THREE.Mesh.prototype.raycast = acceleratedRaycast; @@ -591,6 +592,36 @@ class GLTFMozTextureRGBE { } } +class GLTFMozTextureEXR { + constructor(parser, loader) { + this.parser = parser; + this.loader = loader; + this.name = "MOZ_texture_exr"; + } + + loadTexture(textureIndex) { + const parser = this.parser; + const json = parser.json; + const textureDef = json.textures[textureIndex]; + + if (!textureDef.extensions || !textureDef.extensions[this.name]) { + return null; + } + + const extensionDef = textureDef.extensions[this.name]; + const source = json.images[extensionDef.source]; + return parser.loadTextureImage(textureIndex, source, this.loader).then(t => { + // TODO pretty severe artifacting when using mipmaps, disable for now (assumption copied from GLTFMozTextureRGBE) + if (t.minFilter == THREE.NearestMipmapNearestFilter || t.minFilter == THREE.NearestMipmapLinearFilter) { + t.minFilter = THREE.NearestFilter; + } else if (t.minFilter == THREE.LinearMipmapNearestFilter || t.minFilter == THREE.LinearMipmapLinearFilter) { + t.minFilter = THREE.LinearFilter; + } + return t; + }); + } +} + export async function loadGLTF(src, contentType, onProgress, jsonPreprocessor) { let gltfUrl = src; let fileMap; @@ -608,7 +639,8 @@ export async function loadGLTF(src, contentType, onProgress, jsonPreprocessor) { .register(parser => new GLTFHubsPlugin(parser, jsonPreprocessor)) .register(parser => new GLTFHubsLightMapExtension(parser)) .register(parser => new GLTFHubsTextureBasisExtension(parser)) - .register(parser => new GLTFMozTextureRGBE(parser, new RGBELoader().setDataType(THREE.HalfFloatType))); + .register(parser => new GLTFMozTextureRGBE(parser, new RGBELoader().setDataType(THREE.HalfFloatType))) + .register(parser => new GLTFMozTextureEXR(parser, new EXRLoader().setDataType(THREE.HalfFloatType))); // TODO some models are loaded before the renderer exists. This is likely things like the camera tool and loading cube. // They don't currently use KTX textures but if they did this would be an issue. Fixing this is hard but is part of From 611d132ebb6ad2d123e9381e57c750cd21326340 Mon Sep 17 00:00:00 2001 From: Rupert Rawnsley Date: Mon, 4 Oct 2021 13:33:48 +0100 Subject: [PATCH 3/3] Revert "add to dark theme, fix compact more svg" This reverts commit 76165f1afd48743db1ad3c60a99219f69f2b9b10. --- src/react-components/room/MoreMenuPopover.scss | 10 ---------- themes.json | 9 ++++----- 2 files changed, 4 insertions(+), 15 deletions(-) diff --git a/src/react-components/room/MoreMenuPopover.scss b/src/react-components/room/MoreMenuPopover.scss index 0a6a716d75..b3a3fa582e 100644 --- a/src/react-components/room/MoreMenuPopover.scss +++ b/src/react-components/room/MoreMenuPopover.scss @@ -117,16 +117,6 @@ button:local(.more-menu-item-target) { background-color: theme.$button-bg-color-pressed; } - svg { - *[stroke=\#000] { - stroke: theme.$text1-color; - } - - *[fill=\#000] { - fill: theme.$text1-color; - } - } - @media(min-width: theme.$breakpoint-lg) { display: none; } diff --git a/themes.json b/themes.json index ae5a2f4656..dce79f6c51 100644 --- a/themes.json +++ b/themes.json @@ -48,12 +48,13 @@ "text2-color-hover": "#F5F5F5", "text2-color": "#E7E7E7", "text3-color": "#BBBBBB", - "text4-color": "#BBBBBB", + "text4-color": "#E7E7E7", "secondary-color": "#3A4048", "secondary-color-hover": "#5D646C", "border1-color": "#3A4048", "border2-color": "#5D646C", "border3-color": "#5D646C", + "action-color-highlight": "#ff74a4", "active-color-hover": "#12A4ED", "active-text-color": "#2B313B", "background1-color": "#2B313B", @@ -64,14 +65,12 @@ "accept-color-hover": "#5D646C", "accept-border-color": "#7ED320", "background-hover-color": "#aaaaaa", + "notice-background-color": "#2f80ed", "input-bg-color": "#21242C", "tip-text-color": "#ffffff", "tip-bg-color": "#017ab8", "tip-button-color-hover": "#008bd1", - "action-color": "#000000", - "action-color-highlight": "#149ce2", - "action-label-color": "#5634ff", - "notice-background-color": "#000000", + "action-color": "#ff3464", "toolbar-icon-selected-bg": "#ffffff" } }