Site Tools


Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
brazil:shaders [2015/10/12]
sandy
brazil:shaders [2015/10/12] (current)
sandy
Line 26: Line 26:
 In Brazil, everything that makes a visible impact on a rendering is referred to as a //shader//. This includes lights, environments,​ materials, textures, and even camera lenses. Essentially,​ shaders are predefined behavioral patterns that affect the rays during the ray-tracing process. In Brazil, everything that makes a visible impact on a rendering is referred to as a //shader//. This includes lights, environments,​ materials, textures, and even camera lenses. Essentially,​ shaders are predefined behavioral patterns that affect the rays during the ray-tracing process.
  
-For example, imagine the process ​as it takes place for the solution of a single pixel during a Brazil rendering. First, a ray is shot from the pixel in question into the camera lens shader (**A»B**). The lens shader then changes the ray's direction so that it adheres to the current camera projection and depth-of-field settings. The ray is now in the Model space and it is liable to hit an object, such as a green, partially reflective sphere. Once the ray hits the sphere at **C** it scatters into multiple new rays. First, from the impact point new rays are traced towards all light sources in the model (**C»D**). These shadow rays determine the intensity and color (if any) of the effect of every light on the little patch of geometry at **C**. All this lighting information is combined by the material shader of the sphere in a specific way (could be a Lambertian algorithm, or maybe an Oren-Nayar, or a million things more) to calculate the color at **C**. Yet, this is not the end of the process. Since our sphere is partially reflective, the material shader needs to know both the total of all lighting and the color of what is visible in the mirror. Thus it needs to cast yet another ray into the model (**C»E**) which again might intersect with geometry, setting off a new iteration. However, this is a simplified case. So our reflecting ray does not intersect any other objects, but instead terminates at the environment shader:+For example, imagine the process for a single pixel during a Brazil rendering. First, a ray is shot from the pixel in question into the camera lens shader (**A»B**). The lens shader then changes the ray's direction so that it adheres to the current camera projection and depth-of-field settings. The ray is now in the Model space and it is liable to hit an object, such as a green, partially reflective sphere. Once the ray hits the sphere at **C** it scatters into multiple new rays. First, from the impact point new rays are traced towards all light sources in the model (**C»D**). These shadow rays determine the intensity and color (if any) of the effect of every light on the little patch of geometry at **C**. All this lighting information is combined by the material shader of the sphere in a specific way (could be a Lambertian algorithm, or maybe an Oren-Nayar, or a million things more) to calculate the color at **C**. Yet, this is not the end of the process. Since our sphere is partially reflective, the material shader needs to know both the total of all lighting and the color of what is visible in the mirror. Thus it needs to cast yet another ray into the model (**C»E**) which again might intersect with geometry, setting off a new iteration. However, this is a simplified case. So our reflecting ray does not intersect any other objects, but instead terminates at the environment shader:
  
 \\ \\
Line 36: Line 36:
 \\ \\
  
-In a complex rendering with Skylight, GI, glossy reflection or subsurface scattering, the amount of rays that are spawn from a single pixel-ray can be truly astonishing. In fact, many settings in the Brazil and shader options directly specify the amount of new rays that are allowed to estimate the actual color of a specific effect. Add to this the fact that most materials in Brazil are actually compositions of many small shaders, and the numbers start to grow beyond comprehension. The diagram below is a schematic representation of such a Brazil composite shader. It shows how different effects are combined to form the complete shader:+In a complex rendering with Skylight, GI, glossy reflection or subsurface scattering, the amount of rays spawn from a single pixel-ray can be truly astonishing. In fact, many settings in the Brazil and shader options directly specify the amount of new rays that are allowed to estimate the actual color of a specific effect. Add to this the fact that most materials in Brazil are actually compositions of many small shaders, and the numbers start to grow beyond comprehension. The diagram below is a schematic representation of such a Brazil composite shader. It shows how different effects are combined to form the complete shader:
  
 \\ \\
Line 119: Line 119:
 | **BAM Default shader** | | **BAM Default shader** |
 |    {{:​legacy:​en:​BR_BAMDefault_Default.png}} ​   |    {{:​legacy:​en:​BR_BAMDefault_Green.png}} ​   |    {{:​legacy:​en:​BR_BAMDefault_Blinn.png}} ​   |    {{:​legacy:​en:​BR_BAMDefault_BlinnAnisotropic.png}} ​   | |    {{:​legacy:​en:​BR_BAMDefault_Default.png}} ​   |    {{:​legacy:​en:​BR_BAMDefault_Green.png}} ​   |    {{:​legacy:​en:​BR_BAMDefault_Blinn.png}} ​   |    {{:​legacy:​en:​BR_BAMDefault_BlinnAnisotropic.png}} ​   |
-| This is the default shader with a white color and no highlight. The surfaces are completely diffuse. The spheres are lit by a pointlight and a skydome and some of them are displaced. This is a property of the geometry, not the shader. | We can change the diffuse color of the shader to be any HDR color or texture. In this case we choose ​a simple olive green. | The BAM shader comes with three different types of specular highlight shader: Blinn, Phong and Sheen. Blinn and Phong are visually similar. They both boost the intensity of the surface sections that //reflect// light sources in the model. This is merely a computational trick. There is no actual reflection going on. You can use highlights to invoke a sensation of shininess without compromising your render time performance. | The Blinn highlight is capable of anisotropicity,​ meaning the highlight becomes stretched instead of round. This is useful for simulating ​shinyness ​of materials with micro-grooves such as brushed metals or plastics. |+| This is the default shader with a white color and no highlight. The surfaces are completely diffuse. The spheres are lit by a pointlight and a skydome and some of them are displaced. This is a property of the geometry, not the shader. | We can change the diffuse color of the shader to be any HDR color or texture. In this case we chose a simple olive green. | The BAM shader comes with three different types of specular highlight shader: Blinn, Phong and Sheen. Blinn and Phong are visually similar. They both boost the intensity of the surface sections that //reflect// light sources in the model. This is merely a computational trick. There is no actual reflection going on. You can use highlights to invoke a sensation of shininess without compromising your render time performance. | The Blinn highlight is capable of anisotropicity,​ meaning the highlight becomes stretched instead of round. This is useful for simulating ​shininess ​of materials with micro-grooves such as brushed metals or plastics. |
 |    {{:​legacy:​en:​BR_BAMDefault_Sheen.png}} ​   |    {{:​legacy:​en:​BR_BAMDefault_Reflect.png}} ​   |    {{:​legacy:​en:​BR_BAMDefault_GlossyReflect.png}} ​   |    {{:​legacy:​en:​BR_BAMDefault_TextureReflect.png}} ​   | |    {{:​legacy:​en:​BR_BAMDefault_Sheen.png}} ​   |    {{:​legacy:​en:​BR_BAMDefault_Reflect.png}} ​   |    {{:​legacy:​en:​BR_BAMDefault_GlossyReflect.png}} ​   |    {{:​legacy:​en:​BR_BAMDefault_TextureReflect.png}} ​   |
-| Use the Sheen highlight to mimic the reflection of light sources on surfaces with micro-faceting. In order words, non-smooth surfaces such as fabrics and some plastics. Sheen highlights always appear along the edges of surfaces and they are integral to shaders such as Wax and Velvet. | The BAM Default is also capable actual reflections and refractions. Here, the highlight shader is disabled and the reflectivity of the material has been set to 50%. The green color of the diffuse illumination is almost swamped by the blueness of the reflection. By setting the Tint of the reflection, this desaturation can be countered (not shown). | Reflection in the BAM shaders is sharp by default, but it can be made glossy (blurry). Glossy reflections take longer to render (sometimes significantly so). | Using a texture override in the base colour ​and a faint reflection, the BAM Default shader can be use to mimic a wide range of mirroring objects. |+| Use the Sheen highlight to mimic the reflection of light sources on surfaces with micro-faceting. In other words, non-smooth surfaces such as fabrics and some plastics. Sheen highlights always appear along the edges of surfaces and they are integral to shaders such as Wax and Velvet. | The BAM Default is also capable ​of actual reflections and refractions. Here, the highlight shader is disabled and the reflectivity of the material has been set to 50%. The green color of the diffuse illumination is almost swamped by the blueness of the reflection. By setting the Tint of the reflection, this desaturation can be countered (not shown). | Reflection in the BAM shaders is sharp by default, but it can be made glossy (blurry). Glossy reflections take longer to render (sometimes significantly so). | Using a texture override in the base color and a faint reflection, the BAM Default shader can be use to mimic a wide range of mirroring objects. |
  
 \\ \\
Line 130: Line 130:
 =====BAM Carpaint===== =====BAM Carpaint=====
  
-The Carpaint shader is, obviously, designed to simulate metallic painted surfaces. There'​s more to real carpaint ​than just reflection and this shader aims to capture those evanescent properties. In addition to the BAM Default shader, Carpaint adds these three effects. Use these individually or in conjunction:​+The Carpaint shader is, obviously, designed to simulate metallic painted surfaces. There'​s more to real car paint than just reflection and this shader aims to capture those evanescent properties. In addition to the BAM Default shader, Carpaint adds these three effects. Use these individually or in conjunction:​
  
   * Falloff (Controls the mutation of paint color at shallow angles)   * Falloff (Controls the mutation of paint color at shallow angles)
Line 140: Line 140:
 | **BAM Carpaint Shader (Flakes)** | | **BAM Carpaint Shader (Flakes)** |
 |    {{:​legacy:​en:​Br_BAMCarPaintNoFlakes.png}} ​   |    {{:​legacy:​en:​Br_BAMCarPaint05Flakes.png}} ​   |    {{:​legacy:​en:​Br_BAMCarPaint10Flakes.png}} ​   |    {{:​legacy:​en:​Br_BAMCarPaintSmallFlakes.png}} ​   | |    {{:​legacy:​en:​Br_BAMCarPaintNoFlakes.png}} ​   |    {{:​legacy:​en:​Br_BAMCarPaint05Flakes.png}} ​   |    {{:​legacy:​en:​Br_BAMCarPaint10Flakes.png}} ​   |    {{:​legacy:​en:​Br_BAMCarPaintSmallFlakes.png}} ​   |
-| A BAM Carpaint shader without flakes looks a bit like a BAM Default with reflection, but there is an unmistakable hue gradient in the upper left area of the sphere which is impossible to achieve using the BAM Default. This is the Candy effect. The diffuse color of this shader is orange, the Candy is pink, and the falloff is dark red. You can see all those colours ​fighting for dominance on the surface. | By adding a few faint flakes, the surface becomes more crisp. Also, the scale of the flake noise immediately conveys a scale for the entire object. It is no longer a hypothetical sphere. | My making the flakes less faint (but not bigger or more numerous) the effect is amplified. However, the flakes are slightly too big to give a proper Carpaint feel. | Adjusting the flake size helps to increase the realism of the image. Note that flakes are a microscopic effect (same as anisotropicity and micro-faceting) which should not be viewed up close. |+| A BAM Carpaint shader without flakes looks a bit like a BAM Default with reflection, but there is an unmistakable hue gradient in the upper left area of the sphere which is impossible to achieve using the BAM Default. This is the Candy effect. The diffuse color of this shader is orange, the Candy is pink, and the falloff is dark red. You can see all those colors ​fighting for dominance on the surface. | By adding a few faint flakes, the surface becomes more crisp. Also, the scale of the flake noise immediately conveys a scale for the entire object. It is no longer a hypothetical sphere. | My making the flakes less faint (but not bigger or more numerous) the effect is amplified. However, the flakes are slightly too big to give a proper Carpaint feel. | Adjusting the flake size helps to increase the realism of the image. Note that flakes are a microscopic effect (same as anisotropicity and micro-faceting) which should not be viewed up close. |
 |    {{:​legacy:​en:​Br_BAMCarPaintMediumFlakes.png}} ​   |    {{:​legacy:​en:​Br_BAMCarPaintLargeFlakes.png}} ​   |    {{:​legacy:​en:​Br_BAMCarPaintHugeFlakes.png}} ​   |    {{:​legacy:​en:​Br_BAMCarPaintFunkyColours.png}} ​   | |    {{:​legacy:​en:​Br_BAMCarPaintMediumFlakes.png}} ​   |    {{:​legacy:​en:​Br_BAMCarPaintLargeFlakes.png}} ​   |    {{:​legacy:​en:​Br_BAMCarPaintHugeFlakes.png}} ​   |    {{:​legacy:​en:​Br_BAMCarPaintFunkyColours.png}} ​   |
 | Increasing flake size... | Increasing flake size... | Increasing flake size... | Typically, the best Carpaint shaders use colors that have similar hue values. When one departs from this rule of thumb, some pretty funky (but not very realistic) results can be yielded. | | Increasing flake size... | Increasing flake size... | Increasing flake size... | Typically, the best Carpaint shaders use colors that have similar hue values. When one departs from this rule of thumb, some pretty funky (but not very realistic) results can be yielded. |
Line 167: Line 167:
 | **BAM Glow Worm shader** | | **BAM Glow Worm shader** |
 |    {{:​legacy:​en:​BR_BAMGlowWorm_NoGlow.png}} ​   |    {{:​legacy:​en:​BR_BAMGlowWorm_WeakGlow.png}} ​   |    {{:​legacy:​en:​BR_BAMGlowWorm_StrongGlow.png}} ​   | |    {{:​legacy:​en:​BR_BAMGlowWorm_NoGlow.png}} ​   |    {{:​legacy:​en:​BR_BAMGlowWorm_WeakGlow.png}} ​   |    {{:​legacy:​en:​BR_BAMGlowWorm_StrongGlow.png}} ​   |
-| With incandescense disabled, the Glow Worm behaves identical to BAM Lambert. | With weak incandescense,​ the part of the sphere which is unlit by the spotlight starts to glow, casting a GI glow over the groundplane. | Strong incandescense amplifies the effect. Use the Glow Worm to mimic sub-surface scattering without all the computational overhead. |+| With incandescense disabled, the Glow Worm behaves identical to BAM Lambert. | With weak incandescense,​ the part of the sphere which is unlit by the spotlight starts to glow, casting a GI glow over the ground plane. | Strong incandescense amplifies the effect. Use the Glow Worm to mimic sub-surface scattering without all the computational overhead. |
  
 \\ \\
brazil/shaders.txt · Last modified: 2015/10/12 by sandy