Hi funbox and nehon,
I am experiencing the same problem with my scene.
Can you please explain how to solve this for android,
Thanks
Hi funbox and nehon,
I am experiencing the same problem with my scene.
Can you please explain how to solve this for android,
Thanks
Okay guys, please can anyone help me?
Here is a screenshot of my problem.
As you can see it is having a problem with the zbuffer or something.
I am currently making use of the unshaded material shader and if I make use with lighting material it works.
Ligting material is not an option for my game on android.
Please help.
You donât have alpha discard set on the material. That means its writing to the depth buffer even on transparent pixels - so other stuff doesnât get drawn in.
Thanks, but can you explain how I should do that?
What is the setting? Please?
This is my current code I am using, I have tried multiple combination.
[java] Material mat = new Material(assetManager, âCommon/MatDefs/Misc/Unshaded.j3mdâ);
mat.setTexture(âColorMapâ, assetManager.loadTexture(âTextures/treeflat5.pngâ));
mat.getAdditionalRenderState().setAlphaFallOff(0.6f);
mat.getAdditionalRenderState().setAlphaTest(true);
mat.getAdditionalRenderState().setDepthTest(true);
mat.getAdditionalRenderState().setFaceCullMode(RenderState.FaceCullMode.Off);
mat.getAdditionalRenderState().setBlendMode(RenderState.BlendMode.Alpha);[/java]
I think you need to hack the shader. As I understand, alpha fall off doesnât work on Android and the âAlphaDiscardâ material parameter doesnât exist (yet) on Unshaded. (Unless @nehon added it and I forgot.)
Hi.
The alphadiscard property is in the unshaded material def, but it is not exposed to jme.
I have tried to build it in by making a copy of the unshaded material and exposing it, but I have no luck in getting it to work.
Any help will be much appreciated.
<cite>@ndebruyn said:</cite> Hi. The alphadiscard property is in the unshaded material def, but it is not exposed to jme. I have tried to build it in by making a copy of the unshaded material and exposing it, but I have no luck in getting it to work. Any help will be much appreciated.
If itâs in the material def then you can set it. Please run through the material tutorials⌠setting a material parameter is a pretty basic thing.
I know how to do it, my problem is that it did not solve the problem.
uh actually the discard threshold is not supported by the unshaded material and alphafalloff wonât work on opengles.
Iâm gonna add the alphathreshold support to unshaded once and for all.
Should be ok now.
Will this be in the latest nightly? Or can I get it now?
<cite>@nehon said:</cite> Should be ok now.
Nice one Remy
[java]// Apha threshold for fragment discarding[/java]
Should be âAlphaâ tho
<cite>@wezrule said:</cite> Nice one Remy[java]// Apha threshold for fragment discarding[/java]
Should be âAlphaâ tho
<cite>@ndebruyn said:</cite> Will this be in the latest nightly? Or can I get it now?in latest nightly, i'm afraid.
Thank you so much.
I will get the code from the svn and then test it.
Will let you know, sooner than later.
Cheers
Okay people, I have tested this from my side and it works perfectly.
Thanks nehon, as always you donât disappointâŚ
:affe:
My pleasure
<cite>@nehon said:</cite> lol, the typo was in Lighting.j3md and i copied it along :p So from my point of view it's pretty consistent :p
ok, I will let you off this one time
After trying most things in this thread to solve the issue. Using this code works on my SGS3
[java]
geo.getMaterial().setFloat(âAlphaDiscardThresholdâ, 0.5f);
[/java]
It seems that android does not recognize the
[java]
.setAlphaFallOff()
[/java]
function
EDIT: using jme 3 RC2
@mr.ljwilliams said: After trying most things in this thread to solve the issue. Using this code works on my SGS3 [java]geo.getMaterial().setFloat(âAlphaDiscardThresholdâ, 0.5f);
[/java]
It seems that android does not recognize the
[java]
.setAlphaFallOff()
[/java]
functionEDIT: using jme 3 RC2
Yes, setAlphaFallOff() doesnât work on Android as was mentioned at least three times in this thread already. I guess itâs nice to summarize again, though.