Paint in to Texture
In this tutorial you will solve following problem
At the end of this page you will find a link to the package with all required scripts and scene from this tutorial
1. Create new BGPageConfig
We need to create new page config which will hold the predefined texture so let's create a new class with following content
As you see it's just hold additional texture which will be used later.
So let's create a new page config with BGTexture
and then just assign your texture to the BGTexture property
2. Setup Brush
As you seen in another demos, there is already tool which able to use texture to draw it's a advanced eraser or pattern brush.
Let's clone advanced eraser brush in the Paintcraft->BrushPack->Advanced->Eraser folder
If you will look inside this brush (menu: Window->Paintcraft->BrushSetup) you will see that it use filter BindTileTexToStartImage
What this filter does is assign start texture from page config to the material used by the tool. And what we need to do is just assign different texture (our BGTexture) to that material.
Create a new script BindTileTexToStartImage.cs with following content
Now select your brush which you cloned before. rename it to the BGBrush and select BrushSetup and replace filter BindTileTexToStartImage _to filter _BindTileTexToBG
3. Setup scene
Let's just copy OnePlayerBasic scene and change tools and page configs.
In PaintcraftCanvas select the page which you created at step 1
In line config select the same BGBrush.
That's it. now if you will start painting you will have similar behaviour as on the first screenshot of this tutorial.
4. Package
If you will have any issues just download the package which contains this scene and all required scripts and configs
https://www.dropbox.com/s/ans9ci92990oqj6/BGTexture.unitypackage?dl=0
Last updated