Materials - Transparency in Blender

Embed Size (px)

Citation preview

  • 7/30/2019 Materials - Transparency in Blender

    1/9

    From BlenderWiki

    Transparency

    Mode: All Modes

    Panel: Shading/Material Context Transparency

    Materials in Blender can be set to be transparent, so that light can pass through any objects using the material.

    Transparency is controlled using an "alpha" channel, where eachpixel has an additional value, range 0-1, in addition to

    its RGB color values. Ifalpha=0, then the pixel is transparent, and the RGB values for the surface contribute nothing to

    the pixel's appearance; for alpha=1, the surface is fully opaque, and the color ofthe surface determines the final color

    ofthe pixel.

    In Blender, there are three ways in which the transparency ofamaterial canbe set: Mask, Z-Buffer and Ray-trace. Each ofthese is

    explained in more detail below. The Material Preview option with a

    sphere object gives a good demonstration ofthe capabilities ofthese

    three options.

    Common Options

    The following property controls are available for all transparency options:

    Alpha

    Sets the transparency ofthe material by setting all pixels in the alpha channel to the given value.

    Fresnel

    Sets the power ofthe Fresnel effect. The Fresnel effect controls how transparent the material is, depending on

    the angle between the surface normal and the viewing direction. Typically, the larger the angle, the more opaque

    a material becomes (this generally occurs on the outline ofthe object).

    Specular-

    Controls the alpha/fallofffor the specular color.

    BlendControls the blending between transparent and non-transparent areas. Only used ifFresnel is greater than 0.

    Mask

    This option simply masks the Background. It uses the alpha channel to mix the color ofeachpixel on the active object

    plane with the color ofthe corresponding background pixel, according to the alpha channel ofthe pixel. Thus for alpha

    = 1, the object color is seen - the object is completely opaque; but ifalpha = 0, only the background is seen - the

    object is transparent (but note that any other object behind the active object disappears).

    This is useful for making textures ofsolid or semi-transparent objects fromphotographic reference material - a mask is

    made with alpha opaque for pixels within the object, and transparent for pixels outside the object.

    See Mask Trans arenc .

  • 7/30/2019 Materials - Transparency in Blender

    2/9

    The Transparency Panel.

    Z Buffer

    This uses the alpha buffer for transparent faces. The alpha value ofeach pixel determines the mix ofthe basic color of

    the material, and the color ofthe pixel is determined fromthe objects/background behind it. Onlybasic settings are

    available with this option; it does not calculate refractions.

    Raytraced Transparency

    Uses ray tracing to calculate refractions. Ray tracing allows for complex refractions, falloff, and blurring, and is used for

    simulating the refraction oflight rays through a transparent material, like a lens.

    Note that the RayTrace option is only available in the Blender Render and Cycles render engines, but not in the Game

    Engine.

    A ray is sent fromthe camera and travels through the scene until it encounters an object. Ifthe first object hit by the ray

    is non-transparent, then the ray takes the color ofthe object.

    Ifthe object is transparent, then the ray continues its path through it to the next object, and so on, until a non-

    transparent object is finally encountered which gives the whole chain ofrays its color. Eventually, the first transparent

    object inherits the colors ofits background, proportional to its Alpha value (and the Alpha value ofeach transparent

    Material hit in between).

    But while the ray travels through the transparent object, it can be deflected fromits course according to the Index of

    Refraction (IOR) ofthe material. When you actually look through a plain sphere ofglass, you will notice that the

    background is upside-down and distorted: this is all because ofthe Index ofRefraction ofglass.

    Enable Raytracing

    To get ray-traced transparency, you need to:

    1. enable ray tracing in your Render settings. This is done in the Render context Shading Panel. Ray tracing is

    enabled by default.

    2. set your Alpha value to something other than 1.0.

    3. in order for the background material to receive light passing through your transparent object, Receive

    Transparent must be turned on for that material in the Material Shadow panel.

    Options

    In addition to the common options given above, the following property controls are

    available:

    IOR

    Index ofRefraction. Sets how much a ray traveling through the material will

    be refracted, hence producing a distorted image ofits background. See IOR

    values for Common Materials below.

    Filter

  • 7/30/2019 Materials - Transparency in Blender

    3/9

    Amount offiltering for transparent ray trace. The higher this value, the more

    the base color ofthe material will show. The material will still be transparent but it will start to take on the color

    ofthe material. Disabled (0.0) by default.

    Falloff

    How fast light is absorbed as it passes through the material. Gives 'depth' and 'thickness' to glass.

    Limit

    Materials thicker than this are not transparent. This is used to control the threshold after which the filter color

    starts to come into play.Depth

    Sets the maximum number oftransparent surfaces a single ray can travel through. There is no typical value.

    Transparent objects outside the Depth range will be rendered pitchblack ifviewed through the transparent

    object that the Depth is set for. In other words, ifyou notice black areas on the surface ofa transparent object,

    the solution is probably to increase its Depth value (this is a common issue with ray tracing transparent objects).

    You may also need to turn on transparent shadows on the background object.

    Gloss

    Settings for the glossiness ofthe material.

    Amount

    The clarity ofthe refraction. Set this to something lower than zero to get a blurry refraction.

    Threshold

    Threshold for adaptive sampling. Ifa sample contributes less than this amount (as a percentage), sampling

    is stopped.

    Samples

    Number ofcone samples averaged for blurry refraction.

    Examples

    Index of Refraction

    (Influence ofthe IOR ofan Object on the distortion ofthe background:

    spheres ofWater, Glass and Diamond(top to bottom).). There are different

    values for typical materials: Air is 1.000 (no refraction), Alcohol is 1.329, Glass is

    1.517, Plastic is 1.460, Water is 1.333 and Diamond is 2.417.

  • 7/30/2019 Materials - Transparency in Blender

    4/9

    Influence ofthe IOR ofan

    Object on the distortion ofthe

    background: spheres of Water,

    Glass and Diamond (top to

    bottom).

    Fresnel

    16 pieces ofglass rotated in various directions demonstrate the angle-dependent Fresnel effect with ray-traced (left)

    and alpha buffered transparency (right). Note that the major difference is the lack ofIOR effect in the latter case.

    (Download .blend.)

    Settings for Fresnel using ray-traced (left) and Z transparency (right).

    Note the specular highlight in the F4 glass tile (which is facing midway between the light and the camera); the Fresnel

    effect canbe seen in row C and column 6 where the faces are turned away fromthe camera.

    The amount ofFresnel effect canbe controlled by either increasing the Blend value or decreasing the Alpha value.

  • 7/30/2019 Materials - Transparency in Blender

    5/9

    A simple scene with three glasses on a surface, and three lamps. Depth was set to 4, 8, 12, and 14, resulting

    in render times of 24 sec, 34 sec, 6 min, and 11 min respectively. (Download .blend.)

    Depth

    Increasing Depth also considerably increases render time. Each time a light raypasses through a surface, the ray-

    tracing algorithm is called recursively. In the example above, each side ofeach glass has an exterior and an interiorsurface. Light rays thus have to pass through four surfaces for each glass.

    But not only that, at everypoint on a surface, some ofthe light can be reflected, or mirrored offthe surface in various

    directions. This results in multiple rays needing to be calculated for eachpoint (often referred to as a tree ofrays[1]

    (http://www.cs.unc.edu/~rademach/xroads-RT/RTarticle.html) ). In each ofthe rendered images above there are

    640400=256 000 pixels. By increasing Depth, at least one tree ofrays is added to each pixel.

    Be kind to your computer. Carefully placing objects in a scene to avoid overlapping transparent objects is often an

    interesting alternative.

    Hints

    Transparent shadows

    No transparent shadows No transparent shadows, environment lighting enabled

  • 7/30/2019 Materials - Transparency in Blender

    6/9

    Transparent shadows enabled, alpha set to 0.0 As previous, alpha set to 0.25

    Transparent shadows with ambient occlusion set to

    multiply, distance 1 (radius ofsphere)

    As previous, distance increased to 2 (diameter of

    sphere)

    By default, the shadows oftransparent objects are rendered solid black, as ifthe object was not transparent at all. But

    in reality, the more transparent an object is, the lighter its shadow will be.

    In Blender, transparent shadows are set on the materials that receive the shadows fromthe transparent object. This is

    enabled and disabled with the Receive Transparent button, in the Material context Shadow panel. The shadow's

    brightness is dependent on the Alpha value ofthe shadow casting material.

    Alternatives to transparent ray-traced shadows canbe found in the World context, namely the Ambient Occlusion,

    Environment Lighting, and Gather panels. Alternatively, a texture canbe used to control the Intensity value ofthe

    shadow-receiving material.

    IOR values for Common Materials

    The following list provides some index ofrefraction values to use when ray-traced transparency is used for various

    liquids, solids (gems), and gases:

    A

    Acetone 1.36

    Actinolite 1.618

    Agalmatolite 1.550

    Agate 1.544

    Agate 1.540

    Air 1.000

    E

    Ebonite 1.66

    Ekanite 1.600

    Elaeolite 1.532

    Emerald1.560 -

    1.605

    1.560 -

    J

    Jade, Jadeite1.64 -

    1.667

    Jade, Nephrite 1.600 -1.641

    Jadeite 1.665

    Jasper 1.540

    S

    Sanidine 1.522

    Sapphire1.757 -

    1.779

    Sapphire, Star1.760 -

    1.773

    Scapolite 1.540

  • 7/30/2019 Materials - Transparency in Blender

    7/9

    Alcohol 1.329

    Alcohol, Ethyl

    (grain)1.36

    Alexandrite 1.745

    Alexandrite 1.750

    Almandine 1.83

    Aluminum 1.44Amber 1.545

    Amblygonite 1.611

    Amethyst 1.540

    Ammolite 1.600

    Anatase 2.490

    Andalusite 1.640

    Anhydrite 1.571

    Apatite 1.632

    Apophyllite 1.536

    Aquamarine 1.575

    Aragonite 1.530

    Argon 1.000281

    Asphalt 1.635

    Axinite1.674 -

    1.704

    Axinite 1.675

    Azurite 1.730

    B

    Barite 1.636

    Barytocalcite 1.684

    Beer 1.345

    Benitoite 1.757

    Benzene 1.501

    Beryl1.57 -

    1.60

    Beryl, Red1.570 -

    1.598

    Beryllonite 1.553

    Brazilianite 1.603

    Bromine (liq) 1.661

    Bronze 1.18

    Brownite 1.567

    C

    Calcite 1.486

    Calspar 1.486

    Cancrinite 1.491

    Carbon

    Emerald Catseye 1.605

    Emerald, Synth

    flux1.561

    Emerald, Synth

    hydro1.568

    Enstatite 1.663

    Epidote 1.733

    Ethanol 1.36

    Ethyl Alcohol 1.36

    Euclase 1.652

    F

    Fabulite 2.409

    Feldspar,

    Adventurine1.532

    Feldspar, Albite 1.525Feldspar,

    Amazonite1.525

    Feldspar,

    Labradorite1.565

    Feldspar,

    Microcline1.525

    Feldspar,

    Oligoclase1.539

    Flourite 1.434

    Formica 1.47

    G

    Garnet, Andradite1.88 -

    1.94

    Garnet,

    Demantoid

    1.880 -

    1.9

    Garnet,

    Demantoid1.880

    Garnet, Grossular 1.738

    Garnet, Hessonite 1.745

    Garnet, Mandarin1.790 -

    1.8

    Garnet, Pyrope1.73 -

    1.76

    Garnet, Rhodolite1.740 -

    1.770

    Garnet, Rhodolite 1.760

    Garnet,

    Spessartite1.810

    Garnet, Tsavorite1.739 -

    1.744

    Jet 1.660

    K

    Kornerupine 1.665

    Kunzite1.660 -

    1.676

    Kyanite 1.715

    L

    Labradorite1.560 -

    1.572

    Lapis Gem 1.500

    Lapis Lazuli1.50 -

    1.55

    Lazulite 1.615

    Lead 2.01

    Leucite 1.509

    M

    Magnesite 1.515

    Malachite 1.655

    Meerschaum 1.530

    Mercury (liq) 1.62

    Methanol 1.329

    Milk 1.35

    Moldavite 1.500

    Moonstone 1.518 -1.526

    Moonstone,

    Adularia1.525

    Moonstone,

    Albite1.535

    Morganite1.585 -

    1.594

    N

    Natrolite 1.480

    Nephrite 1.600

    Nitrogen (gas) 1.000297

    Nitrogen (liq) 1.2053

    Nylon 1.53

    O

    Obsidian 1.489

    Oil of

    Wintergreen

    1.536

    Oil, Clove 1.535

    Oil, Lemon 1.481

    Oil, Neroli 1.482

    Scapolite, Yellow 1.555

    Scheelite 1.920

    Selenium,

    Amorphous2.92

    Serpentine 1.560

    Shampoo 1.362

    Shell 1.530Silicon 4.24

    Sillimanite 1.658

    Silver 0.18

    Sinhalite 1.699

    Smaragdite 1.608

    Smithsonite 1.621

    Sodalite 1.483

    Sodium Chloride 1.544

    Spessartite1.79 -

    1.81

    Sphalerite 2.368

    Sphene 1.885

    Spinel1.712 -

    1.717

    Spinel, Blue1.712 -

    1.747

    Spinel, Red 1.708 -1.735

    Spodumene 1.650

    Star Ruby1.76 -

    1.773

    Staurolite 1.739

    Steatite 1.539

    Steel 2.50

    Stichtite 1.520

    Strontium Titanate 2.410

    Styrofoam 1.595

    Sugar Solution

    30%1.38

    Sugar Solution

    80%1.49

    Sulphur 1.960

    Synthetic Spinel 1.730

    TTaaffeite 1.720

    Tantalite 2.240

    Tanzanite1.690-

  • 7/30/2019 Materials - Transparency in Blender

    8/9

    Dioxide (gas) 1.000449

    Carbon

    Disulfide1.628

    Carbon

    Tetrachloride1.460

    Carbonated

    Beverages

    1.34 -

    1.356Cassiterite 1.997

    Celestite 1.622

    Cerussite 1.804

    Ceylonite 1.770

    Chalcedony1.544 -

    1.553

    Chalk 1.510

    Chalybite 1.630

    Chlorine (gas) 1.000768

    Chlorine (liq) 1.385

    Chrome Green 2.4

    Chrome Red 2.42

    Chrome

    Tourmaline

    1.61 -

    1.64

    Chrome Yellow 2.31

    Chromium 2.97

    Chrysoberyl 1.745

    Chrysoberyl,

    Cat's eye

    1.746 -

    1.755

    Chrysocolla 1.500

    Chrysoprase 1.534

    Citrine1.532 -

    1.554

    Citrine 1.550

    Clinohumite1.625 -

    1.675

    Clinozoisite 1.724

    Cobalt Blue 1.74

    Cobalt Green 1.97

    Cobalt Violet 1.71

    Colemanite 1.586

    Copper 1.10

    Copper Oxide 2.705

    Coral 1.486

    Coral1.486 -

    1.658

    Cordierite 1.540

    Garnet, Uvarovite 1.74 -

    1.87

    Gaylussite 1.517

    Glass 1.51714

    Glass, Albite 1.4890

    Glass, Crown 1.520

    Glass, Crown,Zinc

    1.517

    Glass, Flint, Dense 1.66

    Glass, Flint,

    Heaviest1.89

    Glass, Flint,

    Heavy1.65548

    Glass, Flint,

    Lanthanum1.80

    Glass, Flint, Light 1.58038Glass, Flint,

    Medium1.62725

    Glycerine 1.473

    Gold 0.47

    H

    Hambergite 1.559

    Hauyne1.490 -

    1.505

    Hauynite 1.502

    Helium 1.000036

    Hematite 2.940

    Hemimorphite 1.614

    Hiddenite 1.655

    Honey, 13%

    water content1.504

    Honey, 17%

    water content

    1.494

    Honey, 21%

    water content1.484

    Howlite 1.586

    Hydrogen (gas) 1.000140

    Hydrogen (liq) 1.0974

    Hypersthene 1.670

    I

    Ice 1.309

    Idocrase 1.713

    Iodine Crystal 3.34

    1.522 -

    Oil, Orange 1.473

    Oil, Safflower 1.466

    Oil, vegetable

    (50 C)1.47

    Olivine 1.670

    Onyx 1.486

    Opal, Black 1.440 -1.460

    Opal, Fire1.430 -

    1.460

    Opal, White1.440 -

    1.460

    Oregon

    Sunstone

    1.560 -

    1.572

    Oxygen (gas) 1.000276

    Oxygen (liq) 1.221P

    Padparadja1.760 -

    1.773

    Painite 1.787

    Pearl 1.530

    Periclase 1.740

    Peridot1.635 -

    1.690

    Peristerite 1.525

    Petalite 1.502

    Phenakite 1.650

    Phosgenite 2.117

    Plastic 1.460

    Plexiglas 1.50

    Polystyrene 1.55

    Prase 1.540

    Prasiolite 1.540

    Prehnite 1.610

    Proustite 2.790

    Purpurite 1.840

    Pyrite 1.810

    Pyrope 1.740

    Q

    Quartz1.544 -

    1.553Quartz, Fused 1.45843

    R

    Rhodizite 1.690

    1.7

    Teflon 1.35

    Thomsonite 1.530

    Tiger eye 1.544

    Topaz1.607 -

    1.627

    Topaz, Blue 1.610

    Topaz, Imperial1.605 -

    1.640

    Topaz, Pink 1.620

    Topaz, White 1.630

    Topaz, Yellow 1.620

    Tourmaline1.603 -

    1.655

    Tourmaline 1.624

    Tourmaline, Blue1.61 -

    1.64

    Tourmaline,

    Catseye

    1.61 -

    1.64

    Tourmaline, Green1.61 -

    1.64

    Tourmaline,

    Paraiba

    1.61 -

    1.65

    Tourmaline, Red

    1.61 -

    1.64

    Tremolite 1.600

    Tugtupite 1.496

    Turpentine 1.472

    Turquoise 1.610

    U

    Ulexite 1.490

    Uvarovite 1.870

    V-WWardite 1.590

    Variscite 1.550

    Water (0 C) 1.33346

    Water (100 C) 1.31766

    Water (20 C) 1.33283

    Water (gas) 1.000261

    Water (35 C,

    room temp)1.33157

    Whisky 1.356

    Willemite 1.690

    Witherite 1.532

  • 7/30/2019 Materials - Transparency in Blender

    9/9

    Corundum 1.766

    Cranberry Juice

    (25%)1.351

    Crocoite 2.310

    Crystal 2.000

    Cuprite 2.850

    D

    Danburite1.627 -

    1.641

    Danburite 1.633

    Diamond 2.417

    Diopside 1.680

    Dolomite 1.503

    Dumortierite 1.686

    Iolite 1.578

    Iron 1.51

    Ivory 1.540

    Rhodochrisite 1.600

    Rhodonite 1.735

    Rock Salt 1.544

    Rubber,

    Natural1.5191

    Ruby1.757 -

    1.779Rum, White 1.361

    Rutile 2.62

    Vivianite 1.580

    Vodka 1.363

    Wulfenite 2.300

    Z

    Zincite 2.010

    Zircon1.777 -

    1.987Zircon, High 1.960

    Zircon, Low 1.800

    Zirconia, Cubic2.173 -

    2.21

    Retrieved from "http://wiki.blender.org/index.php/Doc:2.6/Manual/Materials/Properties/Transparency"

    Category: Materials