Forum

#1 2010-08-16 05:17:19

rajaram
Member

ShaderNodeSL

Hi Ben,

can u give some examples on ShaderNodeSL  and function class........

Because I want to try with renderman shading language ....

Last edited by rajaram (2010-08-16 07:14:23)

Offline

 

#2 2010-08-17 07:23:48

pixo
Member

Re: ShaderNodeSL

Hello Rajaram,

You should try to double click on a CookTorrance node, it was done in Sl, with a "Sl Box" node.
You can find basic explanation in the guerilla documentation .

For the rest https://renderman.pixar.com/products/ri … ec3_1.pdf.
All the functions are not fully supported for the moment ,we should all shoot together to have it ....smile.

The only thing to understand is that SlBox is a function, not a shader, which can return many output(aov).

Hope it help you !

Cheers,
Pixo

Offline

 

#3 2010-08-17 10:47:42

rajaram
Member

Re: ShaderNodeSL

Yeah Pixo ..

I tried with sl.gnode ...
it is working by dragging but, same is not the case , if we try with script editor .......

in script editor it is having problem with ref() .. I thought it is a function .. but it is giving error

It seems we have to create SL node and i/o nodes  like sl.gnode and sl function again by clicking ....

cool

Offline

 

#4 2010-08-17 13:39:49

Ben
Guerilla dev, the guy to hug

Re: ShaderNodeSL

Hi Rajaram,

To create a default SL node, do as follow:

Code:

-- Replace NewMaterial by your material name
local theMaterial = Document:getchild ("NewMaterial")
local mod = Document:modify ()
-- pop a SL Box node in the material
local SLnode = theMaterial:addnode ("$(LIBRARY)/nodes/utils/sl.gnode")
-- this is the code for a simple lambert diffuse, replace this by whatever suits you
local slcode = [[
color lambert ()
{
    color C = 0;
    illuminance (P)
    {
        C += clamp (normalize (N) . normalize (L), 0, 1);
    }
    return C;
}
]]
if SLnode then
    -- You must use the setSL method, you must not write directly into the Script plug of the node,
    -- otherwise the SL code won't be compiled.
    SLnode:setSL (slcode)
end
mod.finish ()

As a general rule, you'd better use the addnode method using a path on the library rather the trying to create them shader nodes directly, as we still have a little bit of work to do before it is fully functionnal.

Regards,
Ben


Benjamin 'Ben' Legros
Guerilla developer
http://www.guerillarender.com

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2008 PunBB