こんにちは、私はUnityとSpineを使ってゲームを制作しています。
以下のような画像の赤枠内をユーザーが編集してStreamingAsssetから読み込ませれば、スケルトンデータを生成しユーザーがSpineのテクスチャーを書き換えることができる機能を制作していていてUnityEditorではこの機能が正常に動くことを確認しています。画像は透過を使用しています。
しかしながらビルドして同じことをしてみると以下のように透明部分が反映されないことに困っています。
1つ目の画像のときのようにSpine/SkeletonのShaderでStraightAlphaTextureをTrueにすることでEditorでは透明化することができることは確認できているのですが、Buildではではこれが反映されていないようです。
いろいろなことを試していますがもう3日は頭を抱えています、どうか助けてください。
・試したこと
Texture2DのalphaIsTransparency関連で警告がでるのでこれをスクリプトで生成したtextureに対してtrueに変更しようと試みましたが、これもEditorでは問題ないのですがBuildだとそのステータスは存在しないと出てビルドができません。
・バージョン
Unity2019.4.1f1 SpineRuntime3.8-2019-08-29 Windows10Standalone
1. sayfa (Toplam 1 sayfa)
saebashi
Bu mesaja eklenen dosyaları görüntülemek için gerekli yetkilere sahip değilsiniz.
2 years ago
-
saebashi - Mesajlar: 7
Harald
これは、テクスチャの
これはまるで
a)マテリアルのシェーダープロパティ「ストレートアルファテクスチャ」が無効になっている、または
b)マテリアルは別のシェーダーを使用しています。おそらく、「Spine / Skeleton」が見つからなかったためです。
使用中のシェーダーを表示するデバッグ出力(またはテキストラベル)と、ゲーム内のビルドで実際に使用される「ストレートアルファテクスチャ」パラメーターを追加できます。
This does not looks as if it is the
This looks very much as if
a) The Material has the shader property
b) The Material uses a different shader, perhaps because
You could add debug output (or text label) which displays the used shader and the
Alpha Is Transparency
プロパティのようには見えません。これはまるで
a)マテリアルのシェーダープロパティ「ストレートアルファテクスチャ」が無効になっている、または
b)マテリアルは別のシェーダーを使用しています。おそらく、「Spine / Skeleton」が見つからなかったためです。
使用中のシェーダーを表示するデバッグ出力(またはテキストラベル)と、ゲーム内のビルドで実際に使用される「ストレートアルファテクスチャ」パラメーターを追加できます。
This does not looks as if it is the
Alpha Is Transparency
property at the Texture.This looks very much as if
a) The Material has the shader property
Straight Alpha Texture
disabled, orb) The Material uses a different shader, perhaps because
Spine/Skeleton
could not be found.You could add debug output (or text label) which displays the used shader and the
Straight Alpha Texture
parameter which is actually used in your build while in-game. 2 years ago
-
Harald - Mesajlar: 4449
saebashi
Harald さん。以前もあなたにお世話になりました、お返事本当にありがとうございます。
あなたに頂いたチェック項目を見直してみたのですが、ビルドコンソールで確認してみると正しくステータスが設定されているようです。
UnityEditorで実行した際はではこの問題は発生せず、最初の投稿の最初の画像のように正しく表示されます。
またinspectorでもステータスが正しくセットされていることは確認できます。
あなたに頂いたチェック項目を見直してみたのですが、ビルドコンソールで確認してみると正しくステータスが設定されているようです。
コメント 2020-08-25 144044.jpg
UnityEditorで実行した際はではこの問題は発生せず、最初の投稿の最初の画像のように正しく表示されます。
またinspectorでもステータスが正しくセットされていることは確認できます。
Bu mesaja eklenen dosyaları görüntülemek için gerekli yetkilere sahip değilsiniz.
2 years ago
-
saebashi - Mesajlar: 7
Harald
お返事をありがとうございます。 この問題がまだ残っている最小限のUnityプロジェクトを、zipパッケージとしてcontact@esotericsoftware.comに送っていただけませんか。 次に、何が問題なのかを確認できます。
Thanks for your reply. Could you perhaps send us a minimal Unity project that still shows this problem, as a zip package to contact@esotericsoftware.com? Then we can have a look at what is going wrong.
---
再現パッケージを送っていただきありがとうございます。
Thanks for sending the reproduction package.
シェーダキーワード
I missed to point out that the shader keyword
そのため、以下の行をあなたのコードに追加することで修正することができます。
Thanks for your reply. Could you perhaps send us a minimal Unity project that still shows this problem, as a zip package to contact@esotericsoftware.com? Then we can have a look at what is going wrong.
---
再現パッケージを送っていただきありがとうございます。
Thanks for sending the reproduction package.
シェーダキーワード
_STRAIGHT_ALPHA_INPUT
がマテリアルに設定されている必要があることを指摘するのを見落としていました。Straight Alpha Texture
パラメータは、エディタでトグルすると自動的にこのキーワードを設定しますが、コードで設定した場合は設定しません。I missed to point out that the shader keyword
_STRAIGHT_ALPHA_INPUT
needs to be set at the material, sorry that I did not think of that before. The Straight Alpha Texture
parameter automatically sets this keyword when toggled in the Editor, but not when set via code.そのため、以下の行をあなたのコードに追加することで修正することができます。
material.SetFloat ("_StraightAlphaInput", 1.0f).
// 以下の行を追加する必要があります。
material.EnableKeyword("_STRAIGHT_ALPHA_INPUT")。
So it can be fixed by adding the following line of code to yours:// 以下の行を追加する必要があります。
material.EnableKeyword("_STRAIGHT_ALPHA_INPUT")。
material.SetFloat ("_StraightAlphaInput", 1.0f);
// the following line needs to be added:
material.EnableKeyword("_STRAIGHT_ALPHA_INPUT");
// the following line needs to be added:
material.EnableKeyword("_STRAIGHT_ALPHA_INPUT");
2 years ago
-
Harald - Mesajlar: 4449
saebashi
Harald さん。
正常にデータを読込し、透明部分もうまくいきました。
問題が解決しました、あなたのおかげです!
本当にありがとうございます
正常にデータを読込し、透明部分もうまくいきました。
問題が解決しました、あなたのおかげです!
本当にありがとうございます

2 years ago
-
saebashi - Mesajlar: 7
Harald
ご返信いただきありがとうございます。正常に機能しました。
Thanks for getting back to us, glad it works now!
Thanks for getting back to us, glad it works now!
2 years ago
-
Harald - Mesajlar: 4449
Mark topic unread
• 1. sayfa (Toplam 1 sayfa)
Dön 日本のSpine ユーザー
- Tüm zamanlar UTC