[Bf-cycles] Add shader - OSL mockup revisited

Gottfried Hofmann gottfried at blenderdiplom.com
Wed Jun 19 22:08:45 CEST 2013


Hello list,

this is what I am using at the moment in OSL (after comments from Brecht):

#include "stdosl.h"

shader node_advancedadd_closure(
float Fac1 = 1.0,
closure color Closure1 = 0,
float Fac2 = 1.0,
closure color Closure2 = 0,
output closure color Closure = 0)
{
Closure = Closure1 + Closure2;
}

Save it as add.osl and load it into a script node. you need to have Open 
Shading Language enabled:

http://www.pasteall.org/pic/53790

Gottfried


On 06/19/2013 07:04 PM, Jonathan Williamson wrote:
> +1 from me as well. I don't know enough about the math behind it, but is
> this something that a simple "Clamp" option would work to prevent too
> much energy reflectance?
>
> Jonathan Williamson
> http://cgcookie.com
>
>
> On Wed, Jun 19, 2013 at 10:00 AM, Daniel Salazar - 3Developer.com
> <zanqdo at gmail.com <mailto:zanqdo at gmail.com>> wrote:
>
>     I would very much appreciate a factor input for the Add Shader
>
>     Daniel Salazar
>     patazstudio.com <http://patazstudio.com>
>
>
>     On Wed, Jun 19, 2013 at 7:16 AM, Adriano Oliveira
>     <adriano.ufrb at gmail.com <mailto:adriano.ufrb at gmail.com>> wrote:
>
>         Greg,
>
>         You can just use a dark gray color in glossy (with a fresnel as
>         add factor), in this cases, don't you?
>
>
>         Adriano
>
>         2013/6/19 Greg Zaal <gregzzmail at gmail.com
>         <mailto:gregzzmail at gmail.com>>
>
>             Yeah a Fac for Add shader would be great. But in the case of
>             making coated plastic materials, you shouldn't use it
>             because of energy conservation (a material cant reflect more
>             energy/light than it gets) - assuming you're going for
>             realistic shading.
>
>
>             On 19 June 2013 13:59, Adriano Oliveira
>             <adriano.ufrb at gmail.com <mailto:adriano.ufrb at gmail.com>> wrote:
>
>                 Hi friends,
>
>                 Is there any reson way Add Shader does not have a
>                 factor, like Mix Sahder does?
>
>                 I supose that Add Diffuse and Glyssy is batter than Mix
>                 them to get coated and plastic materials. So a factor
>                 slot would be very useful.
>
>
>                 Adriano
>
>
>                 _______________________________________________
>                 Bf-cycles mailing list
>                 Bf-cycles at blender.org <mailto:Bf-cycles at blender.org>
>                 http://lists.blender.org/mailman/listinfo/bf-cycles
>
>
>
>             _______________________________________________
>             Bf-cycles mailing list
>             Bf-cycles at blender.org <mailto:Bf-cycles at blender.org>
>             http://lists.blender.org/mailman/listinfo/bf-cycles
>
>
>
>         _______________________________________________
>         Bf-cycles mailing list
>         Bf-cycles at blender.org <mailto:Bf-cycles at blender.org>
>         http://lists.blender.org/mailman/listinfo/bf-cycles
>
>
>
>     _______________________________________________
>     Bf-cycles mailing list
>     Bf-cycles at blender.org <mailto:Bf-cycles at blender.org>
>     http://lists.blender.org/mailman/listinfo/bf-cycles
>
>
>
>
> _______________________________________________
> Bf-cycles mailing list
> Bf-cycles at blender.org
> http://lists.blender.org/mailman/listinfo/bf-cycles
>


-- 
--- BlenderDiplom.com ---


More information about the Bf-cycles mailing list