Manual:Creating renderings: Difference between revisions

From FreeCAD Documentation
mNo edit summary
mNo edit summary
(6 intermediate revisions by 5 users not shown)
Line 1: Line 1:
<languages/>
<translate>
<translate>
<!--T:29-->
{{Docnav|[[Manual:Creating FEM analyses|Creating FEM analyses]]|[[Manual:A gentle introduction|A gentle introduction]]|[[Manual:Introduction|Manual start]]|IconC=Crystal Clear manual.png}}

<!--T:1-->
<!--T:1-->
{{Manual:TOC}}
{{Manual:TOC}}


<!--T:2-->
<!--T:2-->
In computer talk, a [https://en.wikipedia.org/wiki/Rendering_%28computer_graphics%29 rendering] is a word used to describe a nice image produced from a 3D model. Of course, we could say that what we see in the FreeCAD 3D view is already nice. But anybody who saw a recent Hollywood movie knows that it is possible to produce images with a computer that are almost indistinguishable from a photograph.
In computer speak, the word [https://en.wikipedia.org/wiki/Rendering_%28computer_graphics%29 rendering] is used to describe a nice image produced from a 3D model. Of course, we could say that what we see in the FreeCAD 3D view is already nice. However, anybody who has seen a recent Hollywood movie, knows that it is possible to produce images with a computer that are almost indistinguishable from a photograph.


<!--T:3-->
<!--T:3-->
Of course, producing such photo-realistic images requires a lot of work, and a 3D application that offers specific tools for that, such as precise controls for materials and lighting. FreeCAD being an application more geared towards technical modeling, it doesn't feature any advanced rendering tool.
Of course, producing photo-realistic images requires a lot of work, in addition to a 3D application that offers specific tools for that purpose, such as precise controls for materials and lighting. Because FreeCAD is an application geared more towards technical modelling, it does not feature any advanced rendering tools.


<!--T:4-->
<!--T:4-->
Fortunately, the open-source world offers many applications to produce realistic images. Probably the most famous one is [http://www.blender.org Blender], which is very popular and widely used in the movies and gaming industries. 3D models can very easily and faithfully be exported from FreeCAD and imported into Blender, where you can add realistic materials and illumination, and produce the final images or even animations.
+Fortunately, the open source world offers many applications to produce realistic images. The most famous one is probably [http://www.blender.org Blender], which is very popular, and widely used in the film and gaming industries. 3D models can very easily and faithfully be exported from FreeCAD and imported into Blender, where you can add realistic materials and illumination, and produce the final images or even animations.


<!--T:5-->
<!--T:5-->
Some other open-source rendering tools are made to be used inside another application, and will take care of doing the complex calculations to produce realistic images. Through its [[Raytracing_Module|Raytracing Workbench]], FreeCAD can use two of these rendering tools: [https://en.wikipedia.org/wiki/POV-Ray POV-Ray] and [https://en.wikipedia.org/wiki/LuxRender Luxrender]. POV-Ray is a very old project, and is considered a classical [https://en.wikipedia.org/wiki/Ray_tracing_%28graphics%29 raytracing] engine, while Luxrender is much newer, and is categorized as an [https://en.wikipedia.org/wiki/Unbiased_rendering unbiased] renderer. Both have their strengths and weaknesses, depending on the type of image one wants to render. The best way to know is to look at examples on both engines websites.
Some other open source rendering tools are made to be used inside other applications, and will take care of doing the complex calculations to produce realistic images. Through its [[Raytracing_Module|Raytracing Workbench]], FreeCAD can use two of these rendering tools: [https://en.wikipedia.org/wiki/POV-Ray POV-Ray] and [https://en.wikipedia.org/wiki/LuxRender Luxrender]. POV-Ray is a very old project, and is considered a classical [https://en.wikipedia.org/wiki/Ray_tracing_%28graphics%29 raytracing] engine, while Luxrender is much newer, and is categorized as an [https://en.wikipedia.org/wiki/Unbiased_rendering unbiased] renderer. Both have their strengths and weaknesses, depending on the type of image one wants to render. The best way to know is to look at examples on each engine's website.


=== Installation === <!--T:6-->
=== Installation === <!--T:6-->


<!--T:7-->
<!--T:7-->
Before being able to use the Raytracing Workbench in FreeCAD, one of these two rendering applications needs to be installed on your system. This is usually very straightforward, both provide installers for many platforms or are usually included in the software repositories of most Linux distributions.
Before being able to use the Raytracing Workbench in FreeCAD, one of these two rendering applications needs to be installed on your system. This is usually very straightforward. They both provide installers for many platforms or are usually included in the software repositories of most Linux distributions.


<!--T:8-->
<!--T:8-->
Once POV-Ray or Luxrender is installed, we need to set the path to their main executable in the FreeCAD preferences. This is usually only required on Windows and Mac. On Linux FreeCAD will pick it from the standard locations. The location of the povray or luxrender executables can be found by simply searching your system for files named povray (or povray.exe on Windows) and luxrender (or luxrender.exe on Windows).
Once POV-Ray or Luxrender is installed, we need to set the path to their main executable in the FreeCAD preferences. This is usually only required on Windows and Mac. On Linux, FreeCAD will pick it from the standard locations. The location of the povray or luxrender executables can be found by searching your system for files named povray (or povray.exe on Windows) and luxrender (or luxrender.exe on Windows).


<!--T:9-->
<!--T:9-->
Line 32: Line 36:


<!--T:12-->
<!--T:12-->
We will use the table we have been modeling in the [[Manual:Traditional modeling, the CSG way|tradtional modeling]] chapter to produce renderings with PovRay and Luxrender.
We will use the table we have been modelling in the [[Manual:Traditional modeling, the CSG way|traditional modeling]] chapter to produce renderings with PovRay and Luxrender.


<!--T:13-->
<!--T:13-->
* Start by loading the table.FCStd file that we modeled earlier or from the link at the bottom of this chapter.
* Start by loading the table.FCStd file that we modelled earlier or from the link at the bottom of this chapter.
* Press the small down arrow next to the [[Image:Raytracing_New.png|16px]] [[Raytracing_New|New Povray project]] button, and choose the '''RadiosityNormal''' template
* Press the small down arrow next to the [[Image:Raytracing_New.png|16px]] [[Raytracing_New|New Povray project]] button, and choose the '''RadiosityNormal''' template
* A warning message might appear telling you that the current 3D view is not in perspective mode and the rendering will therefore differ. Correct this by choosing '''No''', choosing menu '''View->Perspective view''' and choosing the RadiosityNormal template again.
* A warning message might appear telling you that the current 3D view is not in perspective mode and the rendering will therefore differ. Correct this by choosing '''No''', choosing menu '''View->Perspective view''' and choosing the RadiosityNormal template again.
* You might also try other templates after you created a new project, simply by editing its '''Template''' property.
* You can also try other templates after you create a new project, simply by editing its '''Template''' property.
* A new project has now been created:
* A new project has now been created:


Line 45: Line 49:


<!--T:15-->
<!--T:15-->
* The new project has adopted the point of view of the 3D view as it was at the moment we pressed the button. We can change the view, and update the view position stored in the povray project anytime, by pressing the [[Image:Raytracing_ResetCamera.png|16px]] [[Raytracing_ResetCamera|Reset camera]] button.
* The new project has adopted the point of view of the 3D view as it was at the moment we pressed the button. We can change the view, and update the view position stored in the Povray project anytime, by pressing the [[Image:Raytracing_ResetCamera.png|16px]] [[Raytracing_ResetCamera|Reset camera]] button.
* The Raytracing Workbench works the same way as the [[Drawing_Module|Drawing Workbench]]: Once a project folder is created, we must add '''Views''' of our objects to it. We can now do that by selecting all the objects that compose the table, and press the [[Image:Raytracing_InsertPart.png|16px]] [[Raytracing_InsertPart|Insert part]] button:
* The Raytracing Workbench works the same way as the [[Drawing_Module|Drawing Workbench]]: Once a project folder is created, we must add '''Views''' of our objects to it. We can now do that by selecting all the objects that compose the table, and press the [[Image:Raytracing_InsertPart.png|16px]] [[Raytracing_InsertPart|Insert part]] button:


Line 53: Line 57:
<!--T:17-->
<!--T:17-->
* The views have taken the color and transparency values from their original parts, but you can change that in the properties of each individual view if you wish.
* The views have taken the color and transparency values from their original parts, but you can change that in the properties of each individual view if you wish.
* We are now ready to produce our first povray render. Press the [[Image:Raytracing_Render.png|16px]] [[Raytracing_Render|Render]] button.
* We are now ready to produce our first Povray render. Press the [[Image:Raytracing_Render.png|16px]] [[Raytracing_Render|Render]] button.
* Note for windows users: when receiving (in povray) a warning saying "I/O restrictions prohibit write access ..."
* Note for windows users: when receiving (in Povray) a warning saying "I/O restrictions prohibit write access ..."
** open povray
** open Povray
** choose "Options > Script I/O Restrictions" and make sure it is set to "No Restrictions"
** choose "Options > Script I/O Restrictions" and make sure it is set to "No Restrictions"
** retry render
** retry render
* You will be asked to give a file name and path for the .png image that will be saved by povray.
* You will be asked to give a file name and path for the .png image that will be saved by Povray.
* The povray will then open and calculate the image.
* Povray will then open and calculate the image.
* When this is done, simply click the image to close the povray window. The resulting image will be loaded in FreeCAD:
* When this is done, click the image to close the Povray window. The resulting image will be loaded in FreeCAD:


<!--T:18-->
<!--T:18-->
Line 70: Line 74:
* Rendering with Luxrender works almost the same way. We can leave our file open and create a new Luxrender project in the same file, or reload it to start from scratch.
* Rendering with Luxrender works almost the same way. We can leave our file open and create a new Luxrender project in the same file, or reload it to start from scratch.
* Press the little down arrow next to the [[Image:Raytracing_Lux.png|16px]] [[Raytracing_Lux|New Luxrender project]] button and choose the '''LuxOutdoor''' template.
* Press the little down arrow next to the [[Image:Raytracing_Lux.png|16px]] [[Raytracing_Lux|New Luxrender project]] button and choose the '''LuxOutdoor''' template.
* Select all the components of the table. If you still have the povray project in your document, be sure to also select the lux project itself, so the views created in the next step won't go in the wrong project by mistake.
* Select all the components of the table. If you still have the Povray project in your document, be sure to also select the Luxrender project itself, so the views created in the next step won't go in the wrong project by mistake.
* Press the [[Image:Raytracing_InsertPart.png|16px]] [[Raytracing_InsertPart|Insert part]] button.
* Press the [[Image:Raytracing_InsertPart.png|16px]] [[Raytracing_InsertPart|Insert part]] button.
* Select the luxrender project, and press the [[Image:Raytracing_Render.png|16px]] [[Raytracing_Render|Render]] button.
* Select the Luxrender project, and press the [[Image:Raytracing_Render.png|16px]] [[Raytracing_Render|Render]] button.
* Luxrender works differently than povray. When you start the render, the luxrender application will open and immediately start rendering:
* Luxrender works differently to Povray. When you start the render, the Luxrender application will open and immediately start rendering:


<!--T:21-->
<!--T:21-->
Line 79: Line 83:


<!--T:22-->
<!--T:22-->
* If you leave that window open,Luxrender will continue calculating and rendering forever, progressively refining the image. It is up to you to decide when the image has reach a sufficient quality for your needs, and stop the render.
* If you leave that window open, Luxrender will continue calculating and rendering forever, progressively refining the image. It is up to you to decide when the image has reached a sufficient quality for your needs, and stop the render.
* There are also many controls to play with, on the left panel. All these controls will change the aspect of the image being rendered on the fly, without stopping the rendering.
* There are also many controls to play with, on the left panel. All these controls will change the aspect of the image being rendered on the fly, without stopping the rendering.
* When you feel the quality is good enough, simply press '''Render->stop''', and then '''File->Export to image->Tonemapped low dynamic range''' to save the rendered image to a png file.
* When you feel the quality is good enough, press '''Render->stop''', and then '''File->Export to image->Tonemapped low dynamic range''' to save the rendered image to a png file.


<!--T:23-->
<!--T:23-->
You can extend greatly the render possibilities of FreeCAD by creating new templates for povray or luxrender. This is explained in the [[Raytracing_Module|Raytracing Workbench documentation]].
You can greatly extend the rendering possibilities of FreeCAD by creating new templates for Povray or Luxrender. This is explained in the [[Raytracing_Module|Raytracing Workbench documentation]].


<!--T:24-->
<!--T:24-->
Line 104: Line 108:
<!--T:28-->
<!--T:28-->
[[Category:Tutorials]]
[[Category:Tutorials]]

<!--T:30-->
{{Docnav|[[Manual:Creating FEM analyses|Creating FEM analyses]]|[[Manual:A gentle introduction|A gentle introduction]]|[[Manual:Introduction|Manual start]]|IconC=Crystal Clear manual.png}}



</translate>
</translate>
<languages/>

Revision as of 11:09, 30 March 2019

In computer speak, the word rendering is used to describe a nice image produced from a 3D model. Of course, we could say that what we see in the FreeCAD 3D view is already nice. However, anybody who has seen a recent Hollywood movie, knows that it is possible to produce images with a computer that are almost indistinguishable from a photograph.

Of course, producing photo-realistic images requires a lot of work, in addition to a 3D application that offers specific tools for that purpose, such as precise controls for materials and lighting. Because FreeCAD is an application geared more towards technical modelling, it does not feature any advanced rendering tools.

+Fortunately, the open source world offers many applications to produce realistic images. The most famous one is probably Blender, which is very popular, and widely used in the film and gaming industries. 3D models can very easily and faithfully be exported from FreeCAD and imported into Blender, where you can add realistic materials and illumination, and produce the final images or even animations.

Some other open source rendering tools are made to be used inside other applications, and will take care of doing the complex calculations to produce realistic images. Through its Raytracing Workbench, FreeCAD can use two of these rendering tools: POV-Ray and Luxrender. POV-Ray is a very old project, and is considered a classical raytracing engine, while Luxrender is much newer, and is categorized as an unbiased renderer. Both have their strengths and weaknesses, depending on the type of image one wants to render. The best way to know is to look at examples on each engine's website.

Installation

Before being able to use the Raytracing Workbench in FreeCAD, one of these two rendering applications needs to be installed on your system. This is usually very straightforward. They both provide installers for many platforms or are usually included in the software repositories of most Linux distributions.

Once POV-Ray or Luxrender is installed, we need to set the path to their main executable in the FreeCAD preferences. This is usually only required on Windows and Mac. On Linux, FreeCAD will pick it from the standard locations. The location of the povray or luxrender executables can be found by searching your system for files named povray (or povray.exe on Windows) and luxrender (or luxrender.exe on Windows).

In this preferences screen we can also set the desired image size we want to produce.

Rendering with PovRay

We will use the table we have been modelling in the traditional modeling chapter to produce renderings with PovRay and Luxrender.

  • Start by loading the table.FCStd file that we modelled earlier or from the link at the bottom of this chapter.
  • Press the small down arrow next to the New Povray project button, and choose the RadiosityNormal template
  • A warning message might appear telling you that the current 3D view is not in perspective mode and the rendering will therefore differ. Correct this by choosing No, choosing menu View->Perspective view and choosing the RadiosityNormal template again.
  • You can also try other templates after you create a new project, simply by editing its Template property.
  • A new project has now been created:

  • The new project has adopted the point of view of the 3D view as it was at the moment we pressed the button. We can change the view, and update the view position stored in the Povray project anytime, by pressing the Reset camera button.
  • The Raytracing Workbench works the same way as the Drawing Workbench: Once a project folder is created, we must add Views of our objects to it. We can now do that by selecting all the objects that compose the table, and press the Insert part button:

  • The views have taken the color and transparency values from their original parts, but you can change that in the properties of each individual view if you wish.
  • We are now ready to produce our first Povray render. Press the Render button.
  • Note for windows users: when receiving (in Povray) a warning saying "I/O restrictions prohibit write access ..."
    • open Povray
    • choose "Options > Script I/O Restrictions" and make sure it is set to "No Restrictions"
    • retry render
  • You will be asked to give a file name and path for the .png image that will be saved by Povray.
  • Povray will then open and calculate the image.
  • When this is done, click the image to close the Povray window. The resulting image will be loaded in FreeCAD:

Rendering with LuxRender

  • Rendering with Luxrender works almost the same way. We can leave our file open and create a new Luxrender project in the same file, or reload it to start from scratch.
  • Press the little down arrow next to the New Luxrender project button and choose the LuxOutdoor template.
  • Select all the components of the table. If you still have the Povray project in your document, be sure to also select the Luxrender project itself, so the views created in the next step won't go in the wrong project by mistake.
  • Press the Insert part button.
  • Select the Luxrender project, and press the Render button.
  • Luxrender works differently to Povray. When you start the render, the Luxrender application will open and immediately start rendering:

  • If you leave that window open, Luxrender will continue calculating and rendering forever, progressively refining the image. It is up to you to decide when the image has reached a sufficient quality for your needs, and stop the render.
  • There are also many controls to play with, on the left panel. All these controls will change the aspect of the image being rendered on the fly, without stopping the rendering.
  • When you feel the quality is good enough, press Render->stop, and then File->Export to image->Tonemapped low dynamic range to save the rendered image to a png file.

You can greatly extend the rendering possibilities of FreeCAD by creating new templates for Povray or Luxrender. This is explained in the Raytracing Workbench documentation.

Downloads

Read more