remix
remix copied to clipboard
feat(remix-dev): Add loaders config for 3d models
Adds support for importing .glb, .gltf and .hdr files.
Closes: #4430
Testing Strategy:
I was able to import .glb and .hdr files and use them in google model viewer linked using its CDN.
import model from "../../public/mod/Hololens.glb";
import env from "../../public/mod/Neutral.hdr";
const Model = () => {
return (
<model-viewer
style={{ height: "100vh", width: "100vw" }}
src={model}
shadow-intensity="1"
camera-controls
touch-action="pan-y pinch-zoom"
environment-image={env}
camera-orbit="calc(-0.25rad + env(window-scroll-y) * 12rad) calc(90deg + env(window-scroll-y) * 45deg) calc(10m - env(window-scroll-y) * 10m)"
/>
);
};
export default Model;
🦋 Changeset detected
Latest commit: 2254eefd04dbdb9d3a7d45fcf50e8a8450ccca1a
The changes in this PR will be included in the next version bump.
This PR includes changesets to release 18 packages
| Name | Type |
|---|---|
| @remix-run/dev | Minor |
| create-remix | Minor |
| @remix-run/css-bundle | Minor |
| remix | Minor |
| @remix-run/architect | Minor |
| @remix-run/cloudflare | Minor |
| @remix-run/cloudflare-pages | Minor |
| @remix-run/cloudflare-workers | Minor |
| @remix-run/deno | Minor |
| @remix-run/eslint-config | Minor |
| @remix-run/express | Minor |
| @remix-run/netlify | Minor |
| @remix-run/node | Minor |
| @remix-run/react | Minor |
| @remix-run/serve | Minor |
| @remix-run/server-runtime | Minor |
| @remix-run/testing | Minor |
| @remix-run/vercel | Minor |
Not sure what this means? Click here to learn what changesets are.
Click here if you're a maintainer who wants to add another changeset to this PR
Thank you for signing the Contributor License Agreement. Let's get this merged! 🥳
@machour Have made the appropriate changes.
@machour Can you please review the code and approve it it is okay, as we need these loaders for our project.
@ikarus-akhil there seem to be a conflict with the changeset file, other than that looks good to me. 👌🏼 Someone from the Remix team will eventually attend this.
In the mean time, if you can't wait any longer, I suggest using https://www.npmjs.com/package/patch-package to apply these changes on your project.
You might also be interested in this proposal https://github.com/remix-run/remix/discussions/4549 that will turn into an RFC soon and hopefully make it to Remix.
@machour I have resolved the conflict, can you please merge this code.
@machour Sorry for the delay and all the trouble, was having problem with the changeset but now I think it should be good.
Looks like this was shipped in 1.11, resolved in https://github.com/remix-run/remix/pull/5030. I'm going to close this but I'll add @ikarus-akhil to our contributors list since we dropped the ball on reviewing in a timely manner. Sorry about that!