Dev:2.8/Source/Viewport/Workbench

提供: wiki
移動先: 案内検索

The workbench is used for several draw modes

  • Solid Flat
  • Solid Studio
  • Texture Flat
  • Texture Studio
  • Clay rendering


Flat Lighting

  • Just a single color


Studio Lighting

  • Single HDRI with a single sun lamp for shadows.
  • For diffuse lighting the HDRI will be used as 6 uniform colors (each side of the cube one). Via the normal of the object the colors are interpolated and used as lighting. idea is to create a more interesting look.
  • When specular lighting is implemented we will use the HDRI as a texture.
  • Shadows are subtracted from the light.
  • Using a CSM to create sharp shadows.
  • Add some AO


Object coloring

The color of the object to draw in the solid mode of the workbench can be set in 2 modes

  • Use the object color (ob->col). DepsGraph + CollectionManager will allow overrides of the object color in a collection. So we will also be able to override the color of an object per collection
  • Pick a random color

This setting will be a flag that can be changed per View3D.

Dev-workbench-random-object-colors.png

For the random color picking we will try to be persistent in giving the color to objects. We will store the given offset of the color in a ghash where we use the name as key. This way the object itself does not need to store anything in the blend file. The system will also be able to generate persistent colors for linked in assets.

The random color generation will be done by an HSV where the H will have a golden ratio offset, s=0.5, v=0.95. Eventually the colors will get closer to each other and we will be able to influence the V value. But lets start with this as a first implementation. We could also switch to a Halton sequece between two components of the HSV.