質問編集履歴
2
追記
title
CHANGED
File without changes
|
body
CHANGED
@@ -79,4 +79,50 @@
|
|
79
79
|
「Bake」だとプレビューに影のシャドウマスクが選択でき,Assets > Scenes > SampleSceneに追加される
|
80
80
|

|
81
81
|
「Realtime」だとプレビューでshadowmaskがなく影の位置がわからない
|
82
|
-

|
82
|
+

|
83
|
+
###追記2
|
84
|
+
######状況
|
85
|
+
写真の状態で実行すると模様が入った画像が出力されてしまう
|
86
|
+

|
87
|
+

|
88
|
+
######試したこと
|
89
|
+
空のオブジェクトを作成し,作成していただいたShadowCaptorをアタッチ
|
90
|
+
ShadowCaptorにシェーダーをセット
|
91
|
+
Cubeに定期的にCapterを実行する以下のスクリプトをアタッチ
|
92
|
+
```C#
|
93
|
+
using System.Collections;
|
94
|
+
using System.Collections.Generic;
|
95
|
+
using UnityEngine;
|
96
|
+
|
97
|
+
public class test : MonoBehaviour
|
98
|
+
{
|
99
|
+
private float timeleft;
|
100
|
+
GameObject gameobject;
|
101
|
+
Renderer cubeRenderer;
|
102
|
+
private string path;
|
103
|
+
private string fileName = "shadow.png";
|
104
|
+
private Material material;
|
105
|
+
|
106
|
+
// Start is called before the first frame update
|
107
|
+
void Start()
|
108
|
+
{
|
109
|
+
gameobject = GameObject.Find("GameObject");
|
110
|
+
path = Application.dataPath + "/" + fileName;
|
111
|
+
cubeRenderer = GetComponent<Renderer>();
|
112
|
+
}
|
113
|
+
void Update()
|
114
|
+
{
|
115
|
+
timeleft -= Time.deltaTime;
|
116
|
+
if (timeleft <= 0.0)
|
117
|
+
{
|
118
|
+
timeleft = 5.0f;
|
119
|
+
|
120
|
+
//ここに処理
|
121
|
+
gameobject.GetComponent<ShadowCaptor>().Capture(cubeRenderer, path);
|
122
|
+
|
123
|
+
}
|
124
|
+
|
125
|
+
}
|
126
|
+
|
127
|
+
}
|
128
|
+
```
|
1
現況の説明
title
CHANGED
File without changes
|
body
CHANGED
@@ -72,4 +72,11 @@
|
|
72
72
|
例えば,その座標の影を含めた色データをビルドに取得するという内容でも大丈夫です.
|
73
73
|
|
74
74
|
UnityおよびC#は初心者で3日間これで頭を悩ませているので教えていただけると大変助かります.
|
75
|
-
よろしくお願いします.
|
75
|
+
よろしくお願いします.
|
76
|
+
|
77
|
+
|
78
|
+
### 追記
|
79
|
+
「Bake」だとプレビューに影のシャドウマスクが選択でき,Assets > Scenes > SampleSceneに追加される
|
80
|
+

|
81
|
+
「Realtime」だとプレビューでshadowmaskがなく影の位置がわからない
|
82
|
+

|