Sprite trimming in html problems (#4645)(SOLVED)

I have a collection, for card. It have bottom bg and top bg sprites. And some info: letter sprite and cost sprite.
char_view_top char_view_bottom
I enable sprite trimming, for bg sprite(it have some alpha,on borders).
In desktop all worked.
But in html, it looks like z level was broken.

It should start from closed position, then rotate to opened position.
But in html it start from opened position, then rotate to closed position.Also info sprites was disappered.

worked


not worked

1 Like

Thank you for the report. Can you share a small repro project for @JCash to take a look at?

1 Like

Yes. I will try to make, small repro case, tommorow.

2 Likes

Small repro case.
It using perspective camera.
I make a copy of card collection(word_char.collection) from my game. That collection use custom materials for every part(4 material).
Custom for fg,bg,char,number. All material, same except tag. I need that for fixing rotation.(with one material, was z fighting)

For that case, i make 4 different collection.
word_char.collection - 4 material no trim. Worked
word_char_material_1.collection - 1 material no trim. Worked
word_char_trim.collection - 4 material trim. Not worked.
word_char_trim_material_1.collection - 1 material trim. Not worked.

It have 5 collections.All worked correct on desktop.
Problem with html build.

1)main - contains all from 2-5. All not worked. Looks like using any sprite with trimming break all.
2)main base. word_char.collection. Worked
3)main base_material1. word_char_material_1.collection. Worked
4)main_base_trim. word_char_trim.collection. Not worked
5)main_base_trim_material_1. word_char_trim_material_1.collection. Not worked

sprite_trim_html_problem.zip (40.8 KB)

2 Likes

We have a fix for this, and it will be shipped in 1.2.166.

In short, it was a polygon winding issue, they were flipped around.
The reason I didn’t notice it before was that we have backface culling disabled by default.

Why the editor didn’t show the same symptoms is another matter I’m looking in to.

5 Likes

Solved in 1.2.166

2 Likes