Dev:2.6/Py/Scripts/Render/POV-Ray

提供: wiki
< Dev:2.6‎ | Py
移動先: 案内検索
render_povray
Renders scenes with POV-Ray 3.7
UI location Renderer rolldown menu
Usage If POV-Ray 3.7 is installed, activate the addon in the menu File » User Preferences. Choose it as the renderer and render with F12.
Version 0.0.8 Author(s) Campbell Barton, Silvio Falcinelli, Maurice Raybaud, Constantin Rahn
Blender 2.57 License GPL
Category Render Distribution Release
Note(s) After May the 10th 2011, some development to the script limited backwards compatibility: If you set up some files prior to that and always use the latest exporter from SVN. It is advised to run the update script and resave your scene with the new version: get to the search bar with Space and type pov to access this command.


Executable information
File name (Python script)+ POV-Ray 3.7
Current version download https://svn.blender.org/svnroot/bf-extensions/trunk/py/scripts/addons/render_povray/
Python modules Used standard Python modules
External Python Modules or dependencies POV-Ray 3.7 current beta


Warning Both POV-Ray 3.7 and this script are beta.
Links http://povray.org/
Release Log Dev:2.5/Py/Scripts/Render/POV-Ray
Known Issues Currently Important:
  • Packed texture files need to be unpacked.
  • Linked libraries don't work
  • Border-Render crashes Blender


POV-Ray 3.7 Exporter Development

Test files:

Regression Files

Oyonale Mini Demo Scene Imported and saved as a Blend

Speed Tests

Comparison Blender <-> POV-Ray:

RenderBranch.jpg

Setup:
i7 720M, 10GB RAM
Blender Internal 64bit: 57 seconds 99

POV37.jpg

Same setup,
POV-Ray 3.7 beta 38, 64bit ; 35 radiosity (GI) samples: 49 seconds 97
POV-Ray 3.7 RC 7, 64bit ; 35 radiosity (GI) samples: 22 seconds 70
UberPOV 1.37.1, 64bit ; 35 radiosity (GI) samples Stochastic AA: 18 sec. 05
POV-Ray 3.7.1 RC 1, 64bit ; 35 radiosity (GI) samples: 09 seconds 16


History

This script started as a proof of concept developed by Campbell Barton for the render API introduced with Blender 2.5. It could render most geometry types right from the start by converting them to triangles.

Silvio Falcinelli added support for UV mapping and Maurice Raybaud worked mostly on the shading area.

Constantin Rahn improved formatting and control of output files including the first ability to export animation.

Bastien Montagne improved the overall architecture of the script and its integration with Linux.


{NiceTip|After May the 10th 2011, some development to the script limited backwards compatibility: If you set up some files prior to that and always use the latest exporter from SVN. It is advised to run the update script and save your scene again with the new version: get to the search bar with Space and type 'pov' to access this command. }

Povray 3.7 is now in RC7. Release is imminent and just waiting for the end of the documentation update. Some change to the SSTL syntax will require a refresh of Blender's SSS exporting as soon as POV's next release candidate (whether as the official release or not)is available


Latest Fixes:

Complete List:

https://developer.blender.org/diffusion/BA/browse/master/render_povray/


Selective Digest:


-improved world export

-Added texture gamma adjustment ("gamma n.n" keyword per image_map in pov syntax)

-Added a media entry at world level to allow fast atmospheric effects like volume lights

-Lattices made scenes crash the export

-Better matching of blender texture scales and

-Meshes: Some updates of Blender trunk, now subdivided meshes can export

-Added some advanced Radiosity photons and Depth of Field UI controls

-Animations can be exported directly and a clock variable allows to script some more by hand

-Custom replacement code for Materials from Text editor added

-importer added for pov/inc files

Renderer versions

UberPOV features can be written to a POV file inside the scope of a specific condition to enable the files to be retro compatible with POV-Ray 3.7 syntax:

reflection { 1 metallic 
    #ifdef(unofficial)
        #if(unofficial = "patch")
            #if(patch("upov-reflection-roughness") > 0)
                roughness 0.1
            #end
        #end
    #end        
    }

It enables you to export a file for UberPOV while still rendering it with standard POV, but this solution makes files slightly heavier and longer to parse, so it might change in the future: cleaning up exported pov when the features get available in all versions.


Workflow, Architecture and developement Guidelines:

The idea is two step:

  1. To translate Blender Materials and geometry 100 % so users can start quickly from their old Blender scenes and create artwork, form a community. This even, if it requires a little "unnatural" pov approaches.
  2. Implement every possible native POV feature for Blender to become the first choice interface to pov' this has already started by allowing

the use of custom codes.


OTHER GUIDELINES

  • no *.inc include files used in output, just one big pov file

to minimize memory overhead > don't add standard pov include files but inline them directly as declarations at the start of the pov file, and create python preset files rather than using pov presets (mimic pov radiosity include file)

  • No objects that are not rendered created in the scene: if possible use only one blender object per pov object in the output:

for non mesh objects, do not use an empty for inerfacing or carying properties besides a geometrt proxy but prefer using just the proxy with the necessary attributes on it.

  • Automatize some things POV lets the user do by hand, use the car icon to fill some settings with formulas (pretrace size can be optimized in relation to image size, regular texture channels such as specular and transparency always follow the same logic so have them "hardcoded" rather than force user to recreate them all the time

POV-Ray specific concepts

Below are the definition of some POV-Ray concepts and what they include

object (geometry+material)

Objects are the building blocks of your scene. There are a lot of different types of objects supported by POV-Ray. they are also sometimes called primitives. The mesh object often exported from Blender is just one of the possible primitives supported by POV, but it's one that allows to make the most profitable use of the exporter because a sculpted mesh is easily done in Blender interface and practically impossible to do with POV-Ray alone. The second stage of the exporter's development will allow to use more POV native primitives through Blender interface.

In any case the pov object contains the geometry and can also have the material block, if there is one, at the same hireachical level. This type of construction could be compared to Blender use of "Object Material"

material (interior+texture)

In POV-Ray, there used to be only texture properties inside an object and interior properties such as Index of Refraction could be declared in the same block.


But the developers thought "It is totally illogical to have a ray enter an object with one index or refraction and then recalculate with another index" in the case of multitextured objects.

Nowadays, POV-Ray texture still contains the properties ruling interaction between an object and its environment, such as reflectivity, roughness etc. while Interior stands for internal properties that have an incidence on the light that crosses the surface: index of refraction, media scattering or absorbing light, etc.

For easier reference with a single identifier in a texture library, a wrapper around texture and interior has been created which we call 'material'

texture (pigment+normal+finish)

POV-Ray textures are combinations of pigments, normals, and finishes.

  • Pigment is the color or pattern of colors inherent in the material.
  • Normal is a method of simulating various patterns of bumps, dents, ripples or waves by modifying the surface normal vector.
  • Finish describes the reflective properties of a material.

texture_list

If the texture is not put inside a material statement, it can be put directly inside the geometry of the object, it allows to apply different textures to different parts of the object through a texture list and texture indices assigned per face.

The exporter exploits this feature for meshes with several materials. This type of construction could be compared to Blender's Data material. However, in POV-Ray, all the textures still share one common set of interior properties per object.


The above entities can be embedded in various ways: POVMindMap.png

So... What's in a "texture"?

pigment and/or normal

A pigment can be composed of either

  • a color
  • a procedural pattern or a bitmap

finish

This third element of a texture is a little different as it can also be mapped by the texture influence of some texture: Two versions of the finish with generally different specular values are patterned

Most complex Materials case

Blender materials being able to map alpha, diffuse, normal, specular, specular hardness, specular color

what is impossible in POV: map with various specular color What remains: most complex exported material case

Current implementation

[Mindmap of the most complex datafow]

shader emulation needs some update since a real minnaert now exists

alpha to filter

pigment normal

all this duplicated with min and max specular

May Do List:

If you want to add some functionality or fame to POV exporter, here are a few planned tasks, from the easiest to more complex among which to pick:

  • Creating a POV importer;: ideally, it would not be a separate addon, but would just get activated at the same time as the exporter. providing an entry in Blender import menu. but maybe also
    • a special pov primitive in the creation menu?
    • an "import" operator button in the text window somewhere around the custom povcode check box

  • Adding stereoscopic rendering support
  • just making nice pictures to provide the scenes to testers would be very usefull. Jeremy Birns Render challenges are a good start for models.
  • Recreate the old Blender starfield feature ("stars") with the appropriate POV-Ray keyword, if not deprecated.
  • Anything that prepares the way to a Real time mode (not like Cycles but like Blender internal)


  • adding pov rainbow object (in world settings)

Interaction is to be improved as the rainbows in povray have a location, but do not have volumes maybe use XRAY draw mode and add section parameters

  • moving / adding atmospheric media from main render property tab to world properties? having all pov properties not too scattered across tabs could be a good thing though... what do you think?
  • write custom materials after globals rather than before as it does now, to allow the use of srgb colors definitions after assumed gamma is already specified
  • repairing vertex colors, broken since bmesh
  • adding procedural texture(s) inside some wrapper "POV" texture available if possible at the same level as the blender procedurals so that we can still have an automatic translation of those from Blender Internal scenes (most of them find some equivalents in pov by only changing the names and some factors for their parameters. In the exported pov code the patterns with its options should be written anywhere a bitmap currently can be written.
  • hair rendering has just been added but not all corner case have been tested, it probably fails a lot also if procedural(s) are added, maybe some color could be derived from it for the hair sphere sweep.
  • smoke support can be added by making Blender write voxel data to a DF3 File

https://developer.blender.org/file/data/qhsfvk6hnywfpepat2lb/PHID-FILE-auebchhzjziicqw4gs5p/povray_df3.png

other areas:

  • Exporter should support texture animation. Blender image sequence and current Offset value should be evaluated and then the correct texture would be the selected and written to export. This works in BI and in Cycles.
  • Activate compositing for pov render, maybe inspiring from freestyle integration for the code, but the implementation would be best based on BI interface. the only effects we really need since they are so slow in POV are vector blur and defocus for the vector pass, it would necessarily have to run a BI render just before compositing. For the zdepth it could either be made that way as well or using a fog with a white override material in POV to create a zdepth in a previous or subsequent render pass to the main one.
  • repair baking code (mesh camera), currently commented out
  • adding povray 3.7 real time mode (+RTR comand line) inspiring from cycles for its interface integration
  • integrating Lightsys or sunpos macro using the sky option of the sun lamp and all necessary additional parameters

to then translate blender sun and sky parameters



OTHERS Stacked (more or less) according to priority.

At the end, Completed tickets must not be deleted until some documentation is at least linked to from the user page.

to do
 BrainstormingPriority-high.png
Find some tangent space normal maps pov macro or built in function.


done
 MRPriority-medium.png
Render only visible Layer.


done
 90Priority-low.png
Add some procedurals.


to do
 MRPriority-low.png
Edges for toon rendering (try with a very thin slope map)


to do
 MRPriority-low.png
Add Object Depth of Field support. (Distance based is currently available)


to do
 BrainstormingPriority-low.png
Add Motion Blur (using ghosting)


to do
 BrainstormingPriority-low.png
Ambient occlusion (via proximity pattern?)


in progress Inprogress100.jpg 90%
 CR MRPriority-low.png
The texture code has some redundant parts that might be better implemented as functions.


done
 BrainstormingPriority-low.png
Render only visible/renderable objects (outliner).


in progress Inprogress50.jpg 40%
 MRPriority-experienced.png
Render Baking (using new improvements to camera since beta 39 of POV-Ray 3.7)


to do
 MRPriority-experienced.png
Add exclusion from media option per light


done
 For UberPOVPriority-experienced.png
Add Blurry Reflection/Refraction Hack. (averages micro/macro normals


 Click For POV-Wiki!
Add importance sampling of radiosity (new since beta 39 of POV-Ray 3.7).


 Click For POV-Wiki!
-Allow some command line arguments to be passed


 Click For POV-Wiki!
More Depth of Field UI control


done
 
Allow materials or objects to be replaced by POV-Ray text files with the same name. These blender text files use the include keyword to link other inc files from the disk.