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$
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$
  • $\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$ – Banana Oct 6 '15 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 '15 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$ – Banana Oct 9 '15 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 '15 at 10:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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