Manual:Creating renderings/fr: Difference between revisions

From FreeCAD Documentation
(Created page with "Une fois que POV-Ray ou Luxrender est installé, nous devons définir le chemin d'accès à son exécutable principal dans les préférences de FreeCAD. Cela n'est généralem...")
(Created page with "Dans cet écran de préférences, nous pouvons également définir la taille d'image souhaitée que nous voulons produire.")
Line 17: Line 17:
[[Image:Exercise_raytracing_01.jpg]]
[[Image:Exercise_raytracing_01.jpg]]


Dans cet écran de préférences, nous pouvons également définir la taille d'image souhaitée que nous voulons produire.
In this preferences screen we can also set the desired image size we want to produce.


=== Rendering with PovRay ===
=== Rendering with PovRay ===

Revision as of 18:53, 5 June 2017

Dans le langage des ordinateurs, un rendu (rendering) est un mot utilisé pour décrire une belle image produite à partir d'une maquette 3D. Bien sûr, nous pourrions dire que ce que vous voyez dans la vue 3D FreeCAD est déjà sympa. Mais quiconque a vu un film récent de Hollywood sait qu'il est possible de produire des images avec un ordinateur qui ne se distinguent guère d'une photographie.

Bien sûr, produire de telles images photo-réalistes nécessite beaucoup de travail et une application 3D qui offre des outils spécifiques à cela, tels que des contrôles précis pour les matériaux et l'éclairage. FreeCAD étant une application plus orientée vers la modélisation technique, elle ne présente pas d’outil de rendu avancé.

Heureusement, le monde open-source offre de nombreuses applications pour produire des images réalistes. Probablement le plus célèbre est Blender, qui est très populaire et largement utilisé dans les industries du cinéma et du jeu. Les modèles 3D peuvent très facilement et fidèlement être exportés de FreeCAD et importés dans Blender, où vous pouvez ajouter des matériaux et des éclairages réalistes, et produire les images finales ou même des animations.

Certains autres outils de rendu open source sont conçus pour être utilisés dans une autre application, et prendront soin de faire les calculs complexes pour produire des images réalistes. À travers son atelier Raytracing (Raytracing Workbench), FreeCAD peut utiliser deux de ces outils de rendu : POV-Ray et Luxrender. POV-Ray est un projet très ancien, et est considéré comme un moteur classique de raytracing, tandis que Luxrender est beaucoup plus récent et est catégorisé comme un moteur de rendu impartial (unbiased renderer). Les deux ont leurs points forts et leurs faiblesses, selon le type d'image que l'on veut rendre. La meilleure façon de savoir est de regarder des exemples sur les deux sites Web des moteurs de rendu.

Installation

Avant d'être en mesure d'utiliser l'un de ces deux rendus dans l’atelier Raytracing dans FreeCAD, les applications doivent être installées sur votre système. C'est généralement très simple, les deux installateurs sont fournis pour de nombreuses plates-formes ou sont généralement inclus dans les référentiels logiciels de la plupart des distributions Linux.

Une fois que POV-Ray ou Luxrender est installé, nous devons définir le chemin d'accès à son exécutable principal dans les préférences de FreeCAD. Cela n'est généralement nécessaire que sur Windows et Mac. Sur Linux FreeCAD va le choisir parmi les emplacements standard. L'emplacement des exécutables de Povray ou Luxrender peut être trouvé en recherchant simplement dans votre système les fichiers appelés Povray (ou Povray.exe sur Windows) et Luxrender (ou Luxrender.exe sur Windows).

Dans cet écran de préférences, nous pouvons également définir la taille d'image souhaitée que nous voulons produire.

Rendering with PovRay

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

  • Start by loading the table.FCStd file that we modeled 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 might also try other templates after you created 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.
  • The 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:

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 lux 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 than 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 reach 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, simply press Render->stop, and then File->Export to image->Tonemapped low dynamic range to save the rendered image to a png file.

You can extend greatly the render possibilities of FreeCAD by creating new templates for povray or luxrender. This is explained in the Raytracing Workbench documentation.

Downloads

Read more