PDA

View Full Version : SketchUp meets POV-Ray, happy couple



Evan
04-05-2009, 10:53 PM
Google SketchUp now has a plugin available for free that makes it into a front end for the most powerful ray tracer around, POV-Ray. POV-Ray is freeware and has been around since the Amiga. It is under continuous development and is the most accurate ray tracing program available. It is also freeware. It can model nearly all aspects of light and how it interacts with matter correctly using complex alorithms that simulate natural processes.

The big drawback of POV-Ray has always been that it has no graphical user interface. It still doesn't and is programmed in a stand alone fully fledged programming language a lot like C but strictly oriented to the production of realistic images. The language is called SDL, Scene Description Language. It is very difficult to write a compiler for it as it has thousands of possible options, many of which interact in different ways depending on order of execution.

There have been some attempts in the past, notably Moray but since it wasn't freeware the POV-Ray team didn't officially support it.

This new effort works fairly well although the option set is pretty limited. Still, the quality of rendering is miles ahead of what Google supplies in SketchUp.

Here are a couple of examples. I didn't create the machine models although I did tune them up and and made some new textures to increase realism. The rest of the scenes, including the new shop I created with SketchUp.

http://ixian.ca/pics6/supv1.jpg

http://ixian.ca/pics6/supv2.jpg

Links:

POV-Ray: http://povray.org

SketchUp plugin: http://www.crai.archi.fr/RubyLibraryDepot/Ruby/su2pov.html

The plugin is available for PC and MAC as is POV-Ray

lenord
04-05-2009, 11:06 PM
Evan,

Good to see someone remembered the calendar.

Pardon the dumb question, but what is the advantage of having accurate shadows in a scene ?

Lenord

Evan
04-05-2009, 11:09 PM
It impresses the clients.

Doc Nickel
04-05-2009, 11:14 PM
Great stuff. Mill looks a little underpowered, though. What is that, a 1/6th HP surplus sewing machine motor? :D

The gear-drive leadscrew handles are kind of cool, though... :D

Doc.

aostling
04-06-2009, 01:29 AM
Evan,

This is impressive work, for a PC-based application. The lighting you have shown is direct, with strong shadows -- chiaroscuro lighting I think it's called in painting. Can the software also model diffuse reflections for a softer look?

dp
04-06-2009, 01:39 AM
Pov-ray has always been utterly astonishing. The artists that are very good at it produce amazing things:

http://images.google.com/images?hl=en&q=pov-ray&btnG=Search+Images&gbv=2&aq=f&oq=

http://hof.povray.org/

Evan
04-06-2009, 03:54 AM
The lighting you have shown is direct, with strong shadows -- chiaroscuro lighting I think it's called in painting. Can the software also model diffuse reflections for a softer look?

POV-Ray can model virtually anything with any effects including impossible situations. SketchUp however is extremely limited re lighting. The only "true" light source available is the sun in SketchUp. This means that if you use SketchUp as the only source of input to POV-Ray you will be limited to what SketchUp can do. It isn't difficult to add your own features to whatever Sketchup produces but that takes you into the realm of direct programming without an interface to assist. That is a step too far for many people even though it isn't very difficult.

For instance, to add a light source using the text editor in POV-Ray you need only add this code fragment:



light_source { <X,Y,Z>, Color White }


There are many possible modifiers that can be used for different effects. POV-Ray also stands out because of the absolutely first class documentation in the help files. Every possibile permutation is explained and for every command there is a tutorial section with code fragments that you may cut and paste into the editor to produce the effect in question.

It also has an enormous array of third party tools, modfications and recompilations, as well as extensive libraries of objects, models and effects, all of them free.

Here is a stereo "triplet" that can be viewed either with crossed eye technique using the left pair or uncrossed fused with the right pair.

http://ixian.ca/pics6/supvstereo.jpg

A.K. Boomer
04-06-2009, 06:58 AM
Evan you are one step away from creating your very own virtual machine shop video game, hell, Id give the lathe handles a spin, That looks really cool.

Now I wish I was wealthy, that first pic with the sky lights in a machine shop -- I want that shop!

topct
04-06-2009, 07:44 AM
A 3d machine simulator would be neat. If it were as good as the airplanes they are able to create for use in Microsoft flight I don't see why you could not only run them manually, but also use it to test cnc programing.

Don't know if I'm changing the subject, but the effects they have created in their flight sim look just like that, light, shadows, reflections, only they move. One old plane they have has exposed rocker arms that if you zoom in on them look very real as they move faster as you increase the throttle.

Evan
04-06-2009, 08:07 AM
Don't know if I'm changing the subject, but the effects they have created in their flight sim look just like that, light, shadows, reflections, only they move. One old plane they have has exposed rocker arms that if you zoom in on them look very real as they move faster as you increase the throttle.


Not a change. Ray tracing is often used to create photorealistic scenes in games. However, the scenes or the items in the scene are precomputed and played back. There are also shortcuts that can be used in programming to produce effects that are a lot like ray tracing but only in limited circumstances.

Ray tracing is the most computer calculation intensive application there is. It works by back following the path that light would take as it is focused by a lens on the pixels of a camera. The path is followed to find out what it encountered on the way to the lens and how that affected the photons in terms of intensity and color. If the photons take a path that has many reflections and refractions without diminishing them in intensity much the number of calculations to be done for just one pixel can easily be in the tens of thousands since it is checked a tiny step at a time along the path.

The holy grail of computer gaming and computer graphics in general is to have sufficient power to ray trace complete complex scenes at a live action frame rate. This still is well beyond the reach of any ordinary computer but it won't be for long.

John Stevenson
04-06-2009, 08:47 AM
Can you move the stop start buttons up a bit on the lathe - I have a bad back :rolleyes:

.

Smokedaddy
04-06-2009, 11:25 AM
Evan,

Thanks for the posting. I ran a BBS for many years called PCGnet (Professional CAD and Graphics network) and ADEnet. Man that's something I haven't typed since the early 90's or late 80's. That was way back in the 1200/2400 baud dialup days, even less. I didn't have a clue that POV was still around, very interesting. As was mentioned, it was very difficult to use but then again that was back in the DOS days. Anyway a very impressive program. Looks like I will have to check it out.

I went onto a raytracing program called Accurender, then Rhino with its raytracing/radiosity abilities then Brazil. Anyway, you may find this link interesting ... maybe not either

http://brazil.mcneel.com/

http://www.photonengr.com/fred/calculations.html

Oh, and as you know, stuff like this took HOURS to process in those days. Probably why you were asking about processors in another posting. <smile>

http://www.pbase.com/smokedaddy/image/111006965

Regards,
-SD:

A.K. Boomer
04-06-2009, 11:38 AM
How hard would it be to create a click mode so I can view your original picture and then click on the calender to get a close up? Thats the start of the old "MYST" games that led to "riven" and then myst exile. They were fun puzzle solving games for PS2 and the likes.

lazlo
04-06-2009, 12:00 PM
This is impressive work, for a PC-based application.

LOL! POV-Ray is an open-source ray tracer. It runs on Windows, Linux, MacOS, ...

This is just a random model done with the same program:

http://upload.wikimedia.org/wikipedia/commons/thumb/e/ec/Glasses_800_edit.png/800px-Glasses_800_edit.png

lazlo
04-06-2009, 12:09 PM
The holy grail of computer gaming and computer graphics in general is to have sufficient power to ray trace complete complex scenes at a live action frame rate. This still is well beyond the reach of any ordinary computer but it won't be for long.

You know who hired me away from Intel, right? :)

Nvidia has been demonstrating an interactive real-time ray tracer called, cleverly, IRT:

NVIDIA Demonstrates Real-time Interactive Ray-tracing (http://hothardware.com/News/NVIDIA-Shows-Interactive-Ray-Tracing-on-GPUs/)

http://www.techpowerup.com/img/08-08-18/33a.jpg http://www.maximumpc.com/files/u46173/nvidiaraytracing.jpg

Like Bart alluded on the other thread, it's a CUDA app that runs entirely on the GPU, so it's not dependent on CPU performance. It's not open-source, but I'm looking for a video of it...

dp
04-06-2009, 12:14 PM
LOL! POV-Ray is an open-source ray tracer. It runs on Windows, Linux, MacOS, ...

This is just a random model done with the same program:

Notice how the tops of some the glasses and the liquids are flat regardless of the relative vertical position? A good artist would have corrected perspective. That aside it does show the amazing quality of generated imagery.

vincemulhollon
04-06-2009, 12:55 PM
but what is the advantage of having accurate shadows in a scene ?

Design it so the workpiece is not in a shadow, the front of the monitor is not in the sun, and the sun isn't in the operator's eyes. Wish my current employer (er, their architect) had thought of that!!!!

Also its creepy to have the sun at your back, while shading the work.

Of course to do it right, you'd have to model the sun position every hour for at least 182 different days.

Evan
04-06-2009, 01:17 PM
Of course to do it right, you'd have to model the sun position every hour for at least 182 different days.


Now that is something that SketchUp does very well. You enter your location on the planet first. Then you can move a slider for the date and another for the time of day and the angle of the sunlight such as in my first image changes in real time if you have a fast computer. You can put in a model of a person and whatever else you want. That is a task for which this is ideal.

aostling
06-08-2009, 07:36 PM
I need to make shaded patent drawings of various views of assemblages of parts like the one shown below. Visible in this view is a conical surface with a circular groove, intersecting a spherical surface. The other parts in the assembly will be at different angles. I couldn't have done it without SketchUp. Be glad that you don't have to figure out how to machine it!

The shading on 3D views in patent drawings can be linear (using lines of graduated widths) or stippled (using dots of variable spacing). I've been unable to find drawing software which can automatically add the shading required of patent drawings. The PTO requirements are stylized, quite unlike the photorealistic shading rendered by POV-Ray.

I hope that someone can point me to some software that will produce patent drawing shading.



http://i168.photobucket.com/albums/u183/aostling/wedgelet.jpg

Barrington
06-08-2009, 08:04 PM
Would this be good enough ?

http://i564.photobucket.com/albums/ss82/MrBarrington/wedgelet.jpg

This was just your jpeg with colour depth reduced to '1 bit' in Paint Shop Pro. I'm guessing the lack of colour isn't a problem (?).

Cheers

aostling
06-08-2009, 08:17 PM
Would this be good enough ?


Cheers

Yes, it looks like just what I need! Thanks for the good tip.

aostling
06-08-2009, 11:54 PM
It looks like Paint Shop Pro is not available for my Mac.

I have Photoshop Elements 6, but I cannot find any conversions in it involving specifying a "color bit depth=1." None of the many filters in Elements has the same effect as you have demonstrated.

I can run Windows on my Mac with Boot Camp. Never tried that before, but it shouldn't be too difficult. But first I'd like to consider all the Mac-only options, software which can make stippled shading as you have demonstrated above. I particularly like the way the dot pattern is not random, but follows lines on the cone. I could use this as a guide to produce the more conventional linear shading, by hand if necessary.

Barrington
06-09-2009, 04:41 AM
I managed to dig out an old copy of 'elements' - in Adobe world it seems the function is called 'Bitmap'. (It took a bit of finding I must admit...)

go: Image/Mode/Bitmap... then play with the parameters in the dialogue box to get an effect you like.

Cheers

edit: The function only works after selecting Image/Mode/Greyscale and actually, having played with it, the 'diffusion' option is the only one which gives the right effect...

Evan
06-09-2009, 09:04 AM
I don't have much in the way of software that runs on the MAC but since it is a UNIX system there may be something from the Sourceforge repository that will do the job. You need to convert the image to a halftone image. This requirement is for black/white printing purposes.

Evan
06-09-2009, 09:25 AM
Allan,

Have a look at this tutorial from Adobe.

http://www.photoshopsupport.com/tutorials/cb/halftone.html

Another:

http://www.scribd.com/doc/4944634/Photoshop-Halftone-Dots


Here is a plugin for Photoshop that does halftone conversion:

http://wareseeker.com/Graphic-Apps/india-ink-1.992.zip/1f546f169

Another,

http://graphicssoft.about.com/gi/dynamic/offsite.htm?zi=1/XJ/Ya&sdn=graphicssoft&zu=http%3A%2F%2Fwww.tinrocket.com%2Fsoftware%2Fhyp erdither%2F

Here is a freeware halftone line converter:

http://wareseeker.com/Software-Development/Xylograph-LE-1.2.zip/7030982

aostling
06-09-2009, 12:32 PM
I managed to dig out an old copy of 'elements' - in Adobe world it seems the function is called 'Bitmap'.

Barrington,

Here is my result from the Elements bitmap. It is not as satisfactory as your example from Paint Shop -- the dot pattern is more randomized -- but it may satisfy PTO requirements for stippled shading.

http://i168.photobucket.com/albums/u183/aostling/stippled.jpg

aostling
06-09-2009, 12:56 PM
Here is a freeware halftone line converter:


Evan,

Although halftone bears a resemblance to stippling, it is not the same, and would not be allowed by the PTO. Here is the guidline to the shading techniques allowed: http://www.uspto.gov/web/offices/pac/design/drawing.html

Evan
06-09-2009, 01:19 PM
The examples they give of "stippling" aren't stippled at all. They are straight forward conversions to 2 bit colour mode with no attention paid to dot separation or the size of black area. You should be fine if you simply reduce the drawing to black/white since that is all they have done in the examples.

This is their example of stippling.

http://ixian.ca/pics6/dummy.gif

aboard_epsilon
06-09-2009, 01:23 PM
Evan ..sketch-up .

Take this as a compliment or insult ..its up to you.

those pics ..

you must have 100 hours in a day ..

all i manged with it is a poxy four sided shed with roof and windows ..

and no matter how hard i try ..i don't get any faster at drawing it ..

still takes me an hour ..

so how on earth you manged to draw that inside scene of your workshop is beyond me .

my estimate ..by the time i got to grips with the prog ..that it would take me hundreds of hours to create something like you've done ..

i could do the same with a real pen and real paper in one hour ..

so whats so special about it ?

It's also one of the reasons I've never been enthused about CNC.

all the best.markj

aostling
06-09-2009, 01:42 PM
The examples they give of "stippling" aren't stippled at all.

Well, Howdy Dowdy! I'm going to inspect some online patent drawings, to get a feel for how much variation is allowable.

Barrington
06-09-2009, 02:01 PM
Allan, A (free) prog called 'HyperDither' might do the job:-

http://www.tinrocket.com/software/hyperdither/

"HyperDither is an OS X image processing utility that converts color or grayscale images to 1 bit black & white using a sophisticated dithering routine. Specifically, HyperDither implements the “Atkinson” dithering filter.
Years ago, during the development of the first Macintosh, Bill Atkinson (of HyperCard, QuickDraw, MacPaint & now nature photography (http://www.billatkinson.com/) fame) discovered a very elegant dithering filter to convert greyscale image data for the 1 bit black & white Mac video display. The dithering produced by this routine was much higher quality than the now-a-days ubiquitous Floyd-Steinberg or “Error-diffusion” filter (used by QuickTime, PhotoShop)."

Cheers
.

aostling
06-09-2009, 03:04 PM
Allan, A (free) prog called 'HyperDither' might do the job:-


Barrington,

It sure does. Here is the result of using HyperDither on the image. I think this will satisfy the PTO.

Thanks for your very helpful suggestions.



http://i168.photobucket.com/albums/u183/aostling/ditheredwedgelet.png

Evan
06-09-2009, 03:08 PM
Sketchup as supplied is only a skeleton framework. You must install a slate full of plugins, some from Google and many more from third parties before it becomes useful. Google has a page or two about the basic minimum plugins required.

These are the basics ones:

http://sketchup.google.com/download/rubyscripts.html

Then there are the free third party plugins of which there are many:

http://www.crai.archi.fr/RubyLibraryDepot/Ruby/RUBY_Library_Depot.htm

Some of the plugins make very difficult tasks dead easy.

Evan
06-09-2009, 03:12 PM
Allan,

Hyperdither was at the second plug in link I supplied.

kenrinc
06-09-2009, 03:16 PM
Nice thread. For another option in the 3d/sketchup arena, try Kerkythea and Sketchup. Works on any system, Linux, Mac and PC and is also free. I liked the way Kerkeythea provided a better way to get into Sketchup with the added benefit of pre-configure light sources to use within Sketchup. I've been using Sketchup and Kerkythea for years and it's an awesome combination.

http://www.kerkythea.net/joomla/

Sketchup is just hugely simple to use. Many things are just so intuitive. The reason it's gotten such a huge following is due to it's ease of use. There are a few things that can come back to "bite you" if you don't quite understand the basic concepts of edge and face but for the most part it's crazy easy to use. Way easier than any typical drawing or CAD app. $.02

Ken-

aostling
06-09-2009, 03:49 PM
Allan,
Hyperdither was at the second plug in link I supplied.

Evan,

Sorry I missed it the first time, but glad I got it in the end.

One of the things I miss in SketchUp 7 is the ability to create Dynamic Components. This is available only in SketchUp Pro, which costs $500. Dynamic Components would facilitate changing the colors of parts in the model, and would enable animations.

Another needed improvement is control over line widths.

Barrington
06-09-2009, 07:01 PM
Originally Posted by Evan
Allan,
Hyperdither was at the second plug in link I supplied.
Sorry, didn't spot that - I wasn't looking for plugins (- which it isn't :D)

Cheers

Evan
06-09-2009, 07:45 PM
Line width control is in the Styles section at Edit/Edge. You can have 4 different widths and colors active at once. You can also pick from a large variety of predefined styles.

Animation in the free version is possible via the Sketchy Physics Module. I am going to post this in a separate thread.

aostling
06-09-2009, 10:30 PM
I could not get POV Ray to run on my Intel Mac. Turns out this is a known problem, mentioned here: http://www.povray.org/download/.

Oh well, at least it was easy to uninstall (drag to trash).