Does Light effect modify objects properties?


here's my question:

If an object ( a sphere i.e.) is hit by the light, the effect is rendered changing some object's parameter?

Is the value of the color changed?

I try to explain better:

When I see on the screen the color of an object that changes because of a light,

where is the change effectively applied?

An istance variable of the object?

Something in the lightstate?


Thank you

The resulting color is a combination of the color settings of the lights (diffuse, specular, ambient) and the material state (if any) applied to the object.

So I can  get the color using geometryObject.getColorBuffer(), right?

Is this approach still correct if I apply textures to the geometryObject?

Thank you very much 

No, the color buffer is for static non-lit color. Once lighting is used, OpenGL will ignore these colors. You can't easily obtain the final color that will be presented to the screen as it is calculated dynamically. Someone might have a way of doing it (reading the framebuffer perhaps?) but I'm not sure. What are you trying to do where you need to know the final color? There might be better solutions.

I imagined it wouldn't work with dynamic colors but…

If I set a default color to an object,

then I apply a texture ,

finally I  apply the light,

the value of the color would have to change right?

I don't need it for graphic features.

I have to simulate the effect of the light in terms of brightness values;

I. e., if I  turn on a light , I would like to know how much does the brightness of a part of the floor increase.

I would like to evaluate brightness as function(color);

That's all.

Thank you :slight_smile:

No, this is all calculated on your videocard. There might be some OpenGL trickery to retrieve it somehow, but that's way out of the scope of the jME project, so you're on your own there.

The javadoc seems to describe something different…


…A light will illuminate portions of the scene by assigning its properties to the objects in the scene. This will affect the objects color values, depending on the color of the ambient, diffuse and specular light components. Ambient light defines the general light of the scene, that is the intensity and color of lighting if no particular lights are affecting it. Diffuse lighting defines the reflection of light on matte surfaces.

I just would like to understand which color values change and how to retrieve them.

geometryObject.getDefaultColor() ?

geometryObject.getColorBuffer() ?

Maybe I misunderstood the javadoc…

Thank you :slight_smile:

No values change… that's just it.

The values for the object's material state, the values that define the light, the position of the light, and the position of the object are are combined during renderering and displayed.  The ONLY values changing are the frame buffer on the video card.

this is a sad think  :cry:

thank you  :slight_smile: