Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/ymesh/meShaderEd
Browse files Browse the repository at this point in the history
  • Loading branch information
ymesh committed Jun 9, 2013
2 parents 36c603e + 7608be0 commit 62e1262
Show file tree
Hide file tree
Showing 28 changed files with 131 additions and 18 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0"?>

<node name="gradeCC" label="gradeCC" author="DRL">
<node name="gradeFromCC" label="gradeCC" author="DRL">
<help>Remap color in [0-1] range to new value between defined min and max.</help>
<input>
<property name="input" type="color" default="color(0)"/>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0"?>

<node name="gradeF" label="gradeF" author="DRL">
<node name="gradeFromF" label="gradeF" author="DRL">
<help>Remap float value in [0-1] range to new min and max.</help>
<input>
<property name="input" type="float" default="0"/>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0"?>

<node name="gradeFC" label="gradeFC" author="DRL">
<node name="gradeFromFC" label="gradeFC" author="DRL">
<help>Remap float value in [0-1] range to color between new min and max.</help>
<input>
<property name="input" type="float" default="0"/>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0"?>

<node name="remapF" author="Pixar">
<node name="gradeFullF" author="Pixar">
<help>Remap float value </help>
<input>
<property name="input" type="float" default="0" subtype="slider" range="0 1.0 .01"/>
Expand All @@ -16,7 +16,7 @@
<![CDATA[
$(result) = clamp($(input), $(inputmin), $(inputmax) );
$(result) = $(outputmin) +
($(outputmax) - $(outputmin)) * ($(result) - $(inputmin)) / ($(inputmax) - $(inputmin));
]]>
($(outputmax) - $(outputmin)) * ($(result) - $(inputmin)) / ($(inputmax) - $(inputmin));
]]>
</code>
</node>
22 changes: 22 additions & 0 deletions lib/nodes/RSL/ColorCorrect/grade/gradeToF.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0"?>

<node name="gradeToF" label="gradeToF" author="DRL">
<help>Remap float value from min and max to [0-1] range.</help>
<input>
<property name="input" type="float" default="0"/>
<property name="min" type="float" default="0" detail="uniform"
subtype="slider"
range="0 1 .01"/>
<property name="max" type="float" default="1" detail="uniform"
subtype="slider"
range="0 1 .01"/>
</input>
<output>
<property name="result" type="float"/>
</output>
<code><![CDATA[
$(result) = ( $(input) - $(min) ) / ( $(max) - $(min) );
]]>
</code>
</node>
2 changes: 1 addition & 1 deletion lib/nodes/RSL/ColorCorrect/saturation.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0"?>

<node name="saturation" author="mesh">
<help>Controls the color sauration value</help>
<help>Controls the color saturation value</help>
<input>
<property name="input" type="color" default="color(0,0,0)"/>
<property name="value" type="float" default="1" subtype="slider" range="0 1 0.01"/>
Expand Down
2 changes: 1 addition & 1 deletion lib/nodes/RSL/displacement.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0"?>
<node name="displace" type="displacement" author="mesh">
<node name="displacement" label="disp" type="displacement" author="mesh">
<help>Root displacement shader.</help>
<input>
<property name="P" type="point" default="point (0.0, 0.0, 0.0)" />
Expand Down
5 changes: 5 additions & 0 deletions lib/nodes/RSL/globals/(aovs)/DRL/iColor.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,23 @@
<help>This node produces "i_color" AOV.
ATTENTION: you really don't want to use this node more then once in any shader.</help>
<input>
<property name="input" type="color" default="color(0)">
<help>Any color component used just for connecting this node to shader network.</help>
</property>
<property name="mnClr" type="color" default="color(0)">
<help>Main color AOV.</help>
</property>
</input>

<output>
<property detail="varying" name="output" type="color"/>
<property detail="varying" provider="primitive" name="i_color" type="color" default="color(0)"/>
</output>

<code><![CDATA[
i_color = $(mnClr);
$(output) = $(input);
]]>
</code>
Expand Down
5 changes: 5 additions & 0 deletions lib/nodes/RSL/globals/(aovs)/DRL/iDiffInd.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,23 @@
<help>This node produces "i_diff_ind" AOV.
ATTENTION: you really don't want to use this node more then once in any shader.</help>
<input>
<property name="input" type="color" default="color(0)">
<help>Any color component used just for connecting this node to shader network.</help>
</property>
<property name="diffInd" type="color" default="color(0)">
<help>Indirect diffuse AOV.</help>
</property>
</input>

<output>
<property detail="varying" name="output" type="color"/>
<property detail="varying" provider="primitive" name="i_diff_ind" type="color" default="color(0)"/>
</output>

<code><![CDATA[
i_diff_ind = $(diffInd);
$(output) = $(input);
]]>
</code>
Expand Down
5 changes: 5 additions & 0 deletions lib/nodes/RSL/globals/(aovs)/DRL/iEnv.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,23 @@
<help>This node produces "i_env" AOV.
ATTENTION: you really don't want to use this node more then once in any shader.</help>
<input>
<property name="input" type="color" default="color(0)">
<help>Any color component used just for connecting this node to shader network.</help>
</property>
<property name="env" type="color" default="color(0)">
<help>Environment AOV.</help>
</property>
</input>

<output>
<property detail="varying" name="output" type="color"/>
<property detail="varying" provider="primitive" name="i_env" type="color" default="color(0)"/>
</output>

<code><![CDATA[
i_env = $(env);
$(output) = $(input);
]]>
</code>
Expand Down
5 changes: 5 additions & 0 deletions lib/nodes/RSL/globals/(aovs)/DRL/iReflection.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,23 @@
<help>This node produces "i_reflection" AOV.
ATTENTION: you really don't want to use this node more then once in any shader.</help>
<input>
<property name="input" type="color" default="color(0)">
<help>Any color component used just for connecting this node to shader network.</help>
</property>
<property name="refl" type="color" default="color(0)">
<help>Reflection AOV.</help>
</property>
</input>

<output>
<property detail="varying" name="output" type="color"/>
<property detail="varying" provider="primitive" name="i_reflection" type="color" default="color(0)"/>
</output>

<code><![CDATA[
i_reflection = $(refl);
$(output) = $(input);
]]>
</code>
Expand Down
5 changes: 5 additions & 0 deletions lib/nodes/RSL/globals/(aovs)/DRL/iSpec.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,23 @@
<help>This node produces "i_spec" AOV.
ATTENTION: you really don't want to use this node more then once in any shader.</help>
<input>
<property name="input" type="color" default="color(0)">
<help>Any color component used just for connecting this node to shader network.</help>
</property>
<property name="spec" type="color" default="color(0)">
<help>Specular AOV.</help>
</property>
</input>

<output>
<property detail="varying" name="output" type="color"/>
<property detail="varying" provider="primitive" name="i_spec" type="color" default="color(0)"/>
</output>

<code><![CDATA[
i_spec = $(spec);
$(output) = $(input);
]]>
</code>
Expand Down
5 changes: 5 additions & 0 deletions lib/nodes/RSL/globals/(aovs)/DRL/rflAmount.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,23 @@
<help>This node produces "rfl_amount" AOV.
ATTENTION: you really don't want to use this node more then once in any shader.</help>
<input>
<property name="input" type="color" default="color(0)">
<help>Any color component used just for connecting this node to shader network.</help>
</property>
<property name="rflAmt" type="float" default="0">
<help>Reflection Amount AOV.</help>
</property>
</input>

<output>
<property detail="varying" name="output" type="color"/>
<property detail="varying" provider="primitive" name="rfl_amount" type="float" default="0"/>
</output>

<code><![CDATA[
rfl_amount = $(rflAmt);
$(output) = $(input);
]]>
</code>
Expand Down
5 changes: 5 additions & 0 deletions lib/nodes/RSL/globals/(aovs)/DRL/rflTint.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,23 @@
<help>This node produces "rfl_tint" AOV.
ATTENTION: you really don't want to use this node more then once in any shader.</help>
<input>
<property name="input" type="color" default="color(0)">
<help>Any color component used just for connecting this node to shader network.</help>
</property>
<property name="rflTint" type="color" default="color(0)">
<help>Reflection Tint AOV.</help>
</property>
</input>

<output>
<property detail="varying" name="output" type="color"/>
<property detail="varying" provider="primitive" name="rfl_tint" type="color" default="color(0)"/>
</output>

<code><![CDATA[
rfl_tint = $(rflTint);
$(output) = $(input);
]]>
</code>
Expand Down
25 changes: 25 additions & 0 deletions lib/nodes/RSL/surface_noOiAffect.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?xml version="1.0"?>

<node name="surface_noOiAffect" label="surf" type="surface" author="mesh">
<help>Basic surface shader allowing to set exact Ci, not affected by Oi.</help>
<input>
<property name="Ci" type="color" default="color(0.0, 0.0, 0.0)" />
<property name="Oi" type="color" default="color(1.0, 1.0, 1.0)" />
</input>
<output>
<property name="surface" type="rib" default="Surface &quot;${NODELABEL}&quot;" />
</output>
<code><![CDATA[
#define SURFACE_SHADER ${INSTANCENAME}
surface ${INSTANCENAME} (
${PARAMS}
)
{
/* CODE BEGIN ${INSTANCENAME} */
Ci = $(Ci);
Oi = $(Oi);
/* CODE END ${INSTANCENAME} */
}
]]>
</code>
</node>
4 changes: 2 additions & 2 deletions lib/nodes/RSL/types/conversion/colorToNormal.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
<property name="inC" type="color" default="color(0)" />
</input>
<output>
<property name="outN type="normal" />
<property name="outN" type="normal" />
</output>
<code><![CDATA[
$(outP) = normal($(inC));
$(outN) = normal($(inC));
]]>
</code>
</node>
4 changes: 2 additions & 2 deletions lib/nodes/RSL/types/file.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
<help>Dummy string file parameter.
Useful for connecting filename inputs (such as envMap) from the other nodes to a single value.</help>
<input>
<property name="file" type="string" default="" detail="uniform" subtype="file"/>
<property name="fl" type="string" default="" detail="uniform" subtype="file"/>
</input>
<output>
<property name="output" type="string" detail="uniform"/>
</output>
<code><![CDATA[
$(output) = $(file);
$(output) = $(fl);
]]>
</code>
</node>
4 changes: 2 additions & 2 deletions lib/nodes/RSL/types/float.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
<help>Dummy float parameter.
Useful for connecting float inputs from the other nodes to a single value.</help>
<input>
<property name="float" type="float" default="0" detail="uniform"/>
<property name="F" type="float" default="0" detail="uniform"/>
</input>
<output>
<property name="output" type="float" detail="uniform"/>
</output>
<code><![CDATA[
$(output) = $(float);
$(output) = $(F);
]]>
</code>
</node>
4 changes: 2 additions & 2 deletions lib/nodes/RSL/types/string.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
<help>Dummy string parameter.
Useful for connecting string inputs (such as coordSpace) from the other nodes to a single value.</help>
<input>
<property name="string" type="string" default="" detail="uniform"/>
<property name="S" type="string" default="" detail="uniform"/>
</input>
<output>
<property name="output" type="string" detail="uniform"/>
</output>
<code><![CDATA[
$(output) = $(string);
$(output) = $(S);
]]>
</code>
</node>
4 changes: 2 additions & 2 deletions lib/nodes/RSL/types/switch.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
<help>Dummy float switch.
Useful for connecting switch inputs from the other nodes to a single value.</help>
<input>
<property name="switch" type="float" default="0" detail="uniform" subtype="switch"/>
<property name="sw" type="float" default="0" detail="uniform" subtype="switch"/>
</input>
<output>
<property name="output" type="float" detail="uniform"/>
</output>
<code><![CDATA[
$(output) = $(switch);
$(output) = $(sw);
]]>
</code>
</node>
31 changes: 31 additions & 0 deletions lib/nodes/RSL/utilites/NormalMapSpace.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?xml version="1.0"?>

<node name="NormalMapSpace" label="nmS" author="DRL">
<help>Normalmap texture in custom space.</help>

<input>
<property name="N" type="normal" default="normal (0, 1, 0)">
<help>Normal vector.</help>
</property>
<property name="sourceSpace" type="string" default="current" detail="uniform">
<help>The space that incoming N vector is in.</help>
</property>
<property name="bakeSpace" type="string" default="object" detail="uniform">
<help>The space to calculate normal map for.</help>
</property>
</input>

<output>
<property detail="varying" name="NM" type="color"/>
</output>

<code><![CDATA[
// code begin - NormalMapSpace
$(NM) = color( normalize( transform( $(sourceSpace), $(bakeSpace), $(N) )));
$(NM) = ( $(NM) + color(1) ) / 2; // grade NM to [0-1] color range
$(NM) = clamp( $(NM), color(0), color(1) );
// code end - NormalMapSpace
]]>
</code>
</node>

0 comments on commit 62e1262

Please sign in to comment.