BEER: A wordy leet intro (August 2013)

What is BEER?

BEER is a shader system specifically for non photo realistic rendering. It is a shader of all styles. Initially it was to fulfill the requirement of having cel-toon, soft-toon and X-toon. But after months of discussion we (a group of community NPR and alternative/expressive shading advocates and enthusiasts) concluded that there is a better way to produce NPR shaders in a quick and intuitive way.

The idea is old. It amalgamates the thinking process of 2D and 3D.

From 2D, the idea of how raster applications create limitless style by just layering and blending. From 3D, the idea of making the shader system working with depth, view vector, normal vector, lighting and custom driving properties. The composite of both worlds leads to a shader system that mimics any shading style imaginable and of those have been produced, almost.

Focusing on the solution: How BEER works?

“This is beer for the eyes.”

How do you make a flexible shader that can mimic any style? For years researchers has been focusing on mostly 1 or 2 parts of any shader per research. Either it is deformable specular, specular placement that moves the light, contour sharpening (shape exaggeration), or depth for details (alpha mist), to name a few.

BEER thinks differently. As all shader are made from some sort of primitive, if the primitive isn’t flexible enough, the shader is limited to produce restricted surface shading. For example, the Lambert shader is just a dot product of surface normal and light direction. Neither it will bring details to the shadow area nor shift the terminator border. Also most shaders are bounded by lighting. The lack of proper lighting will lead to poor render, squashing at your creativity and demand technical know-how.

The ideal shader primitive:

  • What if diffuse and specular are one in the same shader but a switch away?
  • What if 2 settings change intensity and its fall-off behavior that can determine shader as half-Lambert, Phong, Toon, Blinn and WardIso but not limited to just these?
  • What if with another parameter change you can change specular (in fact not just specular but diffuse as well because they are one in the same) to have anisotropic shading?

What differentiates diffuse and specular is just 1 parameter, which is view vector. Any diffuse with a view vector introduced into its equation is specular. From color’s stand point, anything which has a value higher than the diffuse is a specular. For both specular and diffuse, their intensity and fall-off behavior will mean whether it is a half-Lambert (moving the terminator to behind the light source, often direct lighting, to mimic bounce light) or WardIso.

Layering and Blending: Material node is yesterday; pre-composite is the way to go!

“BEER shader pre-composites the stuff you normally do in the compositor.”

Better real-time interaction with the shader means artists can work based on creativity and with less technical button pushing and slider sliding. In terms of the general workflow, layering and blending will lead to endless artistic possibility.

The current BI material node is very limited to produce this effect. To do the 2D equivalent of multiplying 2 or more colors for a shader will take many minutes of node linking and tweaking, lighting setup then rendering. The more intuitive workflow and artistic freedom is to layer primitive shaders in a stack from bottom and up to be able to alpha over, add, subtract or even multiply.

Maybe in 1 minute, we can already layer the base configuration for cel-toon or soft toon from scratch. Yet better, use presets for the most common styles. Then we’ll need less than 1 second of button clicking setup. I would buy something like that if someone would make one.

The true benefit, we don’t have to render passes and store them for later use. Only heavy post effect like glow or blur which are too heavy for real-time will be done in the compositor. Just imagine how simple the node setup will be, maybe we just need simply a node group. Real storage space and time saving.

Another dimension to the color ramp?

Our current color ramp is 1D (both BI and Cycles). To visualize 1D, imagine an edge which is formed by 2 vertices. Then you put color codes at any point along the edge and interpolate them between colors. It is intuitive for simple shading but limited in creating dynamics.

The x-toon (eXtended toon) is a 2D color map (or color ramp). It works just like a Lambert shader but in layers. Visually it is a square raster image, its horizontal axis is for shading from dark to light (or just normals direction) and vertical axis can be mapped to almost any parameter and is animate-able. Imagine you have a character that is calm with low contrast colors, then he turned angry and the animator can just slide the character’s color to the area of the 2d color map where his skin is reddish. Thus one don’t have to make 2 shaders or lighting setups for 1 character.¬† Post processes can also be lessen to a minimal. Some of the world most famous animation productions are turning to this production method, Blender shouldn’t just play catch up.

Wait, there is more shading freedom?

“A surface normal, or simply normal, to a surface at any point is a vector that is perpendicular to the tangent plane to that surface at that point.”

In NPR, we don’t let light do all the commanding. In NPR-land, light is one of the commanding officer in a territory of commanding officers. Like light, surface normal is one of the officer. But normals have many roles. They are:

  1. Following the light
  2. Offset to the light
  3. Offset to view/camera
  4. Key-able and independent

These alone can be used for rim light, back lighting, bounce light, shadow, specular positioning, and other special effects. In BEER, all these normal setting are a drop down list for each primitive layer and quick to setup.

Putting it together

The material container has settings for overall changes like transparency, mirror and shadow. Each primitive layer has its own texture. The material container has one too, with a procedural like setup to shader and texture the shader. Whether you want to texture every primitive is really up to the style you are targeting.

How to create Soft toon like in TF2 with BEER?

First of there are 2 main components, diffuse and specular. Diffuse is further broken into half-Lambert, Light warping, ambient and Albedo (texture). Each can be produced from the shader primitive. Moving on, the view dependent component, which is specularity, rim light and directional bias also can be made from the same shader primitive. What this means it, you can create very stylized shaders from 1 primitive shader that is extremely flexible. The cool thing about this setup, we can animate any setting of the shader layers without going into the material node.

How BEER will improve my workflow?

#1. Real time preview, no more F12-ing to preview shader, time saving, lighting TD & shader artists rejoice.
#2. Exportable shader presets, shareable, and improvable.
#3. Pre-composite style, off loading post processing.
#4. GPU integration, leveraging your GPU minions!
#5. Limitless styles, with an intuitive workflow.

“#6. Low entry barrier. Easy to learn and master”

What is further needed for BEER to work fully?

All shaders have few links to non shader parts that Blender still has issues with. One of the major improvements needed is surface normals editing capability. Further investigation of this leads to a few ways that a user might want to edit normals.

  • On mesh normal editing.
  • Copy normal from another object, a modifier.
  • Change normal to simple shape like sphere, oval, cylinder, based on object bounding box, a modifier.
  • The ability to bake normal to another object (make normal permanent, but not a texture).

Further reading:

Love what you are reading? Want to get involved but limited in the technical know-how? Read more: