Reputation: 1
How to overlay an image in RealityKit on a 3D model using code so that it does not stretch to the entire object, but has its own height and width that I can change?
I have a solution on how to do this, but then it will not be possible to change the height, width or place it anywhere on the 3D model. And this is to cut out a part of the object and overlay the image on the entire cutout area. How to overlay a 2D image on a 3D model without stretching the photo to the entire 3D object?
If this is possible, please give an example of how to do this in code. I could not find on the Internet how to do this. Although in other engines this can be done, for example, in Blender or Unity. If I am not mistaken, this is done there using decals
Upvotes: 0
Views: 101
Reputation: 556
You can use Reality Composer Pro’s Shader Graph to implement a Decal.
The principle is similar to the diagram below, but it seems I messed up some parameters, and the final effect is quite off.
I recommend that you first implement the Decal in Blender, and then try to replicate it in Reality Composer Pro. Looking forward to your updates.
Upvotes: 0