# 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.

{% embed url="<https://youtu.be/xDh6yVBkNWk>" %}

Please refer to this scene and prefab.

* Sample Scene

<mark style="background-color:blue;">Assets/Plugins/Witchpot/Packages/Projection/Examples/Demo/Scenes/3DIsometricCityDemo</mark>

* Projector Sample Prefab

<mark style="background-color:blue;">Assets/Plugins/Witchpot/Packages/Projection/Examples/Demo/Prefab/Projector.prefab</mark>

### Prepare 3D model

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

{% embed url="<https://youtu.be/9qFKnrIIgio>" %}

### 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](/english/components/text-to-image-with-controlnet.md)

<figure><img src="/files/sbD93OElAuoqHSSkMngo" alt=""><figcaption></figcaption></figure>

### 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)

<mark style="background-color:blue;">Assets/Plugins/Witchpot/Packages/Projection/Examples/Demo/Prefab/Projector.prefab</mark>

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.

<figure><img src="/files/c5L02XJuyD6H3ddX4Hjh" alt=""><figcaption></figcaption></figure>

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

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

<table><thead><tr><th width="191">Parameter</th><th>Settings</th></tr></thead><tbody><tr><td>Texture Projection</td><td><p>Set the texture to be projected.</p><p>Move the generated image (in StreamingAssets/StableDiffusion) you wish to project to a folder of your choice and set TextureType to Sprite</p></td></tr><tr><td>Camera Projection</td><td>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).</td></tr><tr><td>Projection Type</td><td><p>Basically, use Global. </p><p>If you want to use more than one projector, set TargetRenderes.</p></td></tr></tbody></table>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.witchpot.com/english/production-tips/how-to-use-projector-feature.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
