[SOLVED] Geting a Dark colour on particle emitter

ive been trying to create a local rain cloud, and setting the start and end colour near dark grey doesnt seem to work, is this to do with the transparency that particle emitters use ?

for e.g.:

[java]

cloud.setStartColor(new ColorRGBA(0.1f, 0.1f, 0.1f, 0.5f));

cloud.setEndColor(new ColorRGBA(0.1f, .1f, .1f, 0.2f));

[/java]

produces:

http://i53.tinypic.com/nvwah4.jpg

any dark color comes out white.

–edit–

apologies, i selected the wrong forum subgroup

have you tried with higher alpha values?

oh ok i know why, the default blend mode for particles is blendMode.Additive, which means black areas are considered transparent.

Set the blend mode to alpha and lower a bit the alpha value of the start color (like 0.2, to avoid seeing the borders of the particle quads)

1 Like

do you mean?

mat.getAdditionalRenderState().setAlphaFallOff(0f);

mat.getAdditionalRenderState().setAlphaTest(true)



i tried playing aorund with those, setting alpha over0.8f makes it invisible.

actually setting to alpha allows me to create a seperate transparent texture, no borders on that :smiley:

i will post the difference once i fine tune the texture.



Thank you for the help.

http://i56.tinypic.com/20iaq15.jpg


woo it works,

if anyones interested, heres how i did it:
copied flame.png from particles, used gimp to make transparent with:
Layer>Transparency>Color to Alpha (and sellecting black as the colour)

then in JME:
[java]
mat.setTexture("Texture", assetManager.loadTexture("Particles/cloud.png"));
mat.getAdditionalRenderState().setFaceCullMode(FaceCullMode.Off);
mat.getAdditionalRenderState().setBlendMode(BlendMode.Alpha);
[/java]
1 Like

looking good :), thx for the info

heheh nice :wink: