Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(remix-dev): Add loaders config for 3d models #4457

Conversation

ikarus-akhil
Copy link

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-bot
Copy link

changeset-bot bot commented Oct 31, 2022

🦋 Changeset detected

Latest commit: 2254eef

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

@machour machour linked an issue Oct 31, 2022 that may be closed by this pull request
Copy link
Collaborator

@machour machour left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your PR 🙏
We also need you to generate the changeset, see the comment added by the bot on the PR.

@machour machour changed the title Added loaders config for 3d models feat(remix-dev): Add loaders config for 3d models Oct 31, 2022
@remix-cla-bot
Copy link
Contributor

remix-cla-bot bot commented Nov 2, 2022

Thank you for signing the Contributor License Agreement. Let's get this merged! 🥳

@ikarus-akhil
Copy link
Author

@machour Have made the appropriate changes.

@ikarus-akhil
Copy link
Author

@machour Can you please review the code and approve it it is okay, as we need these loaders for our project.

@machour machour self-requested a review November 8, 2022 19:40
@machour
Copy link
Collaborator

machour commented Nov 8, 2022

@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 #4549 that will turn into an RFC soon and hopefully make it to Remix.

@ikarus-akhil
Copy link
Author

@machour I have resolved the conflict, can you please merge this code.

Copy link
Collaborator

@machour machour left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Something is wrong with the changesets, it seems you edited an old one and included it again as new?

@ikarus-akhil
Copy link
Author

@machour Sorry for the delay and all the trouble, was having problem with the changeset but now I think it should be good.

@chaance
Copy link
Collaborator

chaance commented Feb 9, 2023

Looks like this was shipped in 1.11, resolved in #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!

@chaance chaance closed this Feb 9, 2023
chaance added a commit that referenced this pull request Feb 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

No loader is configured for .glb and .hdr files
3 participants