0
$\begingroup$

I have the following code in python using the vedo package

mesh.lighting(style='plastic', ambient=None, diffuse=None, specular=None,
              specular_color=None, specular_power=None, metallicity=None, roughness=None)

I know that I need a combination for ambient, diffuse, specular value to creating phong lighting. How do I determine these values? And how do I know I have created phong lighting?

$\endgroup$

1 Answer 1

0
$\begingroup$

From the manual:

  • style : (str) preset style, options are [metallic, plastic, shiny, glossy, ambient, off]

  • ambient : (float) ambient fraction of emission [0-1]

  • diffuse : (float) emission of diffused light in fraction [0-1]

  • specular : (float) fraction of reflected light [0-1]

  • specular_power : (float) precision of reflection [1-100]

  • specular_color : (color) color that is being reflected by the surface

Set the ambient/diffuse/specular parameters to increasing values one at a time and observe the effect. A Phong model requires a combination of the three components. Also play with specular_power and specular_color (only relevant with nonzero specular).

I could not find any information on metallicity nor roughness. Have a try with values in range [0-1].

It is possible (likely) that the preset styles enforce predefined sets of parameter values, and to use your own the off mode is required.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.