ybniaobu / dsh-3d-viewer
Preview 3D models and textures from the session workspace in DSH's right sidebar. Supported formats include FBX, OBJ, glTF, GLB, DAE, and STL models, plus PNG, JPEG, TGA, EXR, and HDR textures.
About this plugin
Written by the registry from verified metadata, not from the README.
dsh-3d-viewer is a DSH plugin published from the ybniaobu/dsh-3d-viewer repository.
Capabilities and topics
English | 中文
Preview 3D models and textures from the session workspace in DSH's right sidebar. Supported formats include FBX, OBJ, glTF, GLB, DAE, and STL models, plus PNG, JPEG, TGA, EXR, and HDR textures. Orbit, zoom, switch camera views, materials and environments, and play embedded animations.

Installation
The plugin is distributed as the npm package dsh-3d-viewer. The Three.js runtime and format decoders load only when a preview is opened.
Install from npm (recommended)
- Open DSH Desktop and choose Plugins in the sidebar.
- Click Add plugin → Install a third-party plugin.
- Enter
dsh-3d-viewer(ordsh-3d-viewer@0.3.0to pin a version). - Set Registry to the official npm registry (npmmirror also works in mainland China).
- Click Install, then confirm 3D Viewer is On under Installed plugins.
Install from a local directory (optional)
- Unpack the plugin directory anywhere.
- Open DSH Desktop and choose Plugins in the sidebar.
- Click Add plugin → Install a third-party plugin.
- Enter the directory's absolute path (for example
F:\plugins\dsh-3d-viewer) and click Install. - Confirm 3D Viewer is On under Installed plugins.
Plugins run inside the DSH process; install only trusted sources.
Requirements
- DSH Desktop 0.2.2-rc.3 or newer.
- WebGL 2.
- The model or texture must be in the session workspace.
Usage
Open the right sidebar, choose Files (Mod+P), and click a supported file.
Model previews: drag to orbit, scroll to zoom, and right-drag to pan. The toolbar resets the view, starts auto-rotation, and toggles the grid and wireframe. Click or drag the orientation axes to change the camera view. Material and environment pickers are in the top-right controls. When the model has animation clips, the animation bar appears above the bottom hint: use play/pause, pick a clip by name, drag the progress slider to seek, and choose a playback speed from 0.5× to 2×. Switching clips resets to that clip's first frame while preserving the current play/pause state.
Texture previews: scroll to zoom, drag to pan when zoomed, and use Fit or double-click to reset. Flip Y handles bottom-up sources. The badge shows dimensions, bit depth, and zoom.
Large files and the first environment switch may take a few seconds. If no preview appears, refresh the page and then restart DSH.
Supported formats
Model previews
| Format | Support |
|---|---|
| FBX | Meshes, hierarchy, materials, embedded textures, animations, node data |
| OBJ | Polygons, groups, normals, UVs, vertex colors, lines/points, MTL, common textures |
| glTF / GLB | Animations, skinning, embedded resources, external .bin files and textures |
| DAE | COLLADA meshes, materials, external textures, and animations |
| STL | ASCII and binary, neutral PBR material, binary vertex colors |
Notes:
- Embedded lights, cameras, and audio are ignored.
- External textures are read from the workspace.
- Missing FBX textures only warn.
- OBJ missing MTL uses default materials; missing textures use white placeholders.
- glTF/GLB external
.binfiles and textures must exist in the workspace; missing resources can prevent loading. - glTF Draco, Meshopt, and KTX2 extensions are not supported.
- DDS, KTX2, PVR, and other formats without a bundled decoder are not supported.
- MTL
map_Ks/map_Nsare not fully mapped to PBR. - STL has no materials or animations.
Texture previews
| Format | Decoded data | Preview |
|---|---|---|
| PNG | 8-bit RGBA | Direct pixels, alpha preserved |
| JPG / JPEG | 8-bit RGBA | Direct pixels, alpha preserved |
| TGA | 8-bit RGBA | Direct pixels, alpha preserved |
| EXR | 16-bit half or 32-bit float, 1–4 channels | Tone-mapped to SDR |
| HDR | Radiance RGBE, 16-bit half by default | Tone-mapped to SDR |
- EXR and HDR use exposure 1 and Reinhard tone mapping before sRGB output.
- HDR previews use a WebGL2 tone-mapping pass when available, with a half-float CPU fallback.
- Previews are cached by resource address, version, and format (160 MiB; 64 MiB on low-memory devices).
Code structure
| Area | Main files |
|---|---|
| Host and package | index.js, cordis.patch.yml, package.json |
| Core | src/core/: byte helpers, formats, model statistics |
| Client registration | src/client.js, src/core/formats.js, src/core/texture-formats.js |
| Lazy runtime | src/runtime.js, src/ui/viewer-runtime.js, src/loaders/address.js |
| Lazy UI chunks | client.ui.styles.js, client.ui.texture.js, client.locales.*.js |
| UI | src/ui/: chrome, controls, preferences; ui/model/ and ui/texture/ for the two viewers |
| Scene | src/scene/: renderer, camera, materials, environment, grid, post-processing |
| Loaders | src/loaders/: dispatch, workspace reads, texture workers, formats/ loaders |
| Vendored code | src/vendor/: modified FBX loader |
| Build and tests | build.mjs, tests/run.mjs, tests/**/*.mjs |
src/client.js only registers previews; src/runtime.js owns Three.js, scene setup, and lazy format dispatch. The UI shell does not import Three.js directly; scene code and the texture WebGL preview load with the lazy runtime. Styles, non-baseline locale dictionaries, and the texture viewer are also package-local UI chunks; English and Chinese dictionaries stay in the entry bundle as the DSH fallbacks.
Development
npm ci
npm test
npm run build
CI uses Node.js 24. npm test runs each tests/**/*.mjs file in its own process.
npm run build writes the UI entry, lazy runtime, format/texture chunks, UI style/locale/texture chunks, and the EXR/HDR worker to dist/. Commit the rebuilt dist/ files when source changes.
License
MIT; see LICENSE. Third-party notices are in THIRD_PARTY_NOTICES.md, including Three.js (MIT) and Poly Haven HDRIs (CC0). React is provided by DSH.
Badge
Listed here? Link back with this badge — paste the snippet into your repository README.
[](https://dsh-plugin.com/plugins/ybniaobu/dsh-3d-viewer)