🎥How to use Projector feature

The Projector function projects images onto a 3D model.

This allows 2D images to be pasted onto a 3D model, and the illustrations created with Image generation AI can be used with the 3D model's collision and the occlusion.

Please refer to this scene and prefab.

  • Sample Scene

Assets/Plugins/Witchpot/Packages/Projection/Examples/Demo/Scenes/3DIsometricCityDemo

  • Projector Sample Prefab

Assets/Plugins/Witchpot/Packages/Projection/Examples/Demo/Prefab/Projector.prefab

Prepare 3D model

Create 3D stages in Unity. You can use terrain, AssetStore, ProBuilder, DCC tools, etc...

Image generation with Depth/Normal to Image

Generates images to match the shape of the 3D model.

Please see below page for details on how to generate images using Text2ImgWithControlNet.

Text to Image With ControlNet

Project image using Projector function

Use the CameraImageProjector.cs component to project the image onto the 3D model.

Refer to the prefab below to set up the projector (it is easiest to use the prefab as is)

Assets/Plugins/Witchpot/Packages/Projection/Examples/Demo/Prefab/Projector.prefab

First of all, the object to be projected (the object in the 3D model that will be used as the stage) must be attached a dedicated material.

Using the MaterialApplyer.cs component, the dedicated material will be set to the active object within the camera range. It is also possible to set the material manually.

The parameter settings for the CameraImageProjector.cs component are bellow.

If a material is applied, the Texture will be projected automatically.

Parameter
Settings

Texture Projection

Set the texture to be projected.

Move the generated image (in StreamingAssets/StableDiffusion) you wish to project to a folder of your choice and set TextureType to Sprite

Camera Projection

Sets the camera used to generate the image (a different camera can be used as long as the same position, angle, and other settings are used).

Projection Type

Basically, use Global.

If you want to use more than one projector, set TargetRenderes.

Last updated