Shader Parameters Rollout

Available in Krakatoa v1.6.0 and higher

Overview

  • In v1.5.x, the Shader (Phase Function) options were displayed in a dedicated area inside the Main Controls rollout.
  • To facilitate future shaders with more than two per-particle data channels planned for upcoming versions of Krakatoa, a dynamically generated Shader Rollout had to be introduced.
    • This new rollout is built from a UI controls definition provided as a MAXScript array value and can contain float, integer and vector channels, float and integer spinners, checkboxes, drop-down lists, groups and label controls.
    • This new code also ensures the properties required by these UI options are also automatically created in the renderer, and ensures integration with Render Elements.

User Interfaces

Isotropic

../../../_images/krakatoa16_shaderparametersrollout_isotropic.png
  • The Isotropic Phase Function does not expose any parameters and it provides no User Interface controls.
  • Isotropic Shading will scatter light uniformly in all directions and is independent from the angle between camera and light source.

Phong Surface

../../../_images/krakatoa16_shaderparametersrollout_phongsurface.png

Render Elements

  • The Phong Surface Shader Paramters dynamic rollout provides two pairs of buttons for adding and removing KrakatoaShaderElements to the Render Elements tab of the Render Setup dialog.
    • Pressing the Create [Diffuse] Render Element button will add a new KrakatoaShaderElement set to Shader:Phong Surface and Component:Diffuse.
    • Pressing the Create [Specular] Render Element button will add a new KrakatoaShaderElement set to Shader:Phong Surface and Component:Specular.
    • Pressing the corresponding Delete Render Element button will delete the Diffuse or Specular Render Element from the Render Elements list.
    • When a Render Element of the given type exists, the Create… button will be grayed out.
    • When a Render Element of the given type does not exist, the corresponding Delete Render Element button will be grayed out.
    • When pressing these buttons, the Render Elements tab of the Render Setup dialog can be opened automatically according to the behavior set in the User Interface and Interaction Preferences dialog.

Parameters and Channels

  • The Phong Surface Phase Function provides two optional per-particle Channels.

Specular Power

  • Specular Power (a.k.a. Glossiness) is the value defining the shape of the Specular Highlight in the Phong Shading Model.
  • When unchecked (default), the SpecularPower Channel will not be allocated. The rendered will access the Default Specular Power value and use it uniformly for all particles without any memory overhead.
  • When checked, the SpecularPower Channel will be allocated and initialized to the Default Specular Power value. It can be overwritten by local or global KCMs before being used by the renderer to define the Specular Power of a particle.

Specular Level

  • Specular Level (a.k.a. Shininess Strength) is the value defining the strength of the Specular Highlight in the Phong Shading Model. It is used to multiply the result of the dot product of Half Vector and Camera to the power of the SpecularPower.
  • When unchecked (default), the SpecularLevel Channel will not be allocated. The rendered will access the Default Specular Level value and use it uniformly for all particles without any memory overhead.
  • When checked, the SpecularLevel Channel will be allocated and initialized to the Default Specular Level value. It can be overwritten by local or global KCMs before being used by the renderer to define the Specular Level of a particle.

Henyey-Greenstein

../../../_images/krakatoa16_shaderparametersrollout_henyeygreenstein.png
  • The Henyey-Greenstein Phase Function provides only one parameter: Eccentricity.
    • When the Per-particle [Eccentricity] Channel checkbutton is unchecked, the Default Eccentricity value will be used for all particles without any memory overhead.
    • When the Per-particle [Eccentricity] Channel checkbutton is checked, the Eccentricity particle channel will be allocated in memory and will be initialized to the Default Eccentricity value. It can be set per particle using Krakatoa Channels Modifiers for ultimate flexibility at the cost of some memory overhead.
    • The Phase Eccentricity value can range from -1.0 to 1.0.
    • When set to 0.0 (default), the Shader will behave like the Isotropic one since the angle between light and camera will play no role in the scattering behavior of particles.
    • As the Eccentricity changes between -1.0 and 1.0, the Phase Function will cause light to be scattered more or less into the eye based on the angle between light and camera, favoring back lighting or front lighting.

Schlick

../../../_images/krakatoa16_shaderparametersrollout_schlick.png
  • The Schlick Phase Function provides only one parameter: Eccentricity.
    • When the Per-particle [Eccentricity] Channel checkbutton is unchecked, the Default Eccentricity value will be used for all particles without any memory overhead.
    • When the Per-particle [Eccentricity] Channel checkbutton is checked, the Eccentricity particle channel will be allocated in memory and will be initialized to the Default Eccentricity value. It can be set per particle using Krakatoa Channels Modifiers for ultimate flexibility at the cost of some memory overhead.
    • The Phase Eccentricity value can range from -1.0 to 1.0.
    • When set to 0.0 (default), the Shader will behave like the Isotropic one since the angle between light and camera will play no role in the scattering behavior of particles.
    • As the Eccentricity changes between -1.0 and 1.0, the Phase Function will cause light to be scattered more or less into the eye based on the angle between light and camera, favoring back lighting or front lighting.

SEE ALSO

  • Shaders (Phase Functions)