Closed CrazyFlasher closed 6 years ago
When I changed context3d profile to Context3DProfile.BASELINE
(previously it was Context3DProfile.BASELINE_CONSTRAINED
), it became ok.
But is it the only solution?
As I remember, it's better to use
BASELINE_CONSTRAINED
for best compatibility with older devices, or I am wrong?
BASELINE_CONSTRAINED was really added to support older desktop graphics hardware, specifically on Windows. If you are going for mobile app release I use BASELINE at a minimum myself.
Yes, the game is for Android and iOS especially. Thanks, Jeff!
Yes, there is no downside in requring BASELINE on mobile — on the contrary, it will make sum things more efficient, and I have never heard of any mobile device not supporting it.
Still, it's weird that the filter doesn't work with that mode. I'll look into it!
I would check into the use of the AGAL "seq" token in the CompositeFilter. I don't think the "seq" or "sne" tokens are supported as well as the other AGAL tokens (that's what I've heard). It would be better to use the "sge" token in this case, as it's faster in BASELINE.CONSTRAINED, better supported, and accomplishes exactly the same thing.
It would be better to use the "sge" token in this case, as it's faster in BASELINE.CONSTRAINED, better supported, and accomplishes exactly the same thing.
Oh, I wasn't aware of this! Do you have any source for this information?
In any case, @CrazyFlasher, could you please test if changing the line found here from
"seq ft5, v0, v0"
to
"sge ft5, v0, v0"
fixes the problem? (It's actually just a hack to produce a 1
vector in the shader without having to pass it in manually.)
BTW, I can't reproduce the problem on my system, so it's very likely that the AGAL code simply doesn't work 100% equally on your system in constrained mode.
Here's a thread on "seq" not working on machines in software emulation:
In BASELINE.CONSTRAINED, the GPU program size is limited to 64 of what Adobe calls "ALU Instructions" (whatever those are), and I found by trial and error that most tokens (like mul or add) take 1 "ALU Instruction", but sge takes 2, and seq takes 5. Here is another (admittedly pretty old) thread on how slow the seq token is:
FYI, here is a list of approximately how may "ALU instruction"s are used in each AGAL token in BASELINE_CONSTRAINED (where "C" is the number of components the instruction operates on):
abs | 1 add | 1 cos | 4+9C crs | 3 div | 1+C dp3 | 1 dp4 | 1 exp | C frc | 1 kil | 1 log | C max | 1 min | 1 mov | 1 mul | 1 m33 | 4 m34 | 4 m44 | 5 neg | 1 nrm | 7 pow | 3C rcp | C rsq | C sat | 1 seq | 5 sge | 2 sin | 4+9C slt | 2 sne | 5 sqt | 2C sub | 1
Wow, that's super useful information! Thanks a lot for sharing!
I'll make that seq
→ sge
change right away.
Happy to help. You might also want to change the seq token in Effect.as as well (although I suspect it's rarely executed). I think those are the only two occurrences of the seq or sne tokens in Starling.
You're right, it's better changed there, as well. I wonder if that code has ever been executed in a real-life app, but consistency alone is worth it. :wink:
Hi. I need to apply red (0xFF0000) glow filter to text fields. There original color of TextFields without filter:
When I apply filter, it changes font color also. Also glow should be red instead of black: