Ambient Light Useage

Well i kinda want to use the Ambient light, but i con’t find out how.



When i simply attach it to the rootnode as in the examples I get a completly transparent world everything is invisible exept particle effects. Why is that so?

Yeh, just wanted to check it out, and everything becomes transparent except the particles and object that has glowMap on them :stuck_out_tongue:









al.setColor(ColorRGBA.White.mult(1)); has no effect



al.setColor(ColorRGBA.White.mult(2)); makes everything transparent.

just figured out here TestTransparentCartoonEdge.java AmbientLight works fine.



When I add another DirectoinalLight with AmbientLight things turns back to normal.But, AmbientLight’s effect on the environment is gone as well.

Maybe it has something do to that transparency is specified on diffuse color component only ? Then maybe if you don’t have diffuse light, it converts to zero ?



Ambient works ok for me - there is a visible effect on top of diffuse part and it reacts to changes in ambient light intensity. Be sure to use lights which are not full white, but rather gray to see the effect easier.

Be sure to use lights which are not full white, but rather gray to see the effect easier.



Well the problem is still that if I only have a ambient light and nothing else everything except particles is transparent instead of Ambientbrightness.



Maybee its a shader stuff tho. Could you please test if it works for you with only a ambient light?



My GC is a ATI3750HD, i use the opengl2.0 renderer.

The dedicated ambient pass was removed (ambient is now done on first light) and that introduced a few issues.

First if the only thing you had was an ambient light attached, nothing would render.

There was also a small bug if material colors was not used, but I fixed it already.

@iamcreasy: make sure you’re using the latest (SVN) version of jme3

umm, update to the latest svn, and now, the whole transparent world in completely black.







the black white gradient is fog filter effect.

For me it works fine now though



Ambient for slightly visible cause complelty dark is unplayable and point light for sun

Is everything still black with filters disabled?

Momoko_Fan said:
Is everything still black with filters disabled?

yes, completely black.

I tested yesterday on sponza, and had a similar issue.

I found out that setting the ambient color to values above 1 gives good results



AmbientLight al=new AmbientLight();

al.setColor(new ColorRGBA(1.8f,1.8f,1.8f,1.0);

rootNode.addLight(al);

nehon said:
I tested yesterday on sponza, and had a similar issue.
I found out that setting the ambient color to values above 1 gives good results
`
AmbientLight al=new AmbientLight();
al.setColor(new ColorRGBA(1.8f,1.8f,1.8f,1.0);
rootNode.addLight(al);
`


tested and the result is the same. All is black.

Have you updated the the current jme version? cause that is what fixed it for me.

updated last night, I am on r6576. what revision solved your issue?

The one 14 hours ago ^^ I posted the pic right after it worked.

Hey.

I just started using AmbientLight and i also get severe darkness on several of my materials, both custom and Lighting. It seems to occur when the Lighting material has “UseMaterialColors” set to true.





Edit:

Well, no wonder if m_Ambient is black (by default) and line 161 says:

[java]AmbientSum = m_Ambient * g_AmbientLightColor;[/java]

Set your AmbientLight to white and you should be good. :wink:

If “UseMaterialColors” is true, then it will use Ambient color for any ambient lights. You need to set the ambient color to non-zero to see the effect of ambient lights