[Bf-committers] Render Plugin Development

Campbell Barton cbarton at metavr.com
Thu Aug 16 04:40:30 CEST 2007

Matt Ebb wrote:
> On 8/16/07, *Mathias Wein* <lynx at aspect-design.de 
> <mailto:lynx at aspect-design.de>> wrote:
>     Campbell Barton wrote:
>      > Id suggest that custom material types make use of blenders
>     internal data
>      > where possible.
>      > (Matt - maybe this is implied in your proposal, not sure...)
>      > For example, you have a scene. render in Povray and set the color to
>      > just the right color, then decide to try renderman, when changing the
>      > material types youd not want to loose the color.
>      >
>     Well, my "scripting department" (Bert Buchholz) strongly voted against
>     mixing blender settings with external renderer specific ones, and he
>     pretty much convinced me it is the better way.
>     If the blender material can't be converted, make a complete and clean
>     interface for the material type, it is confusing if renderers overwrite
>     each other's settings, and mappings will become unintuitive if you try
>     to reuse too many settings, too few will have the same meaning.
> I'm with Mathias here, re-using bits and pieces of Blender settings (as 
> in the variables in the Material DNA Struct) is not a good way to go at 
> all. Not only are the settings not equal or even relevant from renderer 
> to renderer, but especially cherry picking what of Blender's material 
> settings will be reused and what won't is something that would be 
> extremely inconsistent and confusing. As a user you don't want to be in 
> the situation of times past with the old Yafray where the same sliders 
> in Blender will do slightly different things depending on what renderer 
> is selected, and you have to remember in your head 'oh the X slider 
> really means Y'.
> What I implied in my proposal was not reusing the data, but *conversion*.
> Each render plugin should have a conversion function, that takes the 
> settings of a Blender material and converts them to settings in the 
> native representation, doing a best-guess lookalike estimate, so that 
> the results look similar when rendered.
> This conversion process would be used twice:
> * When rendering a 'Blender material' in an external renderer
> * When changing a 'Blender material' to an eg. 'Yafray material' in the 
> material type menu.
> How that data is stored in the native format for that renderer I don't 
> really know or care about, but it sounds like ID properties would be a 
> good way to go. However even if using ID properties, the user shouldn't 
> really care or know the difference - there should still be a series of 
> material panels, with sliders and colour pickers to control various 
> aspects of the material, just the data internally is coming from a 
> different source (id properties rather than material dna struct).
> cheers
> Matt

Hi, taking the completely separate material settings route would work 
but, opens up some issues.

Blenders material will still exist under the render material, where will 
object colors in the 3d view come from?

Conversion from a blender material is fine. but whats the best way to 
convert back, or is this needed?

As an example, a user might have a model for architectural rendering, 
and want to see how it renders in a number of engines.

They might set up their scene to look nice in povray, and then decide to 
see how it renders in blenders internal renderer.

Assume they have some povray specific settings....

* What happens when they switch back? - options might be...
-- all material colors revert to their blender settings that were around 
before they used a pov material. this is what would happen without any 
work and its not a good option IMHO.
-- or... they are asked if they want to convert the settings from pov 
back to blender-standard settings (Would require all pluins to have a 
convertBack function, not such a bad thing - especially as an option, 
just the reverse of the convert to function)

Otherwise users could just accept all render specific materials can only 
be used for that engine. -  when experimenting just dont use render 
specific materials.

though providing no fast way to switch seems a bit crap... you could get 
into situations like...
"Id like to switch back to use blenders internal to render an animation, 
but I dont want to have to set up all my materials again"

- Cam

More information about the Bf-committers mailing list