From BlenderWiki

Jump to: navigation, search
Note: This is an archived version of the Blender Developer Wiki. The current and active wiki is available on wiki.blender.org.

BEER UI/UX ideas

Introduction: BEER Philosophy and Basic Workflow

Setup is similar to writing RSL algorithm, providing maximum shader flexibility.

  • Layering system provides
    • Folder
    • Clip layer
    • Solo
    • Blend modes (including alpha over)
  • Each layer of shader with options to different shader behavior
    • Light dependent
    • View and light dependent
    • View dependent
    • Normal controlled
    • Screen space (Halftone, hatching)
    • Custom (depth, view depth, keyed, height, etc)
  • There are 2 types of color ramp
    • 1D color ramp
    • 2D color ramp (2nd D will be driven by another variable)
  • For directional behavior materials (light, view, normal dependent) will have their own Material behavior curve, this provides unlimited shader behavior.
  • Material modifiers add extra tweaks to each shader layer, such as:
    • Terminator behavior
    • Normal offset
    • Object space hatching
    • Freestyle behavior
  • There are world materials too, few examples behavior types are:
    • Screen space (SSAO, stippling, color grading, speed lines)
    • Sky
    • Depth
  • World materials will also have modifiers similar to object materials

BEER Shader Primitives

BEER uses shader layer system to stack NPR shader primitives. Unlike material primitives in Blender Internal (Phong, Lambert etc), BEER shader primitives is broken into more fundamental pieces.

  • Shadeless (shader that gives you the basic color of the object)
  • Light dependent (shader that gives you the illuminated color, diffuse)
  • View and light dependent (shader that gives you highlights, specular)
  • View dependent also known as view space Normal controlled (shader that is controlled by normal, back lighting)
  • Screen space (Halftone, hatching, glow/glare, color grading, SSAO etc)
  • Custom (depth, view depth, keyed, height, etc)

Each shader primitive will have their own modifiers, the reason will be mentioned later.

Pros: Shader primitives minimize the amount of data needed. For example, with current BI nodes, to add 2 different specular reflections, one has to add 2 materials but not use their diffuse & normal parts of the materials. Those parts are the "unseen, unrendered & often not needed" data that BI has to carry. With BEER shader primitives the data always "only available when needed." The result: BEER shader is lighter than BI for the same output.

Shader primitives introduce a slim shader building mechanism in which when stacked and blended, will mimic the way shaders algorithm are written in code. The stacking mechanism provides ways to modify the primitives without getting them overly complicated as nodes tend to behave.

  • "A stacked shader primitives are more readable than a noodling nodes when revisiting them after a while."

Another reason that layer system with more fundamental shader parts is better than nodes...

  • "A shader layer with 30 lines of code that can be versioned is WAY better than 30 nodes"

Cons: Shaders need to be compiled before executed.


Definitions:

  • Material - the outer shell of the shading system.
  • Layer system - a shader stacking system that blends shaders
  • Blend - algorithms to mix 2 or more shaders
  • Shader - (NPR shader primitives) the primitive that is stack-able to form more complex color behavior.
  • Shader modifier - also known as a shader primitive modifier, is the parameter to pre-condition a primitives before it is usable.