Light source every direction?

Started by Kumaraswamy, October 24, 2021, 12:51:12 PM

Previous topic - Next topic

Kumaraswamy

Hi, I would like to know how can I make the light visible from every direction?
I don't want it to be dark on one side and not the other.

EgonOlsen

You can't, because that's the way in which lighting works as it takes the angle between a vertex normal and the vector from the light source to that point. In case of backfaces, this angle is larger 90° hance the darkness. Would it be otherwise, then there would be no lighting at all, because it would never get darker.

Kumaraswamy

I don't want the shadow or the part where the light isn't reached to be dark.

AeroShark333

Maybe you could have 0 light sources and use https://www.jpct.net/jpct-ae/doc/com/threed/jpct/Object3D.html#setAdditionalColor-com.threed.jpct.RGBColor- to 'add' your own lighting...
But I'm not sure if this would give the desired result...
I believe the best way to work yourself around the default lighting system of jPCT is to write your own shaders which take care of the lighting themselves... Could be tricky however

EgonOlsen

Quote from: Kumaraswamy on October 24, 2021, 04:53:12 PM
I don't want the shadow or the part where the light isn't reached to be dark.
I'm not sure if I understand, what you want. Without shadows, there's no light. If you want something to be uniformly "lit", you can adjust the ambient light's intensity and/or color. You can also give an object an additional color: https://www.jpct.net/jpct-ae/doc/com/threed/jpct/Object3D.html#setAdditionalColor-com.threed.jpct.RGBColor-

Maybe that helps? In general, all parts that aren't lit directly by a light source still have the ambient color and the additional color.

Kumaraswamy


AeroShark333

I just realized there's also:
World#setAmbientLight(255,255,255);... Might be useful