'전체 글'에 해당되는 글 162건

  1. 2020.03.13 Texture Painter 사용하기
  2. 2020.02.19 유니티 colorPulse
  3. 2020.02.19 유니티 textureOffset
  4. 2020.02.15 유니티 line renderer로 그리드 생성

1. Texture Painter 작업 환경에 들어감.

2. 좌측에 있는 이미지 아이콘을 눌러서 새로운 텍스처 생성

3. shading에 가서 texture image를 color에 연결시키기

*이미지는 따로 저장해야 한다.
블랜더 파일로는 저장 되지 않음.

페인트 할 때 클라우드 마스크 사용하기
painter에는 이미지가 없어야 됨. 아니면 회색이 동시에 나옴.

페인터 그리드 없애기
좌측에 view에서 uv그리드 끄면 됨.

 

'blender' 카테고리의 다른 글

texture displacemet - 도넛 bump  (0) 2020.03.14
Posted by 도이(doi)
,
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
 
public class colorPulse : MonoBehaviour {
 
    private Material mat;
    public Color colourEnd;
    public Color colourStart;
    private float i;
    private float randomTime;
 
void Start()
{
    colourEnd = Color.black;
    colourStart = Color.red;
    mat = GetComponent<Renderer>().material;
}
void Update()
{
    randomTime = Random.Range(2.0f, 5.0f);
    i += Time.deltaTime;
    mat.SetColor("_EmissionColor", Color.Lerp(colourStart, colourEnd, Mathf.PingPong(i * 2, randomTime)));
}
}
cs


Posted by 도이(doi)
,
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
 
public class textureOffset : MonoBehaviour
{
    public float verticalSpeed;
    public float horizontalSpeed;
 
    Renderer rend;
 
    void Start()
    {
        rend = GetComponent<Renderer>();
    }
 
    void Update()
    {
 
        float vOffset = Time.time * verticalSpeed;
        float hOffset = Time.time * horizontalSpeed;
 
        rend.material.mainTextureOffset = new Vector2(vOffset, hOffset);
    }
}
 
 
cs


Posted by 도이(doi)
,
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
 
public class GridGenerator : MonoBehaviour
{
    public GameObject line;
    private float timeOffset;
    public int lineNum = 10;
    public float lineLength = 100.0f;
    public float speed = 1.0f;
    //public float offset = 2.0f;
    private LineRenderer[] lines;
    private LineRenderer renderLine;
    private Vector3 pos;
 
    void Start()
    {
        lines = new LineRenderer[lineNum];
        pos = this.transform.position;
 
        horizonLines();
        verticalLines();   
    }
 
    private void Update()
    {
        lineMoveToUP();
    }
 
    //first line genarte
    public void instLine()
    {
        var Obj = Instantiate(line, pos, Quaternion.identity);
        Obj.transform.SetParent(transform);
        renderLine = Obj.GetComponent<LineRenderer>();
        renderLine.useWorldSpace = false;
    }
    //vertical lines genarte
    private void verticalLines()
    {
        for (int i = 0; i < lineNum; i++)
        {
            instLine();
            for (int j = 0; j < 2; j++)
            {
                renderLine.SetPosition(j, new Vector3(pos.x + (i * (lineLength / lineNum)),
                                                      pos.y,
                                                      pos.z + (j * lineLength)));
            }
        }
    }
    //horizontal lines genarate
    private void horizonLines()
    {
        for (int i = 0; i < lineNum; i++)
        {
            instLine();
            for (int j = 0; j < 2; j++)
            {
                renderLine.SetPosition(j, new Vector3(pos.x + (j * lineLength),
                                                      pos.y,
                                                      pos.z + (i * (lineLength / lineNum))));
            }
            lines[i] = renderLine;
        }
    }
    //line move to up
    private void lineMoveToUP()
    {
        timeOffset += Time.deltaTime * speed;
        for (int i = 0; i < lineNum; i++)
        {
            for (int j = 0; j < 2; j++)
            {
                lines[i].SetPosition(j, new Vector3(pos.x + (j * lineLength),
                                                    pos.y,
                                                    pos.z + ((i * (lineLength / lineNum) + timeOffset) % lineLength)));
            }
        }
    }
}
cs


Posted by 도이(doi)
,