POVMAN

POV-Ray stuff from a part time POVver. Are you a POVMAN?

Thursday, February 16, 2006

Tip 14 Clear going black.

A common problem we all hit at some point, is that we create a scene with lots of Clear/Glass objects.

Well thats not the real problem. the problem is that sometimes these render with some or all of the objects turned black. It's a nasty black, not shades of black, just plain horrid black.

The common cause is that the max_trace setting is not high enough.

What happens is that each time a ray passes through one of these objects it splits. So to prevent a scene from taking forever to render the maximum number of "splits" on any one ray is quite limited. If you up the value of "max_trace" you'll start to see the black disapear.

Wednesday, February 15, 2006

Tip 12a Filling in the Blanks

Hi. This is 12a because that other number is a bit unlucky.

The Tip today, is to use a "fill" light. A Fill light is not some POV-Ray object but rather a concept for lighting scenes. Still and Video people know all about Fill lights.

Basicly a fill light is (usually a dim and unfocused light that adds depth to a scene. If it's done properly then you generally dont even know its there.

A Fill light is often set to the side or rear of the "subject". It gives definition and depth to background. Sometimes it gives definition to the "subject" with a low level of back-lighting.

Below is my standard fill "light_source", I call it "the Daniel Prust", as he was the guy who gave it to me. I've used the Daniel Prust in so many scenes I consider it a standard.

light_source { <-70, 20, -15> color rgb <0.2,> shadowless }

Tuesday, February 14, 2006

Tip 12 Realism with area_light.

There is a simple tip for adding realism to your scene.

Use "area_light"!!!!!!!!

This alone will not make a scene real. but when you've finished modeling and the textures are just right, hit the whole thing with area_light.

Make all your "light_source"s into what I call "High Def" area lights, that is to say using big numbers in the array of lights. My final renders usually end with 25 x 25 area_light's. This gives you some good strong shadows, and pen umbra, with very little chance of the specking effect you can get with lower numbers.

There are a whole bunch of "realism" tips, of which this is only one. But every little helps...

Monday, February 13, 2006

Tip 11 Fading your lights

When you set up a scene, I would recommend that you always ensure that you set the fade_distance and fade_power on your light_source(s) when nearing completion.

As a rule, unless you only light source is the Sun you should do this. Why? because it gives the scene a feeling of depth and realism.

Even if the Sun is your light_source, and the scene is set in a room, adding a fade to the light still adds that little-something to the amount of reflected light.

If you havn't used the fade settings, stick a light_source next to a plane and you'll see the effects easily.

Friday, February 10, 2006

Tip 10 Include files

Okay, heres a tip for the man who going to be poving for a long time. When you finish an object, say a chair or a mug, or a spaceship create an include file for it.

For instance if you have a "mug" save just the code to create the mug into a file called "mug.inc".

Now you can use that include file in any future scene easily by using the "#include" syntax.

Rather than just copy the outer most "union" or "merge" or "difference" into the include file, declare it as a variable so that you can call it with the "object" syntax.

So in your include file...

#declare povmanMUG = union { blar blat blud };

... and then in you new scene you would put...

object { povmanMUG }

Now theres one little thing you might want to keep in mind.

Declare any textures for the object you in the include file as well. That way you dont have to look through all of your pov files scanning for "that texture you used 3 months ago".

Thursday, February 09, 2006

Tip 9 Media and Hollow

A quick tip for you, if you intend to use media in a scene.

I dont know how many scenes I've made where I've tried to use media and spent a frustrating length of time wondering why my media does not appear when rendering.

Invariably there is one cause.

Something in the scene is not declared as "hollow".

So the tip is, if you use media, make every object "hollow", especially any "plane" objects, and save yourself some heart-ache.

Wednesday, February 08, 2006

Tip 8 Optioning Scene Elements

When I'm developing a scene I sometimes find that particular elementssuch as an Isosurface, some media or even a light source are causing the render time to increase significantly.

If I'm not actually working on that slow bit of the scene, I turnit off, so that its not being rendered every time I try and tinker with something else.

I've put an example below. In this mini scene I have a light source that can optionally turn on or off its area_light settings. This has a huge impact on the render time.

The important bit here is"#declare showAreaLights = no;" which I use to turn off the area_lights settings. Render the scene, then change the "no" to "yes" and render again, you'll see the huge speed difference.

If you look at the SDL you'll see that I have put an "#if"statement in the middle of the light_source declaration that only includes the area_light details if the value of "showAreaLights" is set to "yes".

In a big scene I might easily have 20 various things that I can turn on or off.

A common thing I do is have a set of development light sources that I turn on while tinkering with a scene so that I can see everything from every angle, awhich I then turn off during final rendering.

#include "colors.inc"
#include "glass.inc"
#include "stars.inc"
#include "shapes.inc"
#declare showAreaLights = no;
camera {location <0,1,-5> look_at <0,0,0>}
background { color <0.25,0.35,0.80> }
plane {y, -1 pigment { color rgb <0.7,0.5,0.3> }}
sphere { <0,.5,0>,1.5 texture { pigment { Red } normal { agate scale .2 } finish { ambient 0 specular .1}} }

light_source { <-50, 100, -50> color White
#if(showAreaLights = yes)
area_light <3,0,0>,<0,0,3>,25,25
#end}

You can use the same principal to turn on or off complex textures, or to hide slow isosurfaces.

The possibilities are endless...

Tuesday, February 07, 2006

Tip 7 Place By Pattern

A trick that can be used to place objects in a scene is to use "place by pattern". This sort of thing can be used for placing trees across a landscape, or spaceships in space.

I thinh to keep in mind is that all POV-Ray patterns are 3D, you just normally see tem in 2D as it is plastered across various objects. So the theory is we can chack the value of a pettern at any point in the 3D coordinate system.

The scene below was my first experiment in place by pattern and demonstrates it quite nicely. Note : the Green and White plane is only for reference so that you can "see" the pattern being tested. The scene does not test the texture on the plane, but it does use the same pattern.


#include "colors.inc"
#include "functions.inc"
camera { location <0,> look_at <0,> }
light_source {<-200, 1000, -400> White}

// a scaling value for the pattern
#declare patternScale = 10;

// a plane to show the pattern being used to place the objects
plane {y, -.00001 texture {
pigment {agate scale patternScale pigment_map { [0 White] [.8 White] [1 Green]}}}}

// testing an area in the x-z plane from -40 to +40 for both co-ords, so set up
// two loops one for X and one for z. We will test every .5 units
#declare myx = -40;
#while(myx<=40)
#declare myz = -40;
#while(myz <= 40)
// This if tests the value returned by the pattern function. Note that
// pattern functions return a value between 0 and 1 ( the value of the pigment map)
#if(f_agate(myx/patternScale,0,myz/patternScale) > .95)
// ... and puts in a red sphere , 2 units above the plane, if the value is over .95
sphere {,.2 texture { pigment {Red }}}
#end
#declare myz = myz +.5;
#end
#declare myx=myx+.5;
#end

Monday, February 06, 2006

Tip 6 Create Loads of Objects

Sometimes when you want to put a lot of objects in a scenesuch as tiles on a wall, you can copy your single tileover and over again and manually edit the co-ordinates of each. But man oh man, thats a lot of work.

POV-Ray gives us a much better way, and thats the "#while"statement. Render the following...

#include "colors.inc"
camera {location <-4,4,-5>look_at <0,0,>}
light_source{<-50, 100, -50> color White }
background { color <0.25,0.35,0.80> }
plane {y, -1 pigment { color rgb <0.7,0.5,0.3>}}
#declare xpos = -10;
#while(xpos <> box { <0,1,0>,<.9,0,.2> texture { pigment { Red } } translate }
#declare xpos = xpos+1;
#end


The bottom half of this scene is the clever bit. "#while" is a programing loop, that in this case produces 20 boxes in a line.

This little loop saves you having to manually create 20 boxes and edit the position of each. If your want to know how all this stuff works you need to read the Help relating to "#while" but heres the basics.

This SDL uses xpos to translate each box into position. The "#while" moves the value of xpos from -10 up to 10. And for each value of xpos, it creates a "box".

You can Nest "#while" loops ( Thats putting one #while inside another ) which means you can quickly build up vast numbers of objects for very little typing. Render the following to see even more boxes.

#include "colors.inc"
camera {location <-4,4,-5>
look_at <0,0,0>}
light_source{<-50, 100, -50> color White }
background { color <0.25,0.35,0.80> }
plane {y, -1 pigment { color rgb <0.7,0.5,0.3>}}
#declare xpos = -10;
#while(xpos <>
#declare zpos = 0;
#while(zpos < 10)
box { <0,1,0>,<.9,0,.2> texture { pigment { Red } } translate }
#declare zpos = zpos+1;
#end
#declare xpos = xpos+1;
#end



Friday, February 03, 2006

Tip 5 Rending Sizes

Sometimes you need to render an image at a non-standard image size. For instance you might want a really small image say, 25 by 25 pixels or a short but wide image 800 by 120. You could spend a lot of time moving cameras and rendering huge scenes that you only want to see a part of, but there is an easier way.

If you look in the following folder on your machine...

C:\Program Files\POV-Ray for Windows v3.6\renderer

... you'll see a file called "quickres.ini". This file has a list of all of the standard rendering sizes.

Add the following snippet ( the text between the hashes but not the hashes)
########################

[25x25, No AA]
Width=25
Height=25
Antialias=Off

[800x120, No AA]
Width=800
Height=120
Antialias=Off

[25x25, AA 0.3]
Width=25
Height=25
Antialias=On
Antialias_Threshold=0.3

[800x120, AA 0.3]
Width=800
Height=120
Antialias=On
Antialias_Threshold=0.3

#########################

Save the file. You have just added four new options to the standard list of rendering sizes, start POV-Ray and have a look.

Now its worth noting that when you change the width/height ratio of these render sizes it usually becomes neccesary to also alter the camera. If you dont change the camera you get some very distorted images.

I've included a sample camera setting below that I use when rendering the 800 by 120 image. The "up" and "right" are a bit of a mystery to me at the moment ( I really must Read The Flippin Manual), but they appear to specify relative perspective ratios.

Now if that sounds like gobbeldegook, I'm sorry. But you'll see the effects easier than I can explain them. Render an 800 by 120 image without the "up" and "right", and then again with them, you'll see whats going on.

It would also be worth trying a few more renders and fiddeling with the numbers!!!

I should also note that when rendering the 25 by 25 images it wasn't neccessary to change the camera settings.

camera { perspective location <0,0,-4> look_at <0,0,0> up<0,.35,0> right<2.33,0,0> }

Thursday, February 02, 2006

Tip 4 Macro's

Tip 4 : Macros, use 'em! I use macros extensively. The reasonis straight forward, I find they save me time. They allow meto alter things between renders from a single place.
For instance. If I'm modeling a Window, I'll make a macro with the ability to set how much the window is open.

Below is a simple scene that uses a macro. Read on and I'll explain all...

#include "colors.inc"
camera {location <-1,3,-5>
look_at <0,0,0>}
light_source {<-50, 100, -50> color White}
background { color <0.25,0.35,0.80>}
plane {y,-1 pigment{color rgb <0.7,0.5,0.3>}}

#macro getShape(tubeLength,ballSize)
union {
cylinder { <(tubeLength/2)*-1,0,0>, ,.2 }
sphere { <0,0,0>,ballSize }
texture { pigment { Red } }
}
#end

object { getShape(2,.5) }
object { getShape(8,.5) translate <0,0,5>}
object { getShape(4,1.5) translate <0,0,10>}

Render the scene, you see three objects that are all variations ona theme. Each of those objects is displayed via the macro which is being called from the "object" lines at the bottom.

The macro is begins with "#macro" and ends with "#end".

If you rendered the scene youll see the shape varies cylinder lengthand sphere size.

The "object" definitions at the bottom each pass differn't length and size numbers to the macro. This means I can easily generate multiple versions of the same shape.

How do I use this capability in real scenes?

Often when trying to get a scene just-right, you want to tinker with various positions ofobjects, or object sizes, or even textures.

  • A Door macro could alter the angle at which the door is ajar.
  • A Wheel macro could define the amount of air in the tyre.
  • A Pen macro could define the ink colour.
  • A Roman Column macro could define the column height.
  • A Light macro could define the "fade_distance" of the "light_source".
A macro can contain just about any SDL code, it does not have to return just one object, such as the union in the example above. It can also call other "object"s that are themselves macros.

It's a cool feature of SDL and worth considering, when you start your next scene.

Wednesday, February 01, 2006

Tip 3 Your own Scene Templates

Here's another installment of my POV life. I havn't just discovered this or anything, but its a good tip that all POVvers should know.

Tip 3 : If like me you start a large number of scenes, you really dont want to be typing in the basic stuff like [ #include "colors.inc"] every time. That would be real boring. So you may already have discovered the "Insert" menu, and even the Scene Templates there.

Well, I never liked any of those scene templates, they all seem to contain a whole bunch of comments that I dont need or want. Or have wacky camera settings. Me, I like a background color, a plane, a point light, a camera looking at <0,0,0> and a couple of includes in my fresh scenes. So, whats the tip...

Create your own scene template(s). This simply a "txt" file that you can create with notepad. Then copy the "txt" file into ...

C:\Program Files\POV-Ray for Windows v3.6\Insert Menu\00 - Scene templates

A new option will then appear on the "insert / scene templates" menu. The name of the menu item will match the name of your file.

Here's one of my template files...

#include "colors.inc"
#include "shapes.inc"
camera { location <0,1,-5> look_at <0,>}
light_source { <-50, 100, -50> color White }
background { color <0.25,0.35,0.80> }
plane { y, -1 pigment { color rgb <0.7,0.5,0.3> }}