I’m currently creating a texture paint in Unity, but I’m having trouble getting it to work.
Does anyone have any knowledge?
As an algorithm, the
- Allocate a shader that displays only UVs on the 3D model to be painted (see image 1) Capture the UV values of the coordinates you want to paint and save them to RenderTarget.
- Use the UV value picked up in step 1 to draw a pen texture at that UV location with another shader. (Attached image 2)
- blit and hold the result of 2. back to 1.
The problem is that the resolution (accuracy?) of the UV at 1 This may be due to the fact that the image quality is low, which results in a mottled, interspersed dot-like drawing as shown in the attached image 2.
(Originally, you want to draw a smooth line like the attached image 3)
Other information.
・The UV is not compressed by VertexCompression in the Player setting.
・The format of RenderTarget is R32G32B32A32_SFLOAT.
・We use sampler2D_float to read the RenderTarget in the shader.
・use HDRP.
・Unity version is 2019.4.0f1
・RenderTexture, which temporarily holds the UV, is 16 * 16, but
The final RenderTexture for painting is 2048 * 2048.