You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
An example of applying a material override is: scene.overrideMaterial, use the useThree(store => store.scene) hook to get ahold of the scene.
There should be three modes: Wireframe, Solid, Material Preview.
Wireframe should set the overrideMaterial to a wireframe material, solid to one that hard hard edges, and material preview just sets the material override to undefined
Handle edge cases e.g. if userland sets their own material override should be used instead of undefined
Listening for events looks like this, where id is the id set in the controls-three-fiber.tsx file, and scope is "scene".
import { on } from "@triplex/bridge/client";
on("extension-point-triggered", ({ id, scope }) => {});
This issue will implement forced render modes to render the scene in different materials.
ViewportShadingshould be created in a sibling file calledviewport-shading.tsxto https://github.com/trytriplex/triplex/blob/main/packages/renderer/src/features/canvas/canvas.tsx and then rendered in the Canvas component. This component will listen for events and then apply the material overrides.scene.overrideMaterial, use theuseThree(store => store.scene)hook to get ahold of the scene.controls-three-fiber.tsxfile, and scope is "scene".This should be enough to get you started.