jPCT - a 3d engine for Java > Support

Different light shading with compiled objects

(1/3) > >>

Jamiro:
Hello,

As I'm using compiled and non-compiled objects, I came across something that seems weird. The lighting and shading on the same objects are different when they are compiled and when they are not (for Config.lightmul = 1).

So, this basically means that the same lights cast different results on the same objects depending if those objects are compiled or not, is it supposed to be like that?

Jamiro:
My question is, does a compiled object have a different light calculations than a non-compiled one? Does it have anything to do with VBO? I know it has nothing to do with max number of lights because I'm only using 1.

I tried to search on the web about this, but nothing came up. Can anyone give me a hint on this? and if its true, how can I accomplish a similar look with compiled objects?

Does it have to do with attenuation formula? (linear vs non-linear)

Jamiro:
heres an example:

Jamiro:
Ok, I know now what the problem is. So apparently it seems that compiled objects use linear lighting instead of the quadratic that the non-compiled objects are using, also there's the matter with light limitation on the compiled ones, which is 8, thus having a weird looking scene when compiling all the objects.

As for the light limitation, there's no solution other than using shaders, as for the lighting attenuation method, why does it chage? is it chosen by the hardware? If so, does this mean that when using VBO objects the light will be linear?

My problem is that I want to work with VBOs of course (do want the best performacen for my program) but I do not want the linear attenuation light, therefore I will need to use shaders, the problem is, when I use them I lose the default opengl fog effect, or I need to add it as well to the shader, but creating a shader is hard as hell, so I wanted to stick to default light and fog.

thanks

EgonOlsen:
It's not linear vs. non-linear. Both use the same, linear approach, but this value http://www.jpct.net/doc/com/threed/jpct/Config.html#lightMul is 10 for non-compiled objects (for historical reasons) but 1 for compiled ones (because of the way in which the fixed function pipeline works). Have you tried to increase the intensity of the light source instead? Or played around with http://www.jpct.net/doc/com/threed/jpct/Lights.html#setRGBScale(int)?

Navigation

[0] Message Index

[#] Next page

Go to full version