about the strength of specular light

Started by MichaelJPCT, November 11, 2018, 07:00:01 PM

Previous topic - Next topic

MichaelJPCT

Hi Egon,
i found the reflected light color is related to texture color - the light on white object is whiter than that on dark color  objects.
but in reality, some dark colored object can reflect very bright light, such as dark colored glass.
i don't aim for complex graphics so that's not very important by now.
in some engines, there is concept of " material " - not just texture, but how strong do ambient light, diffuse light, specular light affect an object.
would you consider having this in JPCT? or people need to write new shaders if necessary.

EgonOlsen

jPCT support OpenGL ES 1.x and 2/3.x. The 2.x support mimics the 1.x pipeline by providing default shader implementations which behave just like 1.x would. And because 1.x doesn't support any advanced lighting techniques, the 2.x pipeline doesn't support them either. If one wants some other kind of lighting, one has to write a custom shader for it. I had to limit the options here somewhere, because we already have 19 different shaders plus parts that will be injected when using shadows.

MichaelJPCT

i see. the built-in shaders are complex enough already. thanks.

MichaelJPCT

i think of Config.specPow , can specPow be variable at runtime ?

EgonOlsen


MichaelJPCT

so why not  have a Object3D.setSpecPow() method ?
then each object can have different specpow.

EgonOlsen

I don't remember that exactly. I guess, because I actually didn't consider this to be important at all. IIRC, it wasn't supported properly on a lot of older devices anyway, so I'm not even sure how well jPCT-AE handles this setting. Maybe we should take a step back: What exactly are you trying to achieve?

MichaelJPCT

i dont think it is very important either.
but, since full support of material is not easy to do, IF changing specPow is much easier, then it can let the users have more options without too much trouble.
changing specpow ( without other elements of material ) still has some use, such as seperating glass (sharper reflection) and plastic.
if a user have one more option, he will think of more ideas.
i agree that a developer should put efforts on essential elements and neglect unimportant elements, though.

MichaelJPCT

about the outcome of this setting, i did some test on powerVR 6250 gpu and could see the difference it makes.
in some cases, the specular looks quite nice. i use 50 setting and metal does look like metal on my simulated aircrafts, especially in moving images.

MichaelJPCT

here is a work in progress model as example of specular light


EgonOlsen

It's a bit hacky, but you could try to add an http://www.jpct.net/jpct-ae/doc/com/threed/jpct/IRenderHook.html implementation to your objects and set the Config values in the beforeRendering implementation. That should actually work...I guess...

MichaelJPCT