PDA

View Full Version : Using Pov-Ray 3.5 with AC3D ( A newbies guide ) updated


-WOODY-
11th October 2003, 05:43 PM
This will be a guide on how to use Pov-Ray with AC3D. Since I'm a newb at this, this will be an ever-growing article. If there's anyone else who has experience with using AC3D with Pov-Ray, please feel free to correct me or add your own tips and tricks.

First, get yourself a freeware copy of Pov-Ray http://www.povray.org/download/

Setting up:
The first thing you want to do is create a "header" file. I got this info from the resources page on this site. It says to put this file in "/usr/local/lib/povray31/include" directory, but there isn't a directory like this with Pov-Ray 3.5. Instead, just put it in "C:\Program Files\POV-Ray for Windows v3.5\include" directory.

Create file:
Open up a new word or note pad document and copy and paste this in it exactly as you see it

global_settings { assumed_gamma 2.2}

#include "colors.inc"
#include "textures.inc"
#include "shapes.inc"
#include "metals.inc"
#include "golds.inc"
#include "skies.inc"
#include "stones.inc"
#include "glass.inc"

Now save this file as "header.inc" ( without quotes ) and put it in your include directory.

AC3D settings:
Now open AC3D and go to "file" then "settings". On the settings menu, select the "files" tab. At the top you'll see a list and box that says " POV header". Type this in the box next to it #include "header.inc." ( include quotes ).
Below that you'll see a radio button that says "Use object data for POV files", put a check in that box and you're good to go.
__________________________________________________ _______________

The following settings are what you are to enter in the properties box whenever you select an object in AC3D. While in AC3D, select an object that you want to apply a finish, effect, or texture to then click on "tools" then "Object property editor". The open box at the bottom of the menu is where you type your descriptions.

Note:
Be aware that many of these effects are highly dependant apon surrounding light and objects. In other words, if you create a sphere with a chrome texture on it then render with Pov-Ray, the sphere will appear black with next no surface at all. Textures like these require atmosphere to give it something to reflect.

Keep in mind that there are "types" of effects that are categorically different. "Textures" can petty much be summed up as being "what" it is, as is a "finish" is an applied effect. To define, if you make a sphere and give it a blue color then give it a chrome texture, you wont see the blue in your object, just the chrome texture. Whereas, if you apply a shiny "finish" to the sphere, you will see the effect and still retain the blue color you gave it.

Test:
Before we begin ( and just for fun ), open a scene that you already created in AC3D. Pick an object then open your properties menu. In the box below, type this in "texture { Polished_Chrome }" ( without quotes ) which is my favorite texture if you haven't noticed by now. Now click on "tools" then "render" and prepare to drool.
__________________________________________________ ____________________

Below ( and will be growing ) are a series of different effects, finishes, and textures that you can enter in the properties box to get the desired effect.
There are differing ranges of the same effect which defines color and level of reflectivity. These can be found by looking in your Pov-Ray include directory and looking at the "include" files such as color.inc, skies.inc, finish.inc etc. The way you enter in textures is "texture { Desired_Texture }" without quotes then type out the desired texture between the brackets. Remember that these descriptions are case sensitive.

textures: Metals. Code to enter "texture { Desred_Texture }" without quotes

Polished_Chrome
Polished_Brass
New_Brass ( Kind of a military type of brass. Very smooth )
Spun_Brass
Brushed_Aluminum
SilverFinish ( Good soft metal texture )

Brass textures. NOTE: the numbers 1 through 5 are varying colors, the letters A through E are levels of reflectivity. E being the shiniest.

T_Brass_1A, T_Brass_2A, T_Brass_3A, T_Brass_4A
T_Brass_1B, T_Brass_2A, T_Brass_3B, T_Brass_4B
T_Brass_1C, T_Brass_2C, T_Brass_3C, T_Brass_4C
T_Brass_1D, T_Brass_2D, T_Brass_3D, T_Brass_4D
T_Brass_1E, T_Brass_2E, T_Brass_3E, T_Brass_4E


COPPERS & BRONZES

T_Copper_1A, T_Copper_2A, T_Copper_3A, T_Copper_4A, T_Copper_5A
T_Copper_1B, T_Copper_2B, T_Copper_3B, T_Copper_4B, T_Copper_5B
T_Copper_1C, T_Copper_2C, T_Copper_3C, T_Copper_4C, T_Copper_5C
T_Copper_1D, T_Copper_2D, T_Copper_3D, T_Copper_4D, T_Copper_5D
T_Copper_1E, T_Copper_2E, T_Copper_3E, T_Copper_4E, T_Copper_5E

CHROMES & STEELS

T_Chrome_1A, T_Chrome_2A, T_Chrome_3A, T_Chrome_4A, T_Chrome_5A
T_Chrome_1B, T_Chrome_2B, T_Chrome_3B, T_Chrome_4B, T_Chrome_5B
T_Chrome_1C, T_Chrome_2C, T_Chrome_3C, T_Chrome_4C, T_Chrome_5C
T_Chrome_1D, T_Chrome_2D, T_Chrome_3D, T_Chrome_4D, T_Chrome_5D
T_Chrome_1E, T_Chrome_2E, T_Chrome_3E, T_Chrome_4E, T_Chrome_5E

SILVERS

T_Silver_1A, T_Silver_2A, T_Silver_3A, T_Silver_4A, T_Silver_5A
T_Silver_1B, T_Silver_2B, T_Silver_3B, T_Silver_4B, T_Silver_5B
T_Silver_1C, T_Silver_2C, T_Silver_3C, T_Silver_4C, T_Silver_5C
T_Silver_1D, T_Silver_2D, T_Silver_3D, T_Silver_4D, T_Silver_5D
T_Silver_1E, T_Silver_2E, T_Silver_3E, T_Silver_4E, T_Silver_5E


Glass Textures: sample code texture { Glass2 }

Crystal, Dark_GReen_Glass, Glass Glass_1, Glass_Colored_Blue
Glass1, Glass2, Glass3, Glass4, Glass5
Green_Glass, Green_Glass1, NBBeerbottle, NBglass NBoldglass
NBwinebottle, Orange_Glass, Plexiglass, Ruby_Glass, S_Glass
T_Beerbottle_Glass, T_Dark_Green_Glass, T_Glass1, T_Glass2
T_Glass3, T_Glass4, T_Green_Glass, T_Old_Glass, T_Orange_Glass
T_Ruby_Glass, T_Vicksbottle_Glass, T_Winebottle_Glass, T_Yellow_Glass
Thin_Glass, Truck_Glass, Vicks_Bottle_Glass, Yellow_Glass

Note: To make your own cutom glass effect, just select your object and make the color transparent or semi-transparent. Open your object's property box and imput an interior statement. This is to give the inside of your glass object a refractive property. Sample code to enter for basic glass:

interior { ior 1.5 }

The level of your ior setting determines how much internal refraction will take place. Below you will see some basic settings for different types of clear material.

water is 1.33
glass is 1.5
diamond is 2.4
__________________________________________________ _____________

Other textures

Cork ( Really looks like cork. Scalling is important )
Lightning1 ( Probably best for a backdrop )
Lithtning2 ( Greater detail )
Starfield ( Best for sky dome etc. )
Brass_Valley ( Gives kind of a reflective splotchy look. Interesting )
Y_Gradient ( Poduces vertical Red, Blue, Green fade )
X_Gradient ( Poduces same, but horizontally )
Rust ( A little blotchy, but interesting )
Rusty_Iron ( A little better but greenish in appearance. Rust is evil anyway.)
New_Penny
Tinny_Brass
Gold_Nugget
Aluminum
Bright_Bronze
Candy_Cane ( Freaky, just freaky )

__________________________________________________ ____________________

Finishes: Metal
code to enter: "finish { Desired_Finish }" example: finish { F_MetalA }

F_MetalA : Very soft and dull.
F_MetalB : Fairly soft and dull.
F_MetalC : Medium reflectivity. Holds color well.
F_MetalD : Highly hard and polished. High reflectivity. <---My favorite!!
F_MetalE : Very highly polished & reflective. Where's my sunglasses when I need em'.

To get a mirror finish, enter the info below
finish {ambient 0 diffuse 0 reflection 1} ( Enter the info exactly as you see it. Best if you just want to make a mirror. )

Finish effects:
There are other variables that can be entered that can also change the finish's appearance. I'll enter more variables as I come across them.

example: finish { crand 0.5 } gives a rough, sandy-like to gravel appearance. adjust as neccessary.

finish { crand 0.5 }

__________________________________________________ __________________

Normal Effects

This technique can be used to give the appearance of wrinkles, bumps, etc. to surface normals. The info is entered the same way as textures or finishes, except in that a different term is used.
Select object to modify and enter the info below.

normal { bumps 0.4 scale 0.2 }
The first number value gives the depth of the bump, the second gives the scale. Just play around to get the right appearance you want.

other effects:
normal { dents .75 scale .25 }

normal { wrinkles .04 scale .04 }

normal { ripples 1.2 scale 0.2 }

normal { waves 2 scale 0.3 }

normal { bumps 0.5 }


Custom Bump_map effects
If you're not happy with the above normal bump effects, you can create your own custom effects by creating your own image map ( bump_map ) and apply that to your object. Below you will find out the basic way of accomplishing this effect. First select your object and copy and paste this code into the object's property box. The file name and directory are used as an example. You'll have to change the file type and directory to where the file is stored. As you can see, you'll first have to indicate what the file type is then the directory to where the image is stored. Personally I use the .gif file format because it gives me the least amount of problems. It can be in color ( because Pov will convert it ), or a grey scale image.


normal {
bump_map {
gif "c:\woody's stuff\custom models\various textures\carpet\greencarpet.gif" interpolate 2
map_type 0
bump_size 4.0
} scale 1
}

Bump size ranges from 0.1 to as high as 4.0 or 5.0. You will also notice the "map_type" entry. This number tells Pov how to map the image to your object. Below you will see the different mapping types.


A map_type 0 gives the default planar mapping.

A map_type 1 gives a spherical mapping.

With map_type 2 you get a cylindrical mapping.

Finally map_type 5 is a torus or donut shaped mapping.


If you use the default planar mapping ( "0" ) and you don't see the proper results after rendering, you may have to rotate the mapping along an axis to get it to project properly. Example below.


normal {
bump_map {
gif "c:\woody's stuff\custom models\various textures\carpet\greencarpet.gif" interpolate 2
map_type 0
bump_size 4.0
} scale 1 rotate <90, 0, 0>
}


If you want your texture to only be projected once instead of tilling multiples of times, then you'll have to use the "once" keyword. Example below.

normal {
bump_map {
gif "c:\woody's stuff\custom models\various textures\carpet\greencarpet.gif" interpolate 2
map_type 0
bump_size 4.0
once
} scale 1 rotate <90, 0, 0>
}

Keep in mind that depending on how large you created your model, you'll have to tinker with the scale setting to get the image the right size on your object.


__________________________________________________ _____________


Sky dome creation:

Normally you can create your own sky dome to place over your scenes then apply a sky texture to them. There is also another way to do this by entering in "pigment" information to make the dome look like a sky. To do this, first create a sphere to encompass your entire scene. Make sure to flip your normals so they face inward, then bring up the properties box of the sphere and enter the following settings. Note: You may have to adjust the scale factor depending on how large your sphere is. I've entered a basic setting of "25" so if you need it scalled smaller, just enter a smaller number and visa, versa. You can copy and paste the info that is between the lines. Also be sure that in whatever color you decide to give your dome that you set all of your specular colors to 0 in the AC3D color edit menu. If you don't it'll glow and you wont be able to see the other colors.

Good sky with horizon
=============================================

pigment {
gradient y
pigment_map {
[0.01 rgb <0.847, 0.749, 0.847> ] // horizon
[0.25 P_Cloud2 scale 0.25 rotate z*5]
[0.60 P_Cloud3 scale <0.25, 0.15, 0.25> rotate

z*10]
} scale 25
}

=============================================



brighter and more cloudier
=============================================

pigment {
gradient y
pigment_map {
[0.00 rgb <0.847, 0.749, 0.847> ] // horizon
[0.10 SkyBlue ] // horizon
[0.20 P_Cloud4 ]
} scale 25
}

=============================================



Darker sky, not quite as cloudy. No horizon
============================================

pigment {
gradient y
pigment_map {
[0.10 rgb <0.258, 0.258, 0.435> ]
[0.25 P_Cloud2 scale 0.15 ]
} scale 25
}

============================================

__________________________________________________ ____________

Custom effects:

Smoke effect
I've been playing around and was finally able to come up with a basic smoke effect. You can play around with the scale and color settings depending on how big or dense you want it, but if you need to do further custom adjustments, you'll have to look up the different terms and learn what they mean and adjust them.

First create your smoke object mesh to the general shape you want it and give it a standard white color. Now in your AC3D color settings menu, set all of your diffuse sliders to the right, give it a 100% transparent setting, and set all of the other color and effect settings to 0.

Now bring up the properties box of your smoke object and copy and paste this in the window. Keep in mind that this will increase your render time.
========================================

hollow on
interior {
media {
method 3 // also try 1, 2, or 4 for differnt effects
absorption <1,1,1>
confidence 0.7
emission <0.2,0.2,0.2> // amount of light that is given off
scattering {3, 1}
density { bozo // pattern you can also use agate as pattern
color_map {
[0.0 rgb <0,0,0,>] // color pattern begins with black
[0.5 rgb <.5,.5,.5,>] // med gray for next stage
[1.0 rgb <8,8,8>] // final lighter grey
}
} scale 0.8 //adjust to size depending on how big your smoke is
}
}

=============================================







I'll add more info as I learn Pov-Ray and as I find out what works right with AC3D.

allen
22nd March 2004, 12:04 PM
I really had no idea what site to place this on so here it is. These codes are used in povray after you export a model. Enjoy!

This will create a sky sphere to encompass your entire scene.

// Light
light_source {<600.0, 800.0, 600.0> White } // White light at the coordinates.

sky_sphere { S_Cloud3 } // This creates the sphere with the controls above.


To create a light source that ‘looks like’ the sun try this code out.
Tweak me
light_source {
<0, 0, 0> colour red 1.0 green 0.7

looks_like { // Give the light a ‘look’
sphere { <0.0, 0.0, 0.0>, 190.0
pigment { colour red 1.0 green 0.6 filter 0.35 }
finish { ambient 1.0 diffuse 0.0 } // Makes Object visible
}
}

translate <-1300.0, 380.0, 2500.0> // Location of light
}

Visit My Site http://allen.emailnuts.com

edit:9.22.04

Allen

cyris69
28th November 2005, 12:05 AM
In an updated version of Pov-Ray which is now verion 3.6 doesn't accept the "header.inc" file.
Parse Error: Expected 'object or directive', string string literal found instead

the text "header.inc" is highlighted in line 1 of pov-ray

Not sure if I'm doing something wrong or not it worked in the older version.
Is there a way around this or do I need to do something new?
Help would be greatly appreciated.

Scotty_Boi
1st December 2005, 06:19 PM
ya. im haveing a problem with the 'header.inc' file as well. is there another way, or a site to download the previews version? :?

Scotty_Boi
1st December 2005, 07:05 PM
i think i found the problem, it may not have been clear before, but you had to include '#inclue' in the file. dont just put "header.inc", you have to put:
#include "header.inc."
all of it (quotes and all). hope it helped, it did for me :)

but i now have another problem, i cant save any of my renderings, even if i export it from Ac3d, then re-open it with pov-ray. i just cant figure it out. :?

cyris69
12th December 2005, 10:56 PM
Well everytime I press render it starts then pov-ray opens the skies.inc file and tried to render it and gives an error im so angry

Edit:
Fixed it I just remover the skies.inc from the header file, now it works, thanks

cyris69
12th December 2005, 11:22 PM
Well it's been awhile since i've use ac3d or pov-ray but i remember it use to work. I can't get photon mapping to work textures finishes ect... what cann I do? Anyone have something I can test to see if it's my fault or technical.

cyris69
14th December 2005, 05:04 PM
Well I downloaded and tested pov v 3.5 and it works.
Wierd huh? Guess 3.6 doesn't like the code for photon mapping and such from AC3d.

palom
10th February 2006, 09:16 PM
Does anyone want to post the same tutorial for a mac user? it would be quite helpfull.

chrisdn
22nd March 2006, 09:06 AM
I'd just like to add that this is a stupid program. I love to use AC3D but povray just ruins the whole thing for me. Add a texture? comes all black even with objects and lighting to relflect thats when it actually recognices the bloody textures or finishes. I add the texture exactly as it is written in *.inc file and then nothing. I was better off using it without no input commands and just using AC3D's own material models.
If I'm wrong and this seems to be wrong then let me know but as it stands I'm going to take AC3D off my system because it's total lack of support for a rendering engine. I find it ridiculous that a modelling program like this dopesn't have at least some form of internal renderer or at the minimum a material editor that actually works with the renderer it was designed for.
For crying out loud! Look at the rendering options in Blender!!! And that software is totally free.
COme on people...help me out on this as I might be doing something completely wrong but the instructions on this board were followed step by step and i still get nothing.

PerFnurt
22nd March 2006, 11:27 AM
I'm going to take AC3D off my system because it's total lack of support for a rendering engine.

Total lack, eh?

Post your files and I'm sure we'll find that something is fishy - in your files rather than in the apps.

All black? You do have a light source in there somewhere, right?

chrisdn
22nd March 2006, 05:31 PM
yeah, of course. I've found a way round certain things by putting a sphere round everything which is a real pain. Half the textures listed will not load for some reason and I'm really getting fedup with it.

Would it not perhaps be easir for them to add a drop down list of povray textures and finishes into the material menu or possibly the object property editor? They claim full support but in essence the support is totally blank and to get the results you want you have to download uncertified third party plugins?

I'm a manager in web solutions company and if my solutions were like this I'd probably get a million customer service complaints every day. When is some form of rough animation system going to be built in? When will the material editor offer option such as wings or blender. When will there be actual rendering options added? God, it wouldn't take long to add to the current rendering system!

Right now it seems that they do very little and leave the work to the third party people to get the software doing what other packages can do.

I love AC3D's interface when is the functionality going to catch up with its interface?

And when, for crying out loud, is this supposed v6 going to be released? Sick of looking at that splashscreen saying coming soon and no actual dates or rough timelines.

Arrrrggggghhhhh!!! I always tell people to use AC3D and now I'm starting to wonder why.

PerFnurt
23rd March 2006, 02:33 AM
I'm a manager in web solutions company

So? Are each of your web solutions designed to handle all issues or do you have different solutions for different tasks?

I think you' shoot yourself in the foot if you try to make an app that tries to be good at everything.

Dennis
23rd March 2006, 04:03 AM
AC3D has always been a modeler-only for as long as I've known. I've yet to find a better modeler in the same price range. And, yes, I'd rather pay for AC3D than use Blender and/or Wings for free, after having tried both. Nothing against them, AC3D is just far better at what it does.

Bear in mind, too, that once you throw animation and full rendering support in, you have a product in a whole different price range (by a margin of at least several hundred USD).

That being said, I agree that better material support in AC3D would be nice. Of course, I won't be removing AC3D from my system because it doesn't have better material support or a robust POV-Ray interface.

Perhaps you could take Perf's advice and post a model/example of what you're trying to do so someone could have a look?

Barring that, your other options are to either look into the POV-Ray docs on your own to diagnose your issue, or get another renderer. Why not give Blender a try for rendering? It even has native AC3D importers. I've found it to be a very cumbersome modeler, but perhaps it's more friendly in the animation/rendering department. There's certainly nothing wrong with using both apps --- I use several 3D apps in my workflow for most of my projects, and almost always start in AC3D for the base models.

Sorry to see you're so angry with ac3d. As mentioned, try posting some examples of *exactly* what's failing for you, and perhaps someone can lend a hand here.

Also, I don't believe I've seen where AC3D touts "full" support for POV-Ray, simply that it allows you to render with it --- I think there's an assumption there that you have to learn POV-Ray as well. But again, I'm sure someone here could still help if you can provide some specifics.

Dennis

little_penguin
11th April 2006, 04:28 AM
Also, I don't believe I've seen where AC3D touts "full" support for POV-Ray, simply that it allows you to render with it --- I think there's an assumption there that you have to learn POV-Ray as well. But again, I'm sure someone here could still help if you can provide some specifics.

I completly agree, Dennis, but sometimes it is getting quite funny, when after exporting you have to edit a 10mb file :( .
Some things should be really improved:
- better light_source definiton (for example assigning an object to an lightsource
(looks_like{}...))
- better camera support
- perhaps skies, rainbows, and finish and texture option menu :) .

A better integration in povray would be really great. No functions would get lost,
those all could extra features in a extra menu.
I at least hope that one day ac3d would "really" support povray-renderings.

bye
olaf

PerFnurt
11th April 2006, 04:42 AM
Perhaps you should look into the PfPOV .pov exporting plugin, as it does some things you request, such as not losing functions when re-exporting.

www.perfnurt.se/pfpov.asp

little_penguin
19th April 2006, 06:33 PM
hi PerFnurt

I tried but ...
/ac3d/ac3dlx-update/plugins/PfPOV.p: invalid ELF header
What shall i do?
I also tried to compile it but it seems like i would need the ac3d-sourcecode for this :(

bye
olaf

PerFnurt
19th April 2006, 07:05 PM
hi PerFnurt

I tried but ...
/ac3d/ac3dlx-update/plugins/PfPOV.p: invalid ELF header
What shall i do?
I also tried to compile it but it seems like i would need the ac3d-sourcecode for this :(

bye
olaf

Hmm, "ac3dlx"

You're running it on linux, right?

Unfortunately the plugin is only compiled for windows.
To compile you need the AC3D SDK, ask Andy for it.

If you eventually get it compiled for linux I'd very much appreciate if I could publish that version as well.
If you have questions about the plug-in/its source, just mail me: perfnurt@hotmail.com

little_penguin
19th April 2006, 07:14 PM
thanks for your fast reply

i will try..
:)

bye
olaf

allen
5th June 2006, 08:54 PM
it's been a while.

Ask me some questions and I will try to help. I haven't delt with ac3d much anymore, but I sure can help with povray.

http://allen.emailnuts.com/

allen
7th June 2006, 01:36 AM
~bump~