How do I set a custom input node on a RealityKit shader graph?

Generated on 7/26/2024

1 search

Tailscan

This post is brought to you by Tailscan, the best devtool for Tailwind CSS.

To set a custom input node on a RealityKit shader graph, you can follow these steps:

  1. Open Reality Composer Pro: Start by opening your project in Reality Composer Pro.

  2. Select Your Material: Choose the material you want to customize in the shader graph.

  3. Promote to Input: Right-click on the file references or parameters you want to expose as inputs and select "Promote to Input." This will make those inputs accessible in the panel on the right.

  4. Create Material Instances: Once you have promoted the necessary inputs, you can create material instances. Right-click on your main material and select "Create Material Instance." This allows you to reuse the logic of one material while being able to change exposed parameters, which is efficient for both setup and performance.

For more detailed guidance, you can refer to the session Optimize your 3D assets for spatial computing (11:12).

If you need a primer on setting up materials and shader graphs, the session "Explore materials in Reality Composer Pro" from 2023 is highly recommended.

Build a spatial drawing app with RealityKit

Build a spatial drawing app with RealityKit

Harness the power of RealityKit through the process of building a spatial drawing app. As you create an eye-catching spatial experience that integrates RealityKit with ARKit and SwiftUI, you’ll explore how resources work in RealityKit and how to use features like low-level mesh and texture APIs to achieve fast updates of the users’ brush strokes.

Optimize your 3D assets for spatial computing

Optimize your 3D assets for spatial computing

Dive into an end-to-end workflow for optimized 3D asset creation. Discover best practices for optimizing meshes, materials, and textures in your digital content creation tool. Learn how to harness shader graph, baking, and material instances to enhance your 3D scene while optimizing performance. Take advantage of native tools to work more effectively with your assets and improve your app’s performance.

Discover RealityKit APIs for iOS, macOS and visionOS

Discover RealityKit APIs for iOS, macOS and visionOS

Learn how new cross-platform APIs in RealityKit can help you build immersive apps for iOS, macOS, and visionOS. Check out the new hover effects, lights and shadows, and portal crossing features, and view them in action through real examples.

What’s new in USD and MaterialX

What’s new in USD and MaterialX

Explore updates to Universal Scene Description and MaterialX support on Apple platforms. Discover how these technologies provide a foundation for 3D content creation and delivery, and learn how they can help streamline your workflows for creating great spatial experiences. Learn about USD and MaterialX support in RealityKit and Storm, advancements in our system-provided tooling, and more.