3
$\begingroup$

I want to achieve object shading in Blend4Web equal to the default 'SOLID' shading in blenders viewport. Is it possible to use the solid OpenGL lights in Blend4Web? Or if not, how can I simulate it using the light objects?

The default viewport shading I want is on the left and how Blend4Web looks without shading is on the right:

enter image description here enter image description here

$\endgroup$

1 Answer 1

3
$\begingroup$

You can obtain this effect by parenting several point lights to the camera and don't foget do disable shadows.

You can set up a camera in one view and point it to the standart cube, also add one by one three lights. Then swithing between default solid shading and GLSL shading move the lights in that way so the shading of the cube model in GLSL model started to look like the default OpenGL light in solid mode. Only your eyes and feelings can help you to obtain waht you need. The right colors of the light you can copy from blender preferences in System tab.

$\endgroup$
4
  • $\begingroup$ That's what I thought I might have to - thank you for confirming it! However, how would I set it up to get the same shading? I am new to Blender, so any help is very much appreciated. $\endgroup$
    – dwitvliet
    Oct 6, 2015 at 12:10
  • 1
    $\begingroup$ You can set up a camera in one view and point it to the standart cube, also add one by one three lights. Then swithing between default solid shading and GLSL shading move the lights in that way so the shading of the cube model in GLSL model started to look like the default OpenGL light in solid mode. Only your eyes and feelings can help you to obtain waht you need. The right colors of the light you can copy from blender preferences in System tab. $\endgroup$
    – Blend4Web
    Oct 7, 2015 at 13:23
  • $\begingroup$ Thank you. Using the settings I can indeed get the exact positions and diffuse and specula colors required as you said. However, for the lights I can only set one color. Furthermore, I am not sure what distances and energies to use. $\endgroup$
    – dwitvliet
    Oct 9, 2015 at 20:26
  • 1
    $\begingroup$ Use this command in console bpy.context.user_preferences.system.solid_lights[0].direction (changing from 0 to 2 - the number of the light) you can obtain a vector of the direction of each light and reproduce it in blender, if you can. It's the only way, anothere is only use your eyes and feelings. $\endgroup$
    – Blend4Web
    Oct 12, 2015 at 10:02

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .