From BlenderWiki
- Developer's page
- design ideas
- regression files
- Latest News
- IRC: #blenderpovray at freenode
| UI location | Renderer rolldown menu | ||
|---|---|---|---|
| Usage | If POV-Ray 3.7 is installed, activate the addon in the menu File » User Preferences. Choose it as the renderer and render with F12. | ||
| Version | 0.0.8 | Author(s) | Campbell Barton, Silvio Falcinelli, Maurice Raybaud, Constantin Rahn |
| Blender | 2.57 | License | GPL |
| Category | Render | Distribution | Release |
| Note(s) | After May the 10th 2011, some development to the script limited backwards compatibility: If you set up some files prior to that and always use the latest exporter from SVN. It is advised to run the update script and resave your scene with the new version: get to the search bar with Space and type pov to access this command. | ||
| File name | (Python script)+ POV-Ray 3.7 |
|---|---|
| Current version download | https://svn.blender.org/svnroot/bf-extensions/trunk/py/scripts/addons/render_povray/ |
| Python modules | Used standard Python modules |
| External Python Modules or dependencies | POV-Ray 3.7 current beta |
| Bug reports | https://projects.blender.org/tracker/index.php?func=detail&aid=23145 | |
|---|---|---|
| Warning | Both POV-Ray 3.7 and this script are beta. | |
| Links | http://povray.org/ | |
| Release Log | Dev:2.5/Py/Scripts/Render/POV-Ray | |
| Known Issues | Currently Important:
| |
POV-Ray 3.7 Integration with Blender 2.5x
POV-Ray is an an SDL based (Scene Description Language) rendering engine with a long history that makes it very stable and feature rich. The latest version of POV-Ray 3.7 can be found at: http://www.povray.org/beta/
Features
Some key features of the exporter include:
- Geometry and modifiers
- Material properties such as filtering, emission, translucency, subsurface light transport...
- Texture channels: Alpha ; Diffuse ; Bump ; Specular ; Mirror (uses same channel as specular)
- Global Illumination: Radiosity (Indirect Lighting) ; Photons caustics (reflect/refract)
Installation
Though this exporter is currently shipped with any official Blender builds, the POV-Ray 3.7 renderer itself is not included in Blender like some other renderers are (Cycles or Freestyle for instance). Instead, users are just expected to download and install it for themselves as explained below.
Windows
Binaries are compiled for every new version of POV-Ray and available in the Windows Download section of this page: http://www.povray.org/beta Running the setup.exe installer with standard options is enough to set POV-Ray up and in working order for the Blender exporter.
Linux
- Download the source from here:
http://www.povray.org/beta/source/
- Navigate from a terminal into the folder where you uncompressed it and type:
./configure COMPILED_BY="your name <email@address>"
if you get an error, whatever will follow the "configure: error: " is the names of missing libraries on your system, it could be boost, libpng, or anything... Go to your package manager such as Synaptic or whatever, and install each of them preferably the specific version which is asked for. At the end of the configure command, this should be written:
Unix man page:/usr/local/share/man
- then type:
make make install
That's all, you should then have POV-Ray 3.7 installed.
Usage
Quick Start
| 1. Go to the menu File » User Preferences | |
| 2. Choose the Add-Ons tab and check POV-Ray 3.7 down the list of render Add-Ons. | |
| 3. Choose POV-Ray 3.7 from renderer choices. Then you can render as usual with the Image render button or its shortcut (F12 in default layout) |
Render Properties
-Radiosity in POV-Ray is diffuse inter-reflection which has nothing to do with vertex color based radiosity.
-Anti-aliasing: two sampling methods are supported: recursive and non-recursive, sampling depth, Anti-alias threshold. (POV-Ray Wiki: Anti-Aliasing Options)
| Depth of Field Without Anti-Aliasing | |
| Using no anti aliasing when camera Depth of field is on will speed up rendering and often provide decent enough images. |
-Bounding method switched to automatic BSP by the exporter as it's generally the most efficient(POV-Ray 3.7 only) but other acceleration methods are available in POV-Ray.
-Command line switches allow some command line arguments to be passed to POV-Ray. Arguments are separated by spaces. Command line switches consist of a / (Slash), + (plus) or - (minus) sign, followed by one or more alphabetic characters and possibly a numeric value. (POV-Ray Wiki: Command line options)
| -D | Hide image while rendering Use the command line switch -D to not show the rendered image in POV-Ray (slightly faster and lighter on memory). The image will be sent back to Blender after completion (on Linux this is a hidden default switch to avoid OS specific editor problems).}} |
| +WT | Limit the number of threads used +WT1 limits POV-Ray to using only one single render thread. (Likewise, +WT2 would instruct POV-Ray to use two render threads.) |
| +C | Continue an interrupted render +C for "Continue trace" is able to recover the point at which your last render stopped and continue it from there (even if you switched off your computer) |
| /EXIT | Close POV-Ray after rendering the image There is also an option in POV-Ray for windows interface to do the same: The "On Completion" option to "Exit POV-Ray for Windows" (in the Render Menu).
|
| Fast Preview Renders | |
| When first setting up your scene, and for fast preview rendering, turn off anti aliasing, depth of field, photons, Radiosity, expensive material features, and in the scene Shading panel, turn off shadows. (other features might get turned off from this panel in future versions of the exporter) Alternatively, use the "quality" command line switches +q1 to +q11. These allow you to easily disable most of the CPU-intensive features. |
-Formatting of the exported POV-Ray file: Different indentation characters to choose from. Option to add comments to POV-Ray file. Option to write long lists of coordinates in one line for easier browsing of the POV file (and slightly faster parsing by the renderer)
Scene Properties
World Properties
-Background gets exported (sky texture appears a little different because of convoluted workaround used).
|
Atmospheric Media (to create volume lights): |
Object Properties
Importance sampling can be set for Radiosity to shoot more rays at object that require them most.
Data Properties
-Exports Sky, Lights, Meshes and Blobs (MetaBalls). (Limitation for Blobs: MetaBalls with same naming are not combined the same as in Blender. MBall, MBall.001 ...)
Camera
-Depth of field Based on Blender UI distance field, not object field. With fixed blur amount for now.
Lamp
-No Shadows toggle button can be used to deactivate tracing of shadows for specific lamps only
| For Realistic Light Attenuation | |
| Use Inverse square falloff, and a small falloff distance value with a higher light intensity will give the best results with Povray's implementation of inverse square law. See this discussion |
Material Properties
-Emission (new in POV-Ray 3.7)
| Mesh Lights | |
| When used together with Radiosity, Emit property will allow you to create light bulbs or any luminous form that really illuminates other objects. |
-SSS (new in POV-Ray 3.7). Exporter uses only ui presets.
-Translucency (new in POV-Ray 3.7)
-IOR Mirror option for using one consistent IOR for raytrace reflection and refraction and not breaking the law of conservation of energy between the two.
-Iridescence (Newton's thin film coating)
|
Caustics: |
| Faster Photons | |
| To set up some caustics, try moving from the smallest photon depth value to a minimum at which you start to see the effect you are after. Check off the Receive Photons object property for any object that does not really need it. (A glass object casting caustics often doesn't need to receive any itself.) Then you can balance other parameters to tune photons distribution and smoothing (gathering). Don't set the global spacing too fine in scene settings, because then you can still make it finer on each object using its spacing multiplier. If your system has several threads, they can be used in the photons stage: one thread per light, so you can then complexify your scene lighting without overhead. |
| shaders emulation attempted from blender: -Specular and diffuse toon (no edges yet) -Phong and Cook Torrence (both the same) -Blinn (not perfectly matched) -WardIso -Fresnel and Minnaert, started but not finished yet |
| Glass Like Materials | |
| When trying to achieve some glass like material, keep low diffuse value, dark or totally black to avoid dull surface and keep clear transparency. |
Texture Properties
-UV coordinates: best with planar projection for now. (Silvio Falcinelli)
-Texture channels: Alpha ; Diffuse ; Bump ; Specular ; Mirror (uses same channel as specular) --(No other channel because of POV-Ray non uniform syntax for them)
-Custom gamma for image textures (read POV-Ray 3.7 doc before using since it generally needs not be used.) (POV-Ray Wiki: Gamma Handling)
Custom POV Code
POV-Ray files are not just pure data files (like with most other renderers). They are programs, with loops, functions, etc. This means that no matter many featurs this exporter could support, POV-Ray will always have much more under the hood.
You can add custom POV code directly in Blender's text editor, all you have to do is to make sure this pov code has directly or indirectly a #declare keyword, followed by the name of your choice and the pov item you want to use. (Current POV syntax is closer to C than Python, so anything that follows two slash character ( // ) is a comment)
-Adding items directly Pov items can be anything but for now only the equivalent of Blender materials can be replaced with this method. In Povray, it is called texture {} don't get confused, it really includes all the material properties.
Though you can directly specify a texture {} block in POV-Ray files, the #declare directive allows to assign it to a variable and reuse it more easily. The exporter makes use of this feature by default, so you won't be able to use your custom texture, unless you declare it. Here is an example:
#declare MyTexture = texture{ pigment{ brick color rgb< 0.99, 0.99, 0.99> // color mortar color rgb< 0.75, 0.5, 0.30>*0.75 // color brick brick_size <0.25, 0.0525, 0.125> // format in x ,y and z- direction mortar 0.01 // size of the mortar scale 3 } // end of pigment normal {wrinkles 0.75 scale 0.01} finish {ambient 0.15 diffuse 0.95 phong 0.2} rotate<0,0,0> translate< 0.01, 0.00, 0.00> } // end of texture
To use this texture you must display the text properties (menue View > Properties) and check Custom Pov Code option: ADD IMAGE
Then you have to go into the material properties to the Custom Pov Code field, and just type in the name of your declared item to use: MyTexture in the example Given: ADD IMAGE
Then you can render your image normally and the material will be replaced:
ADD IMAGE
-Adding items indirectly from include files In any Povray scene you can use the #include directive to add items from an external Povray file. It's like the import function in Python. The files to be included have .inc as their name extension. Then in the replacement field, you can type in any of the declared names available in the include file. "Out of the box", Povray ships with a lot of include files. So you can use them for your textures, but you can also use them for some of their elements. For instance a very often used include file is one that allows to call colors by their names instead of numbers called colors.inc, so the previous example could also be written:
#include "colors.inc" #declare MyTexture = texture{ pigment{ brick color White*0.99 // color mortar color rgb< 0.75, 0.5, 0.30>*0.75 // color brick brick_size <0.25, 0.0525, 0.125> // format in x ,y and z- direction mortar 0.01 // size of the mortar scale 3 } // end of pigment normal {wrinkles 0.75 scale 0.01} finish {ambient 0.15 diffuse 0.95 phong 0.2} rotate<0,0,0> translate< 0.01, 0.00, 0.00> } // end of texture
Following this method, more custom objects are planned for future versions of the exporter: In POV-Ray a triangle mesh is just one primitive among many.
Until then You can explore the POV-Ray language by modifying the output file.
Tests
Comparison Blender <-> POV-Ray:
|
Setup: |
|
Same setup, |
Limitations
-This version of the script is a Work In Progress.
-Requires Blender version 2.56 revision 34650 or later.
-Don't use "Border-Render" to render only a part of an image! That will crash Blender at the momemt. (Maybe fixed but needs testing)
-Packed texture files need to be unpacked.
-On every rendering POV-Ray will save an image in the TEMP directory, which couldn't be deleted by the script (tested only on Win7. Same behavior on other OS?).
May Do List
See Dev:2.5/Py/Scripts/Render/POV-Ray
SAMPLE MATERIALS
All material code below is released under a simple BSD type license, so you can use it in your commercial work without any obligation. Most are built over bits of wisdom gathered from the POV-Ray community and further tweaked by the POV-Ray 3.7 exporter for Blender2.5 users.
List of contributors:
Christian Böhme, Maurice Raybaud,
Add yourself here after adding a material.
ARCHITECTURE & DESIGN
Travertine (maybe two versions deep marks, vs homogenous)
(to do)
Alpine Green Marble
(to do)
Ancient Greek Marble dark marble, with a mix of dark green, white and black fragmented marks, looking like a sort of 'terrazzo' (to do)
Golden Onyx
(to do)
Bricks
//Set up for a scale of 1cm / Blender Unit #include "colors.inc" #declare Bricks = texture{ pigment{ brick color White*0.99 // color mortar color rgb< 0.75, 0.5, 0.30>*0.75 // color brick brick_size <25, 5.25, 12.5> // (cm) format in x ,y and z- POV coordinates (xzy Blender direction) mortar 0.1 // (cm)size of the mortar scale 1 } // end of pigment normal {wrinkles 0.75 scale 0.1} finish {ambient 0 diffuse 0.95 phong 0.2} rotate<-90,0,0> translate< 0.01, 0.00, 0.00> //Rotate to better suit Blender Coordinates } // end of texture
Brushed Aluminium
#declare StripesDepth = -0.02; #declare AluminumBase = texture { pigment { rgb <0.658824, 0.658824, 0.658824> } normal { wood StripesDepth ramp_wave rotate 90*x scale 0.2 } finish { ambient 0 diffuse 0.35 specular 0.25 roughness 0.1 reflection { 0.00 0.96 metallic 0.5 fresnel on falloff 1 exponent 1.25} brilliance 3.15 } } #declare BrushedAluminium = texture{ average texture_map{ #declare R=seed(1001); #declare V=0; #while(V<4) // number of samples up to 256 [1 AluminumBase normal{ bumps StripesDepth scale <0.5, 0.003, 0.5> translate<rand(R),rand(R),rand(R)>*1 } ] #declare V=V+1; #end } }
Roof Tiles
#declare tilesPattern = function(x,y,z){(y - int(y)) - (int(x)/2)}; box{<-10,-10,-10>,<10,10,10> rotate <45,0,0> #declare RoofTiles = texture { pigment { function {tilesPattern(x,y,z)} pigment_map{[0 White][1 Black]}} scale 0.2 translate <10,0,0>} normal { function {tilesPattern(x,y,z)} scale 0.2 translate <10,0,0>} finish { specular 0.1 roughness 0.5} }
Chromed Steel
INOX
Silver, Gold, Copper, Bronze...
Car Paint (plain / old)
#include "colors.inc" #declare PaintColor = color White; #declare PaintBright = pigment{ PaintColor } #declare PaintDark = pigment{ PaintColor / 2 } #declare CarPaint = texture{ pigment{ aoi pigment_map{ //[0.0 PaintDark] [0.5 PaintDark] [1.0 PaintBright] } } finish{ diffuse 0.65 brilliance 0.6 reflection{ rgb <.05, .05, .05>, rgb<.2,.2,.2> fresnel on } } }
Car Paint (Metallic / new)
#include "colors.inc" #declare PaintColor = color SkyBlue; #declare PaintBright = pigment{ PaintColor } #declare PaintDark = pigment{ PaintColor / 10 } #declare CarPaint = texture{ pigment{ aoi pigment_map{ //[0.0 PaintDark] [0.5 PaintDark] [1.0 PaintBright] } } finish{ specular 0.4 roughness 0.05 metallic diffuse 0.25 brilliance 1 reflection{ 0.2 } } }
Car Paint (Tuning)
#include "colors.inc" #declare PaintColor = color SkyBlue; #declare PaintBright = pigment{ PaintColor } #declare PaintDark = pigment{ rgb <1-PaintColor.red, 1-PaintColor.green, 1-PaintColor.blue> } #declare CarPaint = texture{ pigment{ aoi pigment_map{ //[0.0 PaintDark] [0.5 PaintDark] [1 PaintBright] } } finish{ specular 0.4 roughness 0.1 metallic diffuse 0.25 brilliance 2 reflection{ 0.01 0.3 } } }
Rubber
Leather
#declare Leather = texture{ pigment{ crackle metric 3 turbulence .25 color_map{ [0.00 rgb <.015, .008, .004>] [0.25 rgb <.017, .008, .004>] [0.50 rgb <.010, .002, .004>] [0.75 rgb <.008, .002, .004>] [1.00 rgb <.006, .002, .003>] } scale 0.1 } normal{ crackle metric 3 turbulence .25 //granite .16 scale 0.1 } finish{ specular .04 roughness .1 } }
Plastic matte
Plastic Shiny
Cardboard
Pine Wood
Oak Wood
Wood Planked floor?
Varnished wood matte
Varnished wood shiny
Carpet
Plaster
Glass Solid
Glass Window
Glass Brushed
Glass Foggy
Mirror
Sanitary Ceramic
Glycerophtalic paint for metal like fridges, washing machine, etc.
Acrylic paint for Walls, wood, etc.
LANDSCAPE
Sand
#declare Sand= texture{ pigment{ color rgb <.518, .339, .138> } normal{ bumps 5 scale 0.05 } finish{ specular .3 roughness .8 } } texture{ pigment{ wrinkles scale 0.05 color_map{ [0.0 color rgbt <1, .847, .644, 0>] [0.2 color rgbt <.658, .456, .270, 1>] [0.4 color rgbt <.270, .191, .067, .25>] [0.6 color rgbt <.947, .723, .468, 0>] [0.8 color rgbt <.356, .250, .047, 1>] [1.0 color rgbt <.171, .136, .1, 1>] } } }
Snow
#declare snow = texture{ pigment{ color rgb <1, 1, 1> } normal{ gradient y .5 slope_map { [0 <.1, .1>] [0.25 <.25, 0>] [0.5 <.1, -.1>] [0.75 <.25, 0>] [1 <.1, .1>] } turbulence 0.5 scale .3 } finish{ brilliance 0.75 //emission .2 //use with radiosity instead } } texture{ pigment{ color rgbt <1, 1, 1, .9> } normal{ bumps 5 scale .005 } finish{ specular 1 roughness .01 reflection .1 } } texture{ pigment{ color rgbt <1, 1, 1, .9> } normal{ bumps 3 scale .01 } }
Ice (Iceberg)
Lava
JEWELRY
LapisLazuli
#declare azul = texture{ pigment{ bozo scale .7 turbulence 1 color_map{ [0.0 color rgbt <.053, .112, .371, 0>] [.2 color rgbt <.045, .098, .361, 0>] [.4 color rgbt <.009, .026, .238, 0>] [1 color rgbt <.004, .007, .093, 0>] } } finish{ specular .5 roughness .0001 reflection { 0.2 } brilliance 2 } } #declare pyrit = texture{ pigment{ rgb <.723, .516, .0> } normal{ bumps .25 scale .001 } finish{ specular 1 roughness .0001 reflection .9 } } #declare lapislazuli= texture{ granite scale 1.5 turbulence .5 texture_map{ [0.0 pyrit] [0.07 pyrit] [0.12 azul ] [1.0 azul ] } }
OTHER
Cigaret Filter
#declare cfilter = texture{ pigment{ color rgb <.610, .366, .141 > } } texture{ pigment{ granite scale 1.5 rotate y*0 color_map{ [0.0 rgb <.671, .421, .049>] [0.12 rgbt <.958, .726, .375, 1>] [0.12 rgbt <1, 1, 1, 1> ] [1.0 rgbt <1, 1, 1, 1> ] } } } texture{ pigment{ granite scale 1.5 rotate y*45 color_map{ [0.0 rgb <.671, .421, .049>] [0.12 rgbt <.958, .726, .375, 1>] [0.12 rgbt <1, 1, 1, 1> ] [1.0 rgbt <1, 1, 1, 1> ] } } } texture{ pigment{ granite scale 1.5 rotate y*90 color_map{ [0.0 rgb <.671, .421, .049>] [0.12 rgbt <.958, .726, .375, 1>] [0.12 rgbt <1, 1, 1, 1> ] [1.0 rgbt <1, 1, 1, 1> ] } } } texture{ pigment{ granite scale 1.5 rotate y*135 color_map{ [0.0 rgb <.671, .421, .049>] [0.12 rgbt <.958, .726, .375, 1>] [0.12 rgbt <1, 1, 1, 1> ] [1.0 rgbt <1, 1, 1, 1> ] } } } texture{ pigment{ granite scale 1.5 rotate y*180 color_map{ [0.0 rgb <.671, .421, .049>] [0.12 rgbt <.958, .726, .375, 1>] [0.12 rgbt <1, 1, 1, 1> ] [1.0 rgbt <1, 1, 1, 1> ] } } } texture{ pigment{ granite scale 1.5 rotate y*225 color_map{ [0.0 rgb <.671, .421, .049>] [0.12 rgbt <.958, .726, .375, 1>] [0.12 rgbt <1, 1, 1, 1> ] [1.0 rgbt <1, 1, 1, 1> ] } } } texture{ pigment{ granite scale 1.5 rotate y*270 color_map{ [0.0 rgb <.671, .421, .049>] [0.12 rgbt <.958, .726, .375, 1>] [0.12 rgbt <1, 1, 1, 1> ] [1.0 rgbt <1, 1, 1, 1> ] } } } texture{ pigment{ granite scale 1.5 rotate y*315 color_map{ [0.0 rgb <.671, .421, .049>] [0.12 rgbt <.958, .726, .375, 1>] [0.12 rgbt <1, 1, 1, 1> ] [1.0 rgbt <1, 1, 1, 1> ] } } }
ORGANIC
TO DO
Skin Light
Skin Dark
Hair
Teeth
Nails
Eye White
Eye Iris
Mouth Inside
FOOD & DRINKS
TO DO Ice (ice cubes) Milk Orange
#declare orange= texture{ pigment{ bozo color_map{ [0.0 rgb <.686, .383, .024>] [0.5 rgb <.686, .228, .032>] [1.0 rgb <.828, .516, .031>] } } normal{ granite .2 scale .15 } finish{ brilliance 1 //emission .1 //Use with Radiosity instead specular .15 roughness .05 } }
Banana
#declare Skin= texture{ pigment{ gradient -y scale 1.5 color_map{ [0.0 color rgbt <.296, .283, .030, 0>] [.2 color rgbt <.485, .337, .042, 0>] [.4 color rgbt <.753, .503, .067, 0>] [1 color rgbt <.386, .223, .005, 0>] } } normal{ marble .2 turbulence .3 scale <.01, .01, .01> } finish{ specular .05 roughness .2 } } #declare Dents = texture{ pigment{ rgb <.258, .091, .0> } } #declare BananaSkin = texture{ granite scale 1.5 //turbulence .5 texture_map{ [0.0 Dents] [0.07 Dents] [0.13 Skin] [1.0 Skin] } }
Apple
Peach
#declare PeachSkin = texture { average texture_map { [ pigment { bozo color_map { [0.25,color <0.482,0.325,0.325>] [1,color <0.678,0.635,0.612>] } scale 0.001 } normal { average normal_map { [ bumps 0.3*2 warp {turbulence 1} scale 0.2 ] [ bumps 0.2*2 warp {turbulence 0.5} scale 0.001 ] } } finish {ambient 0 diffuse 0.3 brilliance 0.7} ] [ pigment {color <0.950,0.420,0.420>} finish {ambient 0 diffuse 0 phong 0.6 phong_size 2 metallic} //Use Radiosity rather than ambiant value ] } }
CLOTH
Following the method explained by Tom Fine here: http://hea-www.harvard.edu/~fine/POV/fabric.html
Generic linen type threads could be mimicked by this code:
camera { orthographic up <0, 1, 0> right <1, 0, 0> location <0,40,0> look_at <0,0,0> angle 11 } #include "colors.inc" #declare threadthick=1.7; #declare grad_h=4+threadthick*2; #declare grad_off=grad_h/2; #declare redpaint = texture { pigment { color rgb <1,0,0> } finish { ambient 0.5 } } #declare heightgrad = texture { pigment { gradient y pigment_map { [0 color Black] [0.5 color Black] [1 color White] } scale grad_h*y translate grad_off*y } finish { ambient 1 } } background { color Black } difference { torus { 2 threadthick rotate 90*x } box { <-5,-5,-5> <5,0,5> texture { redpaint } } translate <-2,0,-2> texture { heightgrad } } difference { torus { 2 threadthick rotate 90*z } box { <-5,0,-5> <5,5,5> texture { redpaint } } translate <-2,0,-2> texture { heightgrad } } difference { torus { 2 threadthick rotate 90*x } box { <-5,0,-5> <5,5,5> texture { redpaint } } translate <-2,0,2> texture { heightgrad } } difference { torus { 2 threadthick rotate 90*z } box { <-5,-5,-5> <5,0,5> texture { redpaint } } translate <-2,0,2> texture { heightgrad } } difference { torus { 2 threadthick rotate 90*x } box { <-5,0,-5> <5,5,5> texture { redpaint } } translate <2,0,-2> texture { heightgrad } } difference { torus { 2 threadthick rotate 90*z } box { <-5,-5,-5> <5,0,5> texture { redpaint } } translate <2,0,-2> texture { heightgrad } } difference { torus { 2 threadthick rotate 90*z } box { <-5,0,-5> <5,5,5> texture { redpaint } } translate <2,0,2> texture { heightgrad } } difference { torus { 2 threadthick rotate 90*x } box { <-5,-5,-5> <5,0,5> texture { redpaint } } translate <2,0,2> texture { heightgrad } } difference { torus { 2 threadthick rotate 90*x } box { <-5,-5,-5> <5,0,5> texture { redpaint } } translate <-6,0,2> texture { heightgrad } } difference { torus { 2 threadthick rotate 90*x } box { <-5,-5,-5> <5,0,5> texture { redpaint } } translate <6,0,-2> texture { heightgrad } } difference { torus { 2 threadthick rotate 90*z } box { <-5,-5,-5> <5,0,5> texture { redpaint } } translate <-2,0,-6> texture { heightgrad } } difference { torus { 2 threadthick rotate 90*z } box { <-5,-5,-5> <5,0,5> texture { redpaint } } translate <2,0,6> texture { heightgrad } }
It is then used as a bump map in this texture:
//H_streaks and V_streaks are used to make natural looking fiber streaks //for the fabric //#declare H_streaks = pigment { bozo color_map { [0.0 color rgb <0.6,0.5,0.4>] [1.0 color rgb <0.8,0.7,0.6>] } scale <2,0.05,1> } //#declare V_streaks = pigment { bozo color_map { [0.0 color rgb <0.6,0.5,0.4>] [1.0 color rgb <0.8,0.7,0.6>] } scale <0.05,2,1> } #declare H_streaks = pigment { bozo color_map { [0.2 color rgb <0.4,0.3,0.2>] [0.8 color rgb <0.9,0.8,0.7>] } scale <10,0.1,1> } #declare V_streaks = pigment { bozo color_map { [0.2 color rgb <0.4,0.3,0.2>] [0.8 color rgb <0.9,0.8,0.7>] } scale <0.1,10,1> } //A fabric bump map is used to shade the surface (see fabricbumps.pov) //Then, a checkerboard is overlayed using alternating patterns of H_streaks //and V_streaks. The checker pattern and the bump map //are scaled together so that the streaks line up with the fiber bumps. #declare fabric = texture { pigment { checker pigment { H_streaks } pigment { V_streaks } scale 0.5*0.17 } normal { bump_map { gif "../images/fabricbumps.gif" bump_size 10 } scale 0.17 } finish { diffuse 0.8 specular 0.2 } }
TO DO
Jeans
Cotton
Tulle
Velvet
Nylon
Silk
Satin
Wool
Towel


