|
| 1 | +--- |
| 2 | +author: Michael Dougall |
| 3 | +title: June 2025 Update |
| 4 | +date: 2025-06-01 |
| 5 | +image: /blogs/2025-june-update/webxr.png |
| 6 | +description: Here's what's been happening since Triplex for VS Code was released. |
| 7 | +--- |
| 8 | + |
| 9 | +Hey folks! Here's some updates on what's been happening over the last few months, there's some exciting new features, an open source announcement, and a look at what's coming next. |
| 10 | + |
| 11 | +As always if you have thoughts, questions, or feedback, please reach out on [Discord](https://discord.gg/nBzRBUEs4b). And [install Triplex for VS Code](https://marketplace.visualstudio.com/items?itemName=trytriplex.triplex-vsce) if you haven't already! |
| 12 | + |
| 13 | +<KnowledgeCallout> |
| 14 | + The Triplex renderer and other packages are [open source on |
| 15 | + GitHub](https://github.com/trytriplex/triplex). I'd love for you to contribute |
| 16 | + and make a positive impact on everyone who uses Triplex, check out [these |
| 17 | + issues to get |
| 18 | + started](https://github.com/trytriplex/triplex/issues?q=is%3Aissue%20state%3Aopen%20label%3A%22Contribution%20ready%22) |
| 19 | + and make sure to join our [Discord community](https://discord.gg/nBzRBUEs4b). |
| 20 | +</KnowledgeCallout> |
| 21 | + |
| 22 | +## View and Edit 3D Components in Your VR Headset |
| 23 | + |
| 24 | +WebXR is a pretty dope piece of tech and React Three Fiber has great support for it thanks to the [XR package](https://github.com/pmndrs/xr) — loads of people use it to create immersive experiences for the browser. Triplex now supports [opening 3D components in WebXR](https://x.com/dougesdev/status/1914457718221619328/video/1) so you can view, interact, and transform 3D components in your headset. |
| 25 | + |
| 26 | + |
| 27 | + |
| 28 | +It's experimental so you need to enable it in your config file: |
| 29 | + |
| 30 | +```json filename=".triplex/config.json" {2-4} |
| 31 | +{ |
| 32 | + "experimental": { |
| 33 | + "xr_editing": true |
| 34 | + } |
| 35 | +} |
| 36 | +``` |
| 37 | + |
| 38 | +See the [Triplex WebXR](/docs/building-your-scene/webxr) docs for details on using it. |
| 39 | + |
| 40 | +## Log Data to the Debug Panel From Anywhere |
| 41 | + |
| 42 | +A really common use case when building components is logging data at a point in time to see what the value is. During the Three.js game jam I was [building a game that didn't ship](https://github.com/trytriplex/ekka-game) (😅) and I really needed to debug some [Koota](https://github.com/pmndrs/koota) ECS systems (it's a great library, go give it a star!). |
| 43 | + |
| 44 | + |
| 45 | + |
| 46 | +Enter the debug panel with pairing global Triplex APIs. You can call this from anywhere and it'll log data to the debug panel, repeated calls override previous ones, and you can even call it inside your frame loops without worrying about performance! |
| 47 | + |
| 48 | +```tsx filename="scene.tsx" |
| 49 | +useFrame(() => { |
| 50 | + window.triplex?.debug("ecs: players", { data: [{}] }); |
| 51 | +}); |
| 52 | +``` |
| 53 | + |
| 54 | +This is also experimental so you need to enable it in your config file: |
| 55 | + |
| 56 | +```json filename=".triplex/config.json" {2-4} |
| 57 | +{ |
| 58 | + "experimental": { |
| 59 | + "debug_api": true |
| 60 | + } |
| 61 | +} |
| 62 | +``` |
| 63 | + |
| 64 | +See the [Debug Panel](/docs/building-your-scene/console-logs/debug-panel) docs for details on using it. |
| 65 | + |
| 66 | +## Do More With Transform Controls |
| 67 | + |
| 68 | +Transform controls have had a massive update to make them useful across more scenarios. For 3D components that accept transform props (`position`, `rotation`, and `scale`) transform controls now flushes updates through props instead of mutating the Three.js object itself. |
| 69 | + |
| 70 | + |
| 71 | + |
| 72 | +This has unblocked some novel use cases, such as: |
| 73 | + |
| 74 | +- [Positioning the decal component](https://x.com/trytriplex/status/1927235641537962323) on meshes |
| 75 | +- [Positioning bones](https://x.com/dougesdev/status/1928967155455778924) on skinned meshes |
| 76 | +- [Positioning individual instances](https://x.com/BrianBreiholz/status/1867560190452596828) of instanced / batched meshes set through effects |
| 77 | + |
| 78 | +All without needing to write extra code to wire up the transform controls yourself! This is another reason why you'd be more productive with Triplex and React Three Fiber over vanilla Three.js. |
| 79 | + |
| 80 | +See [Using Transform Controls With Virtual Scene Components](/resources/virtual-three-components) for more details. |
| 81 | + |
| 82 | +## Use Koota More Easily With API Helpers |
| 83 | + |
| 84 | +For those using [Koota](https://github.com/pmndrs/koota) (a new state management library out of pmndrs) I've built helpers to make it more easily integrate into your components and Triplex. There are now two experimental APIs in the `@triplex/api` package: |
| 85 | + |
| 86 | +- `createSystem(system: Function, args: string | object)` — lets you create a function that can be named and flagged as dev only where appropriate, like creating dev time systems for debugging purposes! |
| 87 | +- `injectSystems(component: Function, args: System[])` — lets you inject systems into a 3D component, it automatically adds props to the component which can then be set using Triplex input controls. |
| 88 | + |
| 89 | +See the [API docs](https://github.com/trytriplex/triplex/tree/main/packages/api#koota) for details on using it and example usage in the [Ekka Escape canvas provider](https://github.com/trytriplex/ekka-game/blob/main/apps/ekka-client/.triplex/providers.tsx#L39). |
| 90 | + |
| 91 | +## Use Post-Processing Through the Editor |
| 92 | + |
| 93 | +React Three Fiber has a great post-processing library `@react-three/postprocessing` that easily and performantly applies effect passes to your 3D components. Thanks to a [contribution from mommysgoodpuppy](https://github.com/trytriplex/triplex/pull/312) you can now render them inside Triplex when looking through the Triplex editor camera. |
| 94 | + |
| 95 | +See the [Caustics canvas provider](https://github.com/trytriplex/triplex/blob/main/examples/caustics/.triplex/provider.tsx#L19) for an example on using this. |
| 96 | + |
| 97 | +## Inputs and More Are Now Open Source |
| 98 | + |
| 99 | +Continuing our open source journey the `@triplex/ux` package is [now open source](https://github.com/trytriplex/triplex/tree/main/packages/ux) which includes code for: |
| 100 | + |
| 101 | +- input components, such as the [number input](https://github.com/trytriplex/triplex/blob/main/packages/ux/src/inputs/number-input.tsx#L62) |
| 102 | +- a native-like [menu component](https://github.com/trytriplex/triplex/blob/main/packages/ux/src/menu.tsx) that uses a select element; and |
| 103 | +- a simple [native dialog component](https://github.com/trytriplex/triplex/blob/main/packages/ux/src/dialog.tsx) |
| 104 | + |
| 105 | +These power core experiences across Triplex, I'd love you to take a look, get inspired, and even contribute some improvements to them! |
| 106 | + |
| 107 | +## Advanced Usage With Custom Vite Configs |
| 108 | + |
| 109 | +Triplex has always strived to minimize the amount of configuration needed by users to get started. The shortest path after all is installing Triplex for VS Code and then opening a component using the "Open in Triplex" CodeLens action! |
| 110 | + |
| 111 | +The reality however is some people just have more custom needs. To meet them in the middle there's now a new config option: `UNSAFE_viteConfig`. You can point this to a custom Vite config where you can define your custom behavior as needed, such as transforming imports to point to a CDN instead of locally. |
| 112 | + |
| 113 | +See the [UNSAFE_viteConfig](/docs/api-reference/config-options/unsafe-vite-config) docs for details on using it. |
| 114 | + |
| 115 | +## Get Started With Point & Click |
| 116 | + |
| 117 | +For those wanting to start a project quickly there's now a point & click template available through the `create-triplex-project` CLI, it's great for getting a step on your next 3D web experience! |
| 118 | + |
| 119 | +```bash filename="Terminal" |
| 120 | +npx create-triplex-project@latest --template point-and-click |
| 121 | +``` |
| 122 | + |
| 123 | +See the [Point & Click](/docs/get-started/starting-a-project/create-from-template/point-and-click) docs for details on using it. |
| 124 | + |
| 125 | +## Exploring AI Chat |
| 126 | + |
| 127 | +AI assisted coding is huge right now, and seeing where it could fit into a Triplex workflow is super compelling. Rather than waiting for the code to be updated through Copilot / Cursor it could be changed directly in the scene by AI, hook into the undo / redo / save workflow you're used to, and enable you to quickly iterate on your components. |
| 128 | + |
| 129 | + |
| 130 | + |
| 131 | +This feature isn't good enough to ship yet, when it's in a state that is more useful than not it'll be available for early adopters (maybe you!). |
| 132 | + |
| 133 | +## Wrapping Up |
| 134 | + |
| 135 | +Slow and steady wins the race? Maybe. Either way it's been fun working on these features and seeing users find value in Triplex! I'm still dusting at the surface for what will help you use your tools more effectively, if you have thoughts on features that would be useful to you and your team please [post a message on Discord ](https://discord.gg/nBzRBUEs4b) or email me directly at [email protected]. |
| 136 | + |
| 137 | +I'd love to learn more about what you're working on! |
| 138 | + |
| 139 | +In the meantime I'll be moving house from Sydney to Canberra (still in Australia) at the end of June! It's coming up real soon and hectic as with two kids, but I'm excited to start our next stage of life 😁. Wish us luck! |
| 140 | + |
| 141 | +[mike douges](https://x.com/dougesdev) |
0 commit comments