Alpha multiplication threshold coming from nowhere

well yeah I spent a long time trying to pin this one down, making a ready made project
that’s why I dont like to read “I can’t really add another one for someone who can’t bother to show us a video”
no hard feelings anyway

so am I supposed to do something witht the code you gave me ? its part of jme anyway so I cant really do anything about it
a mentioned above, I removed the call to alpha falloff test, and my objects render correctly so…

btw, you said you did not use “clone()”, how do you have multiple instances of the same object then ?
I thought it wasthe obvious way to do it…

I either load my models ready-made or I replace the materials with ones that I create (new Material())… anyway, as momoko_fan says, this is caused by a bug in JME that was fixed some time back… just not in 3.0. I build against trunk so I forgot about it since it was fixed way more than a year ago (fixed by me in fact)… and now that deprecated stuff is completely removed I guess (haven’t looked). So you have to use alphaDiscardThreshold anyway.

re: the video. We get a lot of posts here. We (many of us and all core devs like me) read all of them. The more legwork the poster can do, the more likely it is to get attention. When someone describes what is happening rather than post a picture or video, then there is a lot of room for interpretation… and the eyes describing the problem already don’t know what is really happening and so by definition can’t really properly describe it. If the problem can be illustrated with a picture, then use a picture. If it can’t, then use a video… and upload it to youtube will even get more views. (As it was, I couldln’t see it because my computer didn’t know what app to use and I didn’t have time to hunt down which one would read the video… but you see that someone was able to instantly see the issue.)

You can post as little or as much information as you want. My advice is only about how to get the best/quickest help. For example, I suspect if you’d posted the video and description + small material setup example in your first post then you’d have had the proper answer in about 30 minutes depending on the time of day and this thread would be 3 posts long. We see threads like this all the time.

Anyway, as stated: alpha test was removed in trunk (kind of drastic… but I didn’t do it… so whatever). It won’t exist when 3.1 comes out. In other words, you shouldn’t use it. Use “alphaDiscardThreshold” material parameter instead.

For the record, there are two bugs here:

  1. the context value is used before it is set
  2. alphaTestFalloff != previous is not enough of a check to tell if falloff should be turned on because 0 is a valid value for alpha test. (Which was the leak I was seeing when I fixed the bug… one material with alpha test on was messing up other materials with it off.)

yeah I’ll use alphaDiscardThreshold indeed

when you say “I either load my models ready-made” I dont really follow you
the assetmanager is caching objects, so if I use the object it returns, it is every time the same instance , right ?

I mean in a game you sometimes got thousands instance of the same object, so if I should not use clone() then how do I do it ?

Yes, but I don’t clone one material, set a bunch of stuff about it, and set it to a different object. I clone objects (through asset manager) or I create them.

I dont clone materials, my materialfactory uses new Material(…) and assign it to the objects I clone
(like in the code I pasted above)
so there should not be any issue