PhilGrogro

Hello,
I am using spine to animate my character for a casual game.
You can swap hats that you can collect within the game. I dont know how many hats will be available in the last
version so i cant use skins in spine. i dont want to export the all thing each time i add an item.
I tried using the sprite attacher which seems to do exactly what i need.
it works perfectly if my hat texture is cropped around the graphic, but as soon as i try to make it a multiple of 4
(for texture compression) the sprite attach doesn't work anymore and i have that message in the console:

Graphics.CopyTexture can only copy between same texture format groups (d3d11 base formats: src=76 dst=27)
Thread is not attached to scripting runtime


i just cant use multiple of 4 texture with it. Am I missing something ? :shh:
Maybe sprite attacher is just a demo thing but im artist and not dev, and its pretty convenient.
What is the easiest way to swap graphics in a character slot then ?

thank you
Phil
PhilGrogro
  • Сообщения: 1

Harald

Just in case you don't already know: Spine also provides a command line interface to quickly export your atlases again by running a shell script.

Regarding the error message:
Which version of Spine and the Spine-Unity runtime (the name of the unitypackage) are you using?
Аватара пользователя
Harald

Harri
  • Сообщения: 953

Aggressor

I too have this problem.

It seems to be a unity bug that was "resolved" but it clearly isnt.

https://issuetracker.unity3d.com/issues/graphics-dot-copytexture-not-working-for-compressed-textures-anymore

Im not sure what to do for the moment. Ive filed a bug report....:rolleyes:
Aggressor
  • Сообщения: 67

Harald

Thanks @Agressor for the info and filing the bug report! Could you maybe link it here on the forum thread, then others could up-vote it as well.

This issue is definitely the same or related, since the error message states:
PhilGrogro писал(а):
(d3d11 base formats: src=76 dst=27
Which means it failed to copy from compressed src format BC3_TYPELESS (in DirectX 9 terms the equivalent was DXT4/DXT5) to uncompressed dst format R8G8B8A8_TYPELESS.

As a workaround until Unity resolves this bug, you could disable compression on the source texture from where it is copying from. Setting texture size to non-multiple of four disables compression and falls back to uncompressed, which is the reason why it worked on those textures.
Аватара пользователя
Harald

Harri
  • Сообщения: 953

Aggressor

Im going to create a sample project and email them and then Ill get back to you. My original did not have it and I cant seem to post or comment on it. I have like 3 open bugs at the moment lol. Hang tight.

---

I've created a new bug with an attached project.

Issue is here:

https://fogbugz.unity3d.com/default.asp?1172610_kganqqbnng0kremo

---

Issue has been created:

https://issuetracker.unity3d.com/issues/copytexture-throws-an-error-when-copying-compressed-texture

Cast ye votes!
Aggressor
  • Сообщения: 67

Harald

Perfect, thanks for sharing, vote cast!
Аватара пользователя
Harald

Harri
  • Сообщения: 953

Aggressor

UPDATE: Ignore all the below, all my testing was useless. I had the sprite as a serialized reference in an asset bundle, the texture properties are not updated unless the bundle was rebuilt. You can disregard, I was able to get it working.


==== Old ====
@Harald Do you have any other work around suggestions? I tried every setting on the Texture and nothing worked. Max Size setting never matters, Resize Algorithm never matters, Format never matters. Textures that throw this error throw it 100% of the time.

Is there any more detail on the workaround you can provide? My texture sizes were not multiples of 4.

I also tried making sure it was DXT5 to DXT5 by changing the texture format in the Atlas Utilities. In that case I get illegal pixel operations. RGBA 32 to RGBA 32 didn't work either.

Oddly, when both the texture of the source sprite and the destination are both RGBA 32, it still says "Graphics.CopyTexture can only copy between same texture format groups (d3d11 base formats: src=76 dst=27)" I have no idea where d3d11 is coming from. I will continue to dig....

---

Further still adding to the confusion I tried using the legacy code:
Color[] pixelBuffer = source.GetPixels((int)sourceRect.x, (int)sourceRect.y, (int)sourceRect.width, (int)sourceRect.height);
destination.SetPixels(pixelBuffer);
destination.Apply();
To copy the texture, and even though I explicitly set the texture data to readable, its still coming out as not readable...

Im very confused.

conf.jpg


---

I wonder if this is the underlying bug as to why the graphics copy texture fails to, perhaps with the wrong message. Maybe there is a read write bug?
У вас нет необходимых прав для просмотра вложений в этом сообщении.
Aggressor
  • Сообщения: 67

Harald

Thanks for getting back to us, glad you figured it out! Thanks for sharing!
Аватара пользователя
Harald

Harri
  • Сообщения: 953


Вернуться в Unity