Could you provide some more information, such as the console output (if you find anything interesting in there) and if possible either the scene that crashes the edit function or how to reproduce it.
Thanks.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I get similar seg faults while editing shader projects as well. Sometimes it varies but it seems to be caused by a form of corruption in the XML file, such as when trying to change a shader project and removing nodes and trying to render a preview will cause Shrimp to crash. Other times it happens when you do not disconnect links before trying to connect another node - when disconnecting the node after that (when there looks like 2 links to the same value), then reconnect and render this will cause Shrimp to crash as well. This does not happen ALL the time and sadly there is no output in the terminal other than Cannot open file and then Segmentation Fault (not even a line number for any source code, in either Shrimp source or XML project source.
Here is an example shader project that caused crashes.
<output name="value" type="point" storage="varying" description="val = A + B">
<rsl_code>
$(value) = $(A) + $(B);
</rsl_code>
<rsl_include>
<usage>Adds 2 or more inputs. All the input pads will inherit the type of the output pad. </usage>
</rsl_include></output></connection></connection></block>
<block id="user-content-Blotches" position_x="-14.5723432671048" position_y="11.5495251365674" author="rconstruct">
<input name="P" type="point" storage="varying" value="P" description="Surface point to evaluate">
<connection parent="Transform_5" output="Pout">
<input name="radius" type="float" storage="varying" value="0.3" description="Blotch radius">
<input name="frequency" type="float" storage="varying" value="5" description="Frequency">
<input name="offset" type="float" storage="varying" value="0.35" description="Offset">
<input name="jittering" type="float" storage="varying" value="0.8" description="Jittering">
<input name="metric" type="float" storage="uniform" value="2" description="Voronoi distance metric">
<output name="value" type="float" storage="varying" description="Output value">
<rsl_code>
$(value) = blotches( $(radius), $(frequency), $(offset), $(jittering),
$(metric), $(P) );
</rsl_code>
<rsl_include>rsl_shrimp_extrapatterns.h </rsl_include>
<usage>Generates random blotches, based on single feature Voronoi cell noise. "Jittering" controls the Voronoi cell noise jittering, generating a less or more evenly distribution of blotches. "Offset" controls the center offset, a value of 0 generating a hollow blotch, and 1.0 an solid blotch. "Radius" controls the radius, and "frequency", the frequency of the blotches. "Metric" controls the distance metric used for the Voronoi noise, when different than 0 the metric being the Minkowski metric, with "metric" as Minkowski's P parameter, being P = 1, the Manhattan metric, P = 2 the Euclidian metric, and allowing higher orders of P tending towards Tchebychev results. </usage>
</output></connection></block>
<block id="user-content-CalcNormal" position_x="8.45512385529192" position_y="-11.7108634966467" author="rconstruct">
<input name="P" type="point" storage="varying" value="P" description="Point to calculate normal at">
<connection parent="Add_5" output="value">
<output name="N" type="normal" storage="varying" description="NN is normal at p">
<rsl_code>
$(N) = calculatenormal( $(P) );
</rsl_code>
<rsl_include>
<usage>Returns the surface normal of the given point on the surface. You should always recalculate the normals after a displacement. </usage>
</rsl_include></output></connection></block>
<block id="user-content-Diffuse" position_x="-4.62303135746799" position_y="8.01797958720871" author="rconstruct">
<input name="Cdiff" type="color" storage="varying" shader_parameter="1" value="1 0.94902 0.564706" description="Diffuse color">
<connection parent="Mix_2" output="value">
/* Pixie's diffuse() has 2 forms */#define$(blockname)_$(model)#ifRENDERER==pixie&&defined$(blockname)_1aov_diffuse+=$(Kd)*diffuse($(P),$(N),$(coneangle));#elseaov_diffuse+=$(Kd)*diffuse($(N));#endif/* RENDERER */#undef$(blockname)_$(model)$(Ci)=aov_surfacecolor*aov_diffuse;</rsl_code><rsl_include/><usage>LambertianDiffuseterm.Thediffusecolorvalueispassedtothe"aov_surfacecolor",andthediffusevaluetothe"aov_diffuse"AOVpresets.Pixie'sdiffuseshadeophas2forms,thefirstonewithasingleargument,withthesurfacenormal"N",thesecondform,with3arguments,allowingthesurfacepositionandconeangle(inradians)tobespecifiedaswell.ThedefaultconeangleisPI/2.Thevariable"model"togglesbetweenthesingleargument"diffuse"(0),andthe3arguments"diffuse"(1).</usage></block><blockid="Divide"position_x="3.0261902948674"position_y="-9.98833339364303"author="rconstruct"><inputname="A"type="float"storage="varying"value="1"description="1st input"type_parent="value"><connectionparent="FVLNoise3D"output="value"/></input><inputname="B"type="float"storage="varying"value="1"description="2nd input"type_parent="value"><connectionparent="Length"output="value"/></input><outputname="value"type="float"storage="varying"description="val = A / B"/><rsl_code>$(value)=$(A)/$(B);</rsl_code><rsl_include/><usage>DividesinputAbyinputB.</usage></block><blockid="FVLNoise3D"position_x="3.47675308360864"position_y="-12.5615344669995"author="rconstruct"><inputname="P"type="point"storage="varying"value="P"description="Point to sample noise at"><connectionparent="Transform_4"output="Pout"/></input><inputname="scale"type="float"storage="varying"value="10"description="Scale"/><inputname="filterwidth"type="float"storage="varying"value="0.5"description="Filter width"/><inputname="amplitude"type="float"storage="varying"value="0.02"description="Amplitude of noise"/><outputname="value"type="float"storage="varying"description="Noise value at p"/><rsl_code>#define$(blockname)_$(value:type)#ifdef$(blockname)_float$(value)=$(amplitude)*filteredVLNoise($(P),$(filterwidth),$(scale));#else$(value)=$(amplitude)*$(value:type)filteredvsnoise(filteredvsnoise($(P),$(filterwidth))*$(scale)+$(P),$(filterwidth));#endif#undef$(blockname)_$(value:type)</rsl_code><rsl_include>rsl_shrimp_fractal.h</rsl_include><usage>KenMusgrave'sfiltered3dimensionalVariableLacunaritynoisefunction.</usage></block><blockid="Length"position_x="0.744865729517421"position_y="-9.60578787942846"author="rconstruct"><inputname="Vin"type="vector"storage="varying"value="vector(1)"description="Input vector"><connectionparent="Transform_3"output="Pout"/></input><outputname="value"type="float"storage="varying"description="The lenght of the vector"/><rsl_code>$(value)=length($(Vin));</rsl_code><rsl_include/><usage>Returnsthelengthofavector(sqrt(Vin.Vin)).</usage></block><blockid="Mix"position_x="-9.67223382099708"position_y="12.2873884952946"author="rconstruct"><inputname="weight"type="float"storage="varying"value="0.5"description="The mixing factor"><connectionparent="fBm3D"output="value"/></input><inputname="A"type="color"storage="varying"shader_parameter="1"value="0.427451 0.423529 0.360784"description="1st Input"type_parent="value"/><inputname="B"type="color"storage="varying"shader_parameter="1"value="0.52549 0.52549 0.52549"description="2nd Input"type_parent="value"/><outputname="value"type="color"storage="varying"description="The resulting mix between A and B"/><rsl_code>$(value)=mix($(A),$(B),$(weight));</rsl_code><rsl_include/><usage>Mixreturnsx*(1-a)+y*a,thatis,itperformsalinearblendbetweenvaluesAandB.ThetypesofAandBmustbeidentical,butmaybeanyoffloat,point,vector,normal,orcolor.Thevariantsthatoperateoncolorsorpoint-likeobjectsoperateonacomponentbycomponentbasis(e.g:separatelyforx,y,andz).</usage></block><blockid="Mix_2"position_x="-6.01555196898188"position_y="10.7729670221829"author="rconstruct"><inputname="weight"type="float"storage="varying"value="0.5"description="The mixing factor"><connectionparent="Blotches"output="value"/></input><inputname="A"type="color"storage="varying"value="1 0 0"description="1st Input"type_parent="value"><connectionparent="Mix"output="value"/></input><inputname="B"type="color"storage="varying"value="0.329412 0.25098 0.239216"description="2nd Input"type_parent="value"/><outputname="value"type="color"storage="varying"description="The resulting mix between A and B"/><rsl_code>$(value)=mix($(A),$(B),$(weight));</rsl_code><rsl_include/><usage>Mixreturnsx*(1-a)+y*a,thatis,itperformsalinearblendbetweenvaluesAandB.ThetypesofAandBmustbeidentical,butmaybeanyoffloat,point,vector,normal,orcolor.Thevariantsthatoperateoncolorsorpoint-likeobjectsoperateonacomponentbycomponentbasis(e.g:separatelyforx,y,andz).</usage></block><blockid="Multiply"position_x="-4.62702873363927"position_y="9.18509537719837"author="rconstruct"><inputname="A"type="color"storage="varying"value="0 0 0"description="1st input"type_parent="value"/><inputname="B"type="color"storage="varying"multi="*"value="1"description="2nd or subsequent inputs"type_parent="value"><connectionparent="Occlusion"output="Occlusion"/></input><outputname="value"type="color"storage="varying"description="val = A * B"/><rsl_code>$(value)=$(A)*$(B);</rsl_code><rsl_include/><usage>Allinputsmustbeofthesametype.Theoperationisdoneinparallelforeachcomponent.</usage></block><blockid="Multiply_2"position_x="5.40474644112352"position_y="-8.71610744822821"author="rconstruct"><inputname="A"type="normal"storage="varying"value="1"description="1st input"type_parent="value"><connectionparent="Normalize"output="value"/></input><inputname="B"type="normal"storage="varying"multi="*"value="1"description="2nd or subsequent inputs"type_parent="value"><connectionparent="Divide"output="value"/></input><outputname="value"type="normal"storage="varying"description="val = A * B"/><rsl_code>$(value)=$(A)*$(B);</rsl_code><rsl_include/><usage>Allinputsmustbeofthesametype.Theoperationisdoneinparallelforeachcomponent.</usage></block><blockid="N"position_x="-1.33215917533474"position_y="-7.69337257236468"author="rconstruct"><outputname="N"type="normal"storage="varying"description="Surface shading normal"/><rsl_code>$(N)=N;</rsl_code><rsl_include/><usage>Surfaceshadingnormal.Theavailabilityofthisglobalvariableinthedifferentshadingcontextsisrendererspecific.It'snotavailableinimagershaders.</usage></block><blockid="Normal2Point"position_x="7.37375815012524"position_y="-9.93252940482477"author="rconstruct"><inputname="in"type="normal"storage="varying"value="normal(0)"description="Input value"><connectionparent="Multiply_2"output="value"/></input><outputname="value"type="point"storage="varying"description="Output value"/><rsl_code>$(value)=point(comp($(in),0),comp($(in),1),comp($(in),2));</rsl_code><rsl_include/><usage>Setsapointwithanormal'scomponents.</usage></block><blockid="Normalize"position_x="-1.30758725881022"position_y="-8.61517145461467"author="rconstruct"><inputname="Vin"type="vector"storage="varying"value="N"description="Input vector"type_parent="value"><connectionparent="N"output="N"/></input><outputname="value"type="vector"storage="varying"description="Output unit length vector"/><rsl_code>$(value)=normalize($(Vin));</rsl_code><rsl_include/><usage>Returnsaunitvectorinthedirectionofinputvector(Vin/length(Vin)).</usage></block><blockid="Occlusion"position_x="-8.95190167263812"position_y="9.68815945274179"author="rconstruct"><inputname="P"type="point"storage="varying"value="P"description="Surface point"/><inputname="direction"type="normal"storage="varying"value="faceforward( normalize(N), normalize(I))"description="Direction"/><inputname="adaptive"type="float"storage="uniform"value="1"description="Turns adaptive sampling on/off"/><inputname="minsamples"type="float"storage="uniform"value="16"description="Minimum number of samples to use"/><inputname="samples"type="float"storage="varying"shader_parameter="1"value="32"description="Samples"/><inputname="samplebase"type="float"storage="uniform"value="1"description="Controls ray origin jittering"/><inputname="maxdist"type="float"storage="uniform"value="1e38"description="Maximum distance"/><inputname="maxpixeldist"type="float"storage="varying"value="-1"description="Maximum samples distance"/><inputname="maxsolidang"type="float"storage="uniform"value="0.05"description="Maximum solid angle, in steradians"/><inputname="maxerror"type="float"storage="varying"value="-1"description="Quality vs speed"/><inputname="bias"type="float"storage="varying"value="0.01"description="Bias to control self-intersection"/><inputname="coneangle"type="float"storage="uniform"value="1.570796327"description="Cone angle"/><inputname="axis"type="vector"storage="uniform"value="vector(0)"description="Direction of light casting hemisphere"/><inputname="distribution"type="string"storage="uniform"value=""cosine""description="Distribution"/><inputname="hitsides"type="string"storage="uniform"value=""front""description="Side of surface to consider by a ray hit"/><inputname="hitmode"type="string"storage="uniform"value=""default""description="Ray hit mode"/><inputname="label"type="string"storage="uniform"value=""""description="Ray lavel"/><inputname="subset"type="string"storage="uniform"value=""""description="Objects subset considered"/><inputname="envmap"type="string"storage="uniform"value=""""description="Environment map"/><inputname="envspace"type="string"storage="uniform"value=""world""description="Environment space"/><inputname="occlmap"type="string"storage="uniform"shader_parameter="1"value=""""description="Occlusion map"/><inputname="blur"type="float"storage="varying"shader_parameter="1"value="0"description="Shadow map blur"/><inputname="useptc"type="float"storage="uniform"value="0"description="Toggle point based occlusion"/><inputname="ptcfile"type="string"storage="uniform"value=""""description="Point cloud filename"/><inputname="coordsys"type="string"storage="uniform"value=""world""description="Point cloud coordinate system"/><inputname="clamp"type="float"storage="uniform"value="0"description="Clamp excessive occlusion"/><inputname="sortbleeding"type="float"storage="uniform"value="0"description="Sort bleeding"/><inputname="falloffmode"type="float"storage="uniform"value="0"description="Falloff mode, exponential or polynomial"/><inputname="falloff"type="float"storage="uniform"value="0"description="Falloff, 1 = linear"/><outputname="Occlusion"type="float"storage="varying"description="Occlusion value"/><outputname="Envcolor"type="color"storage="varying"description="Environment color lookup result"/><outputname="Envdirection"type="vector"storage="varying"description="Average unoccluded direction"/><outputname="Irradiance"type="color"storage="varying"description="Irradiance"/><rsl_code>/* initialize */$(Envcolor)=color(0);$(Envdirection)=vector(0);$(Irradiance)=color(0);/* make sure options are clear *//* and set them according to shadeop and renderer */#ifdefSHADEOP_ARGUMENTS#undefSHADEOP_ARGUMENTS#endif/* SHADEOP_ARGUMENTS */#ifRENDERER==_3delight#defineSHADEOP_ARGUMENTS"label",$(label),"subset",$(subset),\
"bias",$(bias),"hitmode",$(hitmode),\
"coneangle",$(coneangle),"axis",$(axis),\
"samplebase",$(samplebase),\
"maxdist",$(maxdist),\
"environmentmap",$(envmap),\
"environmentspace",$(envspace),\
"distribution",$(distribution),\
"environmentcolor",$(Envcolor),\
"environmentdir",$(Envdirection),\
"adaptive",$(adaptive),\
"minsamples",$(minsamples),\
"falloffmode",$(falloffmode),\
"falloff",$(falloff),"pointbased",$(useptc),\
"filename",$(ptcfile),"hitsides",$(hitsides),\
"maxsolidangle",$(maxsolidang),\
"clamp",$(clamp),\
"sortbleeding",$(sortbleeding),\
"coordsystem",$(coordsys)#elifRENDERER==pixie#defineSHADEOP_ARGUMENTS"coordsystem",$(coordsys),\
"maxdist",$(maxdist),\
"coneangle",$(coneangle),\
"samplebase",$(samplebase),\
"label",$(label),"bias",$(bias),\
"maxerror",$(maxerror),\
"pointbased",$(useptc),\
"environmentmap",$(envmap),\
"filename",$(ptcfile),\
"maxpixeldist",$(maxpixeldist),\
"maxsolidangle",$(maxsolidang),\
"environmentcolor",$(Envcolor)#elifRENDERER==prman#defineSHADEOP_ARGUMENTS"adaptive",$(adaptive),\
"minsamples",$(minsamples),\
"coordsystem",$(coordsys),\
"distribution",$(distribution),\
"maxdist",$(maxdist),\
"coneangle",$(coneangle),\
"samplebase",$(samplebase),\
"hitmode",$(hitmode),\
"hitsides",$(hitsides),"subset",$(subset),\
"label",$(label),\
"environmentmap",$(envmap),\
"environmentspace",$(envspace),\
"bias",$(bias),\
"maxpixeldist",$(maxpixeldist),\
"maxerror",$(maxerror),\
"falloffmode",$(falloffmode),\
"falloff",$(falloff),"pointbased",$(useptc),\
"filename",$(ptcfile),\
"maxsolidangle",$(maxsolidang),\
"clamp",$(clamp),\
"environmentcolor",$(Envcolor),\
"environmentdir",$(Envdirection)#elifRENDERER==air#defineSHADEOP_ARGUMENTS"bias",$(bias),"label",$(label),\
"maxdist",$(maxdist),\
"maxerror",$(maxerror),\
"maxpixeldist",$(maxpixeldist),\
"samples",$(samples),"subset",$(subset)#elifRENDERER==aqsis#defineSHADEOP_ARGUMENTS"blur",$(blur),"bias",$(bias)#else/* entropy, bmrt, renderdotc? */#endif/* RENDERER *//* different order of arguments */#ifRENDERER==_3delight||RENDERER==pixie||RENDERER==prmanaov_occlusion+=occlusion($(P),$(direction),$(samples),SHADEOP_ARGUMENTS);$(Occlusion)=1-aov_occlusion;#elifRENDERER==air/* shadow map based, unless map = "raytrace" */aov_occlusion+=occlusion($(occlmap),$(P),$(direction),$(angle),SHADEOP_ARGUMENTS);$(Occlusion)=1-aov_occlusion;#elifRENDERER==aqsis/* shadow map based occlusion */aov_occlusion+=occlusion($(occlmap),$(P),$(direction),$(samples),SHADEOP_ARGUMENTS);$(Occlusion)=1-aov_occlusion;#else/* entropy, bmrt, renderdotc? */$(Occlusion)=0;#endif/* RENDERER */</rsl_code><rsl_include/><usage>Thisfunctionreturnstheambientocclusion,andoptionallyenvironmentcolor,environmentdirectionandindirectlighting.Thisfunction'sargumentsvarywitheachrenderer'simplementation,somakesuretoconsultyourrenderer'sdocumentation.Thisblockprovidedthefollowingarguments:"coneangle",defaultstoPI/2;"distribution",canbe"cosine"or"uniform",defaultsto"cosine".Thisfunctioncanuseanoptionalenvironmentmaptousewhenraysdon'thitthegeometry,andcanalsoreturntheenvironmentdirectionvector,theaverageoftheunoccludeddirection.Notethatyoucanuseeitherthesurfacenormal,orthereflectionvector,forthe"indir"variable,inwhichcasethefunctionwilloutputambientocclusionorreflectionocclusionrespectively.Youcanalsousepoint-basedocclusion,orAqsis'simplementationwhichusesmultipleshadowmaps.Notethatthisfunctionvariesconsiderablyfromimplementationtoimplementation,sopleaseconsultyourrenderer'sdocumentationfordetails.Theocclusionvalueispassedtoaov_occlusionAOVpreset,asocclusion,not1-occlusion.</usage></block><blockid="Reflect"position_x="-6.82777789086767"position_y="8.14616336923085"author="rconstruct"><inputname="I"type="vector"storage="varying"value="normalize(I)"description="Incident vector"/><inputname="N"type="normal"storage="varying"value="normalize(N)"description="Surface normal"/><outputname="R"type="vector"storage="varying"description="The reflected vector"/><rsl_code>$(R)=reflect($(I),$(N));</rsl_code><rsl_include/><usage>Returnsthevector"I"reflectedabouttheunitlengthnormal"N".It'sequivalentto:I-2*(N.I)*N.</usage></block><blockid="Reflection"position_x="-4.56355935107525"position_y="4.87489273515378"author="rconstruct"><inputname="texmap"type="string"storage="uniform"shader_parameter="1"value=""raytrace""description="Texture map name"/><inputname="Kr"type="float"storage="varying"shader_parameter="1"value="0.2"description="Environment intensity"/><inputname="direction"type="vector"storage="varying"value="reflect( I, normalize(N))"description="Direction vector"><connectionparent="Transform"output="Pout"/></input><inputname="sblur"type="float"storage="varying"value="0"description="Blur along S"/><inputname="tblur"type="float"storage="varying"value="0"description="Blur along T"/><inputname="swidth"type="float"storage="uniform"value="1"description="Blur filter width along S"/><inputname="twidth"type="float"storage="uniform"value="1"description="Blur filter width along T"/><inputname="samples"type="float"storage="uniform"shader_parameter="1"value="4"description="Sampling rate"/><inputname="fill"type="float"storage="uniform"value="0"description="Fill value on empty channel"/><inputname="filter"type="string"storage="uniform"value=""gaussian""description="Filter type"/><inputname="channel"type="float"storage="varying"value="0"description="Channel, in color textures"/><inputname="tint"type="color"storage="varying"value="1"description="Color tint for the environment"type_parent="value"/><inputname="label"type="string"storage="uniform"value=""""description="Ray label"/><inputname="subset"type="string"storage="uniform"value=""""description="Ray subset"/><inputname="bias"type="float"storage="uniform"value="-1"description="Ray bias"/><inputname="hitmode"type="string"storage="uniform"value=""default""description="Override hitmode"/><inputname="maxdist"type="float"storage="varying"value="1e38"description="Maximum ray distance"/><inputname="coneangle"type="float"storage="varying"value="radians(5)"description="Cone angle"/><inputname="expandLDR"type="float"storage="uniform"value="0"description="Expand range of LDR image"/><inputname="dynrange"type="float"storage="varying"value="1"description="Maximum value to expand range to"/><inputname="startlum"type="float"storage="varying"value="0.5"description="Starting luminance for expansion"/><inputname="exponent"type="float"storage="varying"value="2.0"description="Range exponent for falloff"/><outputname="value"type="color"storage="varying"description="Output color"/><rsl_code>/* make sure options are clear and set them according to shadeop * and renderer */#ifdefSHADEOP_ARGUMENTS#undefSHADEOP_ARGUMENTS#endif#ifRENDERER==pixie#defineSHADEOP_ARGUMENTS"filter",$(filter),\
/* can't specify s/tblur */\
"blur",$(sblur),\
"swidth",$(swidth),"twidth",$(twidth),\
"fill",$(fill),"samples",$(samples),\
"bias",$(bias),"maxdist",$(maxdist),\
"samplecone",$(coneangle),"label",$(label)#elifRENDERER==_3delight#defineSHADEOP_ARGUMENTS"sblur",$(sblur),"tblur",$(tblur),\
"swidth",$(swidth),"twidth",$(twidth),\
"samples",$(samples),"fill",$(fill),\
"filter",$(filter),"label",$(label),\
"subset",$(subset),"bias",$(bias),\
"hitmode",$(hitmode),\
"maxdist",$(maxdist)#elifRENDERER==air#defineSHADEOP_ARGUMENTS"bias",$(bias),\
/* can't specify s/blur */\
"blur",$(sblur),"label",$(label),\
"maxdist",$(maxdist),\
"samples",$(samples),\
"subset",$(subset)#else#defineSHADEOP_ARGUMENTS"sblur",$(sblur),"tblur",$(tblur),\
"swidth",$(swidth),"twidth",$(twidth),\
"samples",$(samples),\
"filter",$(filter),\
"fill",$(fill)#endif/* RENDERER */// LDR expansion, from SIGGRAPH 2002 Course 16,// "Production Ready GI", by Hayden Landis#define$(blockname)_expandLDR$(expandLDR)#if$(blockname)_expandLDR==1varying$(value:type)$(blockname)_ctmp=$(Kr)*$(tint)*$(value:type)environment($(texmap)[$(channel)],$(direction),SHADEOP_ARGUMENTS);$(value)=envexpand($(blockname)_ctmp,$(dynrange),$(startlum),$(exponent));#else// no expansion// tint is of float type if output variable is of float type$(value)=$(Kr)*$(tint)*$(value:type)environment($(texmap)[$(channel)],$(direction),SHADEOP_ARGUMENTS);#endif// expandLDRaov_reflection+=$(value);#undef$(blockname)_expandLDR#undefSHADEOP_ARGUMENTS</rsl_code><rsl_include>rsl_shrimp_texture.h</rsl_include><usage>Thisblockreturnsthetexturevaluefromanenvironmentmap,forthespecifieddirectionvector.Ifthefilenamespecifiedis"raytrace"thenraytracingisusedinsteadofatexturemap.Thevariables"sblur"and"tblur"specifythebluralongthe"S"and"T"directionsrespectively,while"swidth"and"twidth"specifythefilterwidthalongthe"S"and"T"directionsrespectively.Thefiltertypecanbe"box","triangle",or"gaussian",with"samples"controlingthenumberofsamplestouse.Thestartingchannelisspecifiedwiththe"channel"parameter.Thetypereturnedcanbefloat,orcolor,anditispassedtothepreset"aov_reflection"AOV.Whenraytracingisused,extraparametersavailabletoraytracingfunctionsareavailable,suchas"label","subset","bias"and"hitmode".Notethatthisfunctionmightvaryconsiderablywitheachrenderer,sopleasecheckyourrenderer'sdocumentation.ThisblockalsoimplementstheLDRexpansionfromSIGGRAPH2002Course16,"ProductionReadyGI",byHaydenLandis,toavoidwashedoutreflectionhighlightswhenusingLowDynamicRangeimagesforreflectionmaps.Whentoggling"expandLDR"on/off,thefollowingvariablesapplytocontroltheexpansion:"dynrange",definesthemaximumvaluetoexpandthespecifiedregionofthemapto;"startlum",definesthestartingluminancefortheexpansiontobeginwith;"exponent",definestheexponentforthefalloff.</usage></block><blockid="Refract"position_x="-6.88379873785944"position_y="6.99213392120089"author="rconstruct"><inputname="I"type="vector"storage="varying"value="normalize(I)"description="Incident vector"/><inputname="N"type="normal"storage="varying"value="normalize(N)"description="Surface normal"/><inputname="eta"type="float"storage="varying"shader_parameter="1"value="0.01"description="The ratio of medium IORs, see usage."/><outputname="T"type="vector"storage="varying"description="The refracted vector"/><rsl_code>$(T)=refract($(I),$(N),$(eta));</rsl_code><rsl_include/><usage>Returntherefractedvector"T"givenanincidentdirection"I",thenormalvector"N",andtherelativeindexofrefraction"eta".Etaistheratiooftheindexofrefractioninthevolumecontainingtheincidentvector,tothatofthevolumebeingentered.Ifthereturnedvectorhaszerolength,thenthereisnotransmittedlightbecauseoftotalinternalreflrection.</usage></block><blockid="Refraction"position_x="-2.05613976427317"position_y="4.79506330496946"author="rconstruct"><inputname="texmap"type="string"storage="uniform"shader_parameter="1"value=""raytrace""description="Texture map name"/><inputname="Kr"type="float"storage="varying"shader_parameter="1"value="0.0"description="Environment intensity"/><inputname="direction"type="vector"storage="varying"value="reflect( I, normalize(N))"description="Direction vector"><connectionparent="Transform_2"output="Pout"/></input><inputname="sblur"type="float"storage="varying"value="0"description="Blur along S"/><inputname="tblur"type="float"storage="varying"value="0"description="Blur along T"/><inputname="swidth"type="float"storage="uniform"value="1"description="Blur filter width along S"/><inputname="twidth"type="float"storage="uniform"value="1"description="Blur filter width along T"/><inputname="samples"type="float"storage="uniform"shader_parameter="1"value="4"description="Sampling rate"/><inputname="fill"type="float"storage="uniform"value="0"description="Fill value on empty channel"/><inputname="filter"type="string"storage="uniform"value=""gaussian""description="Filter type"/><inputname="channel"type="float"storage="varying"value="0"description="Channel, in color textures"/><inputname="tint"type="color"storage="varying"value="1"description="Color tint for the environment"type_parent="value"/><inputname="label"type="string"storage="uniform"value=""""description="Ray label"/><inputname="subset"type="string"storage="uniform"value=""""description="Ray subset"/><inputname="bias"type="float"storage="uniform"value="-1"description="Ray bias"/><inputname="hitmode"type="string"storage="uniform"value=""default""description="Override hitmode"/><inputname="maxdist"type="float"storage="varying"value="1e38"description="Maximum ray distance"/><inputname="coneangle"type="float"storage="varying"value="radians(5)"description="Cone angle"/><inputname="expandLDR"type="float"storage="uniform"value="0"description="Expand range of LDR image"/><inputname="dynrange"type="float"storage="varying"value="1"description="Maximum value to expand range to"/><inputname="startlum"type="float"storage="varying"value="0.5"description="Starting luminance for expansion"/><inputname="exponent"type="float"storage="varying"value="2.0"description="Range exponent for falloff"/><outputname="value"type="color"storage="varying"description="Output color"/><rsl_code>/* make sure options are clear and set them according to shadeop * and renderer */#ifdefSHADEOP_ARGUMENTS#undefSHADEOP_ARGUMENTS#endif#ifRENDERER==pixie#defineSHADEOP_ARGUMENTS"filter",$(filter),\
/* can't specify s/tblur */\
"blur",$(sblur),\
"swidth",$(swidth),"twidth",$(twidth),\
"fill",$(fill),"samples",$(samples),\
"bias",$(bias),"maxdist",$(maxdist),\
"samplecone",$(coneangle),"label",$(label)#elifRENDERER==_3delight#defineSHADEOP_ARGUMENTS"sblur",$(sblur),"tblur",$(tblur),\
"swidth",$(swidth),"twidth",$(twidth),\
"samples",$(samples),"fill",$(fill),\
"filter",$(filter),"label",$(label),\
"subset",$(subset),"bias",$(bias),\
"hitmode",$(hitmode),\
"maxdist",$(maxdist)#elifRENDERER==air#defineSHADEOP_ARGUMENTS"bias",$(bias),\
/* can't specify s/blur */\
"blur",$(sblur),"label",$(label),\
"maxdist",$(maxdist),\
"samples",$(samples),\
"subset",$(subset)#else#defineSHADEOP_ARGUMENTS"sblur",$(sblur),"tblur",$(tblur),\
"swidth",$(swidth),"twidth",$(twidth),\
"samples",$(samples),\
"filter",$(filter),\
"fill",$(fill)#endif/* RENDERER */// LDR expansion, from SIGGRAPH 2002 Course 16,// "Production Ready GI", by Hayden Landis#define$(blockname)_expandLDR$(expandLDR)#if$(blockname)_expandLDR==1varying$(value:type)$(blockname)_ctmp=$(Kr)*$(tint)*$(value:type)environment($(texmap)[$(channel)],$(direction),SHADEOP_ARGUMENTS);$(value)=envexpand($(blockname)_ctmp,$(dynrange),$(startlum),$(exponent));#else// no expansion// tint is of float type if output variable is of float type$(value)=$(Kr)*$(tint)*$(value:type)environment($(texmap)[$(channel)],$(direction),SHADEOP_ARGUMENTS);#endif// expandLDRaov_refraction+=$(value);#undef$(blockname)_expandLDR#undefSHADEOP_ARGUMENTS</rsl_code><rsl_include>rsl_shrimp_texture.h</rsl_include><usage>Thisblockreturnsthetexturevaluefromanenvironmentmap,forthespecifieddirectionvector.Ifthefilenamespecifiedis"raytrace"thenraytracingisusedinsteadofatexturemap.Thevariables"sblur"and"tblur"specifythebluralongthe"S"and"T"directionsrespectively,while"swidth"and"twidth"specifythefilterwidthalongthe"S"and"T"directionsrespectively.Thefiltertypecanbe"box","triangle",or"gaussian",with"samples"controlingthenumberofsamplestouse.Thestartingchannelisspecifiedwiththe"channel"parameter.Thetypereturnedcanbefloat,orcolor,anditispassedtothepreset"aov_reflection"AOV.Whenraytracingisused,extraparametersavailabletoraytracingfunctionsareavailable,suchas"label","subset","bias"and"hitmode".Notethatthisfunctionmightvaryconsiderablywitheachrenderer,sopleasecheckyourrenderer'sdocumentation.ThisblockalsoimplementstheLDRexpansionfromSIGGRAPH2002Course16,"ProductionReadyGI",byHaydenLandis,toavoidwashedoutreflectionhighlightswhenusingLowDynamicRangeimagesforreflectionmaps.Whentoggling"expandLDR"on/off,thefollowingvariablesapplytocontroltheexpansion:"dynrange",definesthemaximumvaluetoexpandthespecifiedregionofthemapto;"startlum",definesthestartingluminancefortheexpansiontobeginwith;"exponent",definestheexponentforthefalloff.</usage></block><blockid="Root block"position_x="15.1407734288959"position_y="7.80349257437263"author=""root="RIB"AOV_preview="1"><rib_statements>Attribute"visibility""inttransmission"[1]
$(Cl)=sig2kshadowspot($(intensity),$(lightcolor),$(position),
$(target),radians($(coneangle)),
radians($(conedelta)),$(beam),$(samples),
$(bias),$(width),$(shadowmap),$(filter),
$(blur),$(attenuation),
$(blockname)_inshadow);
__shadow=$(blockname)_inshadow;
</rsl_code><rsl_include>rsl_shrimp_lights.h</rsl_include><usage>Modifiedshadowspotlightshader,byTalLancaster,fromTheRenderManrepository(www.renderman.org).Modifiedtobetterhandleatenuation.Biasoverridestheglobalshadowbiasvalue,with-1beingtheglobaldefault,andblur,theamounttosoftentheshadowedges.Shadowmapfiltertypedefaultsto"gaussian",with"triangle"and"box"asoptional.</usage></block><blockid="Specular"position_x="-1.51183650002167"position_y="7.78547169161427"author="rconstruct"><inputname="Cspec"type="color"storage="varying"value="color(1)"description="Specular color"/><inputname="Ks"type="float"storage="varying"shader_parameter="1"value="0.6"description="Specular coefficient"/><inputname="N"type="normal"storage="varying"value="normalize(N)"description="The surface normal"/><inputname="V"type="vector"storage="varying"value="-normalize(I)"description="The viewer vector"/><inputname="roughness"type="float"storage="varying"value="0.3"description="The specular roughness"/><outputname="Ci"type="color"storage="varying"description="The amount of diffuse light"/><rsl_code>aov_specularcolor+=$(Cspec);
aov_specular+=$(Ks)*specular($(N),$(V),$(roughness));
$(Ci)=aov_specularcolor*aov_specular;
</rsl_code><rsl_include/><usage>Specularterm,usingthe"specular"function.Notethatwhatisastandard"specular"mightvarywiththerendereryou'reusing.Thespecularcolorvalueispassedto"aov_specularcolor",whilethespecularvalueispassedtothe"aov_specular"AOVpresets.</usage></block><blockid="Transform"position_x="-6.92961822072261"position_y="5.57259145540494"author="rconstruct"><inputname="P"type="vector"storage="varying"value="P"description="Point, vector or normal to transform"type_parent="Pout"><connectionparent="Reflect"output="R"/></input><inputname="from_space"type="string"storage="uniform"value=""current""description="The coordinate system to transform from"/><inputname="to_space"type="string"storage="uniform"value=""world""description="The coordinate system to transform into"/><inputname="Matrix"type="matrix"storage="varying"value="UND"description="Use this matrix instead of a predefined coordinate system"/><outputname="Pout"type="vector"storage="varying"description="The transformed point, vector or normal"/><rsl_code>
#ifdefTRANSFORM_ARGUMENTS
#undefTRANSFORM_ARGUMENTS
#endif
#defineMatrix_$(Matrix)
#ifdefMatrix_UND
#defineTRANSFORM_ARGUMENTS$(to_space)
#else
#defineTRANSFORM_ARGUMENTS$(Matrix)
#endif/*Matrix_UND*/
#define$(blockname)_$(P:type)1
#ifdef$(blockname)_point
$(Pout)=transform($(from_space),TRANSFORM_ARGUMENTS,$(P));
#elif$(blockname)_vector
$(Pout)=vtransform($(from_space),TRANSFORM_ARGUMENTS,$(P));
#elif$(blockname)_normal
$(Pout)=ntransform($(from_space),TRANSFORM_ARGUMENTS,$(P));
#endif/*$(blockname)_$(P:type)*/
#undef$(blockname)_$(P:type)
#undefMatrix_$(Matrix)
#undefTRANSFORM_ARGUMENTS
</rsl_code><rsl_include>rsl_shrimp_helpers.h</rsl_include><usage>Ablockforthe"transform","vtransform"and"ntransform"functions,totransformthesuppliedpoint"P",vector"V"ornormal"N"respectively,fromthecoordinatesystem"fromspace"tothecoordinatesystem"tospace",with"fromspace"defaultingto"current".Notethat"current"isimplementationspecific.Predefinedcoordinatesystemsare:"current","object","shader","world","camera","screen","raster"and"NDC".Atransformationmatrixmightbegiveninsteadofa"tospace"coordinatesystem.Userdefinedcoordinatesystemscanalsobereferedto.</usage></block><blockid="Transform_2"position_x="-6.92004661492154"position_y="3.68270799629759"author="rconstruct"><inputname="P"type="vector"storage="varying"value="P"description="Point, vector or normal to transform"type_parent="Pout"><connectionparent="Refract"output="T"/></input><inputname="from_space"type="string"storage="uniform"value=""current""description="The coordinate system to transform from"/><inputname="to_space"type="string"storage="uniform"value=""world""description="The coordinate system to transform into"/><inputname="Matrix"type="matrix"storage="varying"value="UND"description="Use this matrix instead of a predefined coordinate system"/><outputname="Pout"type="vector"storage="varying"description="The transformed point, vector or normal"/><rsl_code>
#ifdefTRANSFORM_ARGUMENTS
#undefTRANSFORM_ARGUMENTS
#endif
#defineMatrix_$(Matrix)
#ifdefMatrix_UND
#defineTRANSFORM_ARGUMENTS$(to_space)
#else
#defineTRANSFORM_ARGUMENTS$(Matrix)
#endif/*Matrix_UND*/
#define$(blockname)_$(P:type)1
#ifdef$(blockname)_point
$(Pout)=transform($(from_space),TRANSFORM_ARGUMENTS,$(P));
#elif$(blockname)_vector
$(Pout)=vtransform($(from_space),TRANSFORM_ARGUMENTS,$(P));
#elif$(blockname)_normal
$(Pout)=ntransform($(from_space),TRANSFORM_ARGUMENTS,$(P));
#endif/*$(blockname)_$(P:type)*/
#undef$(blockname)_$(P:type)
#undefMatrix_$(Matrix)
#undefTRANSFORM_ARGUMENTS
</rsl_code><rsl_include>rsl_shrimp_helpers.h</rsl_include><usage>Ablockforthe"transform","vtransform"and"ntransform"functions,totransformthesuppliedpoint"P",vector"V"ornormal"N"respectively,fromthecoordinatesystem"fromspace"tothecoordinatesystem"tospace",with"fromspace"defaultingto"current".Notethat"current"isimplementationspecific.Predefinedcoordinatesystemsare:"current","object","shader","world","camera","screen","raster"and"NDC".Atransformationmatrixmightbegiveninsteadofa"tospace"coordinatesystem.Userdefinedcoordinatesystemscanalsobereferedto.</usage></block><blockid="Transform_3"position_x="-1.33464471210431"position_y="-9.4857573557603"author="rconstruct"><inputname="P"type="vector"storage="varying"value="P"description="Point, vector or normal to transform"type_parent="Pout"><connectionparent="Normalize"output="value"/></input><inputname="from_space"type="string"storage="uniform"value=""current""description="The coordinate system to transform from"/><inputname="to_space"type="string"storage="uniform"value=""shader""description="The coordinate system to transform into"/><inputname="Matrix"type="matrix"storage="varying"value="UND"description="Use this matrix instead of a predefined coordinate system"/><outputname="Pout"type="vector"storage="varying"description="The transformed point, vector or normal"/><rsl_code>
#ifdefTRANSFORM_ARGUMENTS
#undefTRANSFORM_ARGUMENTS
#endif
#defineMatrix_$(Matrix)
#ifdefMatrix_UND
#defineTRANSFORM_ARGUMENTS$(to_space)
#else
#defineTRANSFORM_ARGUMENTS$(Matrix)
#endif/*Matrix_UND*/
#define$(blockname)_$(P:type)1
#ifdef$(blockname)_point
$(Pout)=transform($(from_space),TRANSFORM_ARGUMENTS,$(P));
#elif$(blockname)_vector
$(Pout)=vtransform($(from_space),TRANSFORM_ARGUMENTS,$(P));
#elif$(blockname)_normal
$(Pout)=ntransform($(from_space),TRANSFORM_ARGUMENTS,$(P));
#endif/*$(blockname)_$(P:type)*/
#undef$(blockname)_$(P:type)
#undefMatrix_$(Matrix)
#undefTRANSFORM_ARGUMENTS
</rsl_code><rsl_include>rsl_shrimp_helpers.h</rsl_include><usage>Ablockforthe"transform","vtransform"and"ntransform"functions,totransformthesuppliedpoint"P",vector"V"ornormal"N"respectively,fromthecoordinatesystem"fromspace"tothecoordinatesystem"tospace",with"fromspace"defaultingto"current".Notethat"current"isimplementationspecific.Predefinedcoordinatesystemsare:"current","object","shader","world","camera","screen","raster"and"NDC".Atransformationmatrixmightbegiveninsteadofa"tospace"coordinatesystem.Userdefinedcoordinatesystemscanalsobereferedto.</usage></block><blockid="Transform_4"position_x="-1.45793348991167"position_y="-11.4525271710207"author="rconstruct"><inputname="P"type="point"storage="varying"value="P"description="Point, vector or normal to transform"type_parent="Pout"><connectionparent="p"output="P"/></input><inputname="from_space"type="string"storage="uniform"value=""current""description="The coordinate system to transform from"/><inputname="to_space"type="string"storage="uniform"value=""shader""description="The coordinate system to transform into"/><inputname="Matrix"type="matrix"storage="varying"value="UND"description="Use this matrix instead of a predefined coordinate system"/><outputname="Pout"type="point"storage="varying"description="The transformed point, vector or normal"/><rsl_code>
#ifdefTRANSFORM_ARGUMENTS
#undefTRANSFORM_ARGUMENTS
#endif
#defineMatrix_$(Matrix)
#ifdefMatrix_UND
#defineTRANSFORM_ARGUMENTS$(to_space)
#else
#defineTRANSFORM_ARGUMENTS$(Matrix)
#endif/*Matrix_UND*/
#define$(blockname)_$(P:type)1
#ifdef$(blockname)_point
$(Pout)=transform($(from_space),TRANSFORM_ARGUMENTS,$(P));
#elif$(blockname)_vector
$(Pout)=vtransform($(from_space),TRANSFORM_ARGUMENTS,$(P));
#elif$(blockname)_normal
$(Pout)=ntransform($(from_space),TRANSFORM_ARGUMENTS,$(P));
#endif/*$(blockname)_$(P:type)*/
#undef$(blockname)_$(P:type)
#undefMatrix_$(Matrix)
#undefTRANSFORM_ARGUMENTS
</rsl_code><rsl_include>rsl_shrimp_helpers.h</rsl_include><usage>Ablockforthe"transform","vtransform"and"ntransform"functions,totransformthesuppliedpoint"P",vector"V"ornormal"N"respectively,fromthecoordinatesystem"fromspace"tothecoordinatesystem"tospace",with"fromspace"defaultingto"current".Notethat"current"isimplementationspecific.Predefinedcoordinatesystemsare:"current","object","shader","world","camera","screen","raster"and"NDC".Atransformationmatrixmightbegiveninsteadofa"tospace"coordinatesystem.Userdefinedcoordinatesystemscanalsobereferedto.</usage></block><blockid="Transform_5"position_x="-16.6089768123772"position_y="14.8901902324099"author="rconstruct"><inputname="P"type="point"storage="varying"value="P"description="Point, vector or normal to transform"type_parent="Pout"><connectionparent="p_2"output="P"/></input><inputname="from_space"type="string"storage="uniform"value=""current""description="The coordinate system to transform from"/><inputname="to_space"type="string"storage="uniform"value=""shader""description="The coordinate system to transform into"/><inputname="Matrix"type="matrix"storage="varying"value="UND"description="Use this matrix instead of a predefined coordinate system"/><outputname="Pout"type="point"storage="varying"description="The transformed point, vector or normal"/><rsl_code>
#ifdefTRANSFORM_ARGUMENTS
#undefTRANSFORM_ARGUMENTS
#endif
#defineMatrix_$(Matrix)
#ifdefMatrix_UND
#defineTRANSFORM_ARGUMENTS$(to_space)
#else
#defineTRANSFORM_ARGUMENTS$(Matrix)
#endif/*Matrix_UND*/
#define$(blockname)_$(P:type)1
#ifdef$(blockname)_point
$(Pout)=transform($(from_space),TRANSFORM_ARGUMENTS,$(P));
#elif$(blockname)_vector
$(Pout)=vtransform($(from_space),TRANSFORM_ARGUMENTS,$(P));
#elif$(blockname)_normal
$(Pout)=ntransform($(from_space),TRANSFORM_ARGUMENTS,$(P));
#endif/*$(blockname)_$(P:type)*/
#undef$(blockname)_$(P:type)
#undefMatrix_$(Matrix)
#undefTRANSFORM_ARGUMENTS
</rsl_code><rsl_include>rsl_shrimp_helpers.h</rsl_include><usage>Ablockforthe"transform","vtransform"and"ntransform"functions,totransformthesuppliedpoint"P",vector"V"ornormal"N"respectively,fromthecoordinatesystem"fromspace"tothecoordinatesystem"tospace",with"fromspace"defaultingto"current".Notethat"current"isimplementationspecific.Predefinedcoordinatesystemsare:"current","object","shader","world","camera","screen","raster"and"NDC".Atransformationmatrixmightbegiveninsteadofa"tospace"coordinatesystem.Userdefinedcoordinatesystemscanalsobereferedto.</usage></block><blockid="Turbulence3D"position_x="-10.4459619959313"position_y="16.8423634826136"author="rconstruct"><inputname="P"type="point"storage="varying"value="P"description="Point to sample turbulence at"><connectionparent="Transform_5"output="Pout"/></input><inputname="filterwidth"type="float"storage="varying"value="0"description="Filter width for antialiasing"/><inputname="octaves"type="float"storage="uniform"shader_parameter="1"value="7"description="Maximum octaves of noise"/><inputname="lacunarity"type="float"storage="varying"value="2.3"description="Gap in successive frequencies"/><inputname="gain"type="float"storage="varying"shader_parameter="1"value="0.5"description="Controls the contrast of the turbulence"/><inputname="amplitude"type="float"storage="varying"shader_parameter="1"value="0.6"description="Amplitude of turbulence"/><outputname="value"type="float"storage="varying"description="Turbulence value at p"/><rsl_code>
#define$(blockname)_$(value:type)
#ifdef$(blockname)_float
$(value)=$(amplitude)*turbulence($(P),$(filterwidth),$(octaves),
$(lacunarity),$(gain));
#else
$(value)=$(amplitude)*$(value:type)(vectorvturbulence($(P),
$(filterwidth),$(octaves),$(lacunarity),$(gain)));
#endif
#undef$(blockname)_$(value:type)
</rsl_code><rsl_include>rsl_shrimp_fractal.h</rsl_include><usage>3dimensionalturbulencefractalfunctionwithPerlinnoisebasis.Returnsaresultinthe[0,1]rangebydefault.</usage></block><blockid="WardAniso"position_x="-3.47132567509478"position_y="15.241089040673"author="rconstruct"><inputname="Cspec"type="color"storage="varying"shader_parameter="1"value="color(1)"description="Specular color"/><inputname="Ks"type="float"storage="varying"shader_parameter="1"value="0.1"description="Specular light coefficient"/><inputname="uroughness"type="float"storage="varying"shader_parameter="1"value="0.1"description="The apparent roughness of the surface in xdir."><connectionparent="Turbulence3D"output="value"/></input><inputname="vroughness"type="float"storage="varying"shader_parameter="1"value="0.8"description="The apparent roughness of the surface in a tangent perpendicular to xdir"/><inputname="direction"type="vector"storage="varying"value="normalize(dPdv)"description="Anisotropy direction"/><inputname="N"type="normal"storage="varying"value="normalize(N)"description="Surface normal"/><inputname="I"type="vector"storage="varying"value="normalize(I)"description="Direction of viewer"/><inputname="category"type="string"storage="uniform"value=""""description="Light categories accepted"/><outputname="Ci"type="color"storage="varying"description="Shaded color"/><rsl_code>aov_specularcolor+=$(Cspec);
aov_specular+=$(Ks)*LocIllumWardAnisotropic($(N),$(I),
$(direction),$(uroughness),$(vroughness),
$(category));
$(Ci)=aov_specularcolor*aov_specular;
</rsl_code><rsl_include>rsl_shadingmodels.h</rsl_include><usage>GregoryJ.Ward'sanisotropicspecularterm."Uroughness"and"vroughness"controltheapparentsurfaceroughnessintheanisotropyXandYdirectionsrespectively,beingthedefaultdirection"dPdv"asdefinedin"direction".Thespecularcolorvalueispassedto"aov_specularcolor",whilethespecularvalueispassedtothe"aov_specular"AOVpresets.The"category"variabledefinesthelightcategoriesusedforthe"illuminance"constructofthisblock.</usage></block><blockid="fBm3D"position_x="-12.9217956637406"position_y="13.6104939943938"author="rconstruct"><inputname="P"type="point"storage="varying"value="P"description="Point to sample fBm at"><connectionparent="Transform_5"output="Pout"/></input><inputname="filterwidth"type="float"storage="varying"value="0"description="Filter width for antialiasing"/><inputname="octaves"type="float"storage="uniform"shader_parameter="1"value="5"description="Maximum octaves of noise"/><inputname="lacunarity"type="float"storage="varying"shader_parameter="1"value="2.17"description="Controls the smoothness of the fBm"/><inputname="gain"type="float"storage="varying"shader_parameter="1"value="0.5"description="Controls the contrast of the fBm"/><inputname="amplitude"type="float"storage="varying"shader_parameter="1"value="1"description="Amplitude of fBm"/><outputname="value"type="float"storage="varying"description="fBm value at p"/><rsl_code>
#define$(blockname)_$(value:type)
#ifdef$(blockname)_float
$(value)=$(amplitude)*fBm($(P),$(filterwidth),$(octaves),
$(lacunarity),$(gain));
#else
$(value)=$(amplitude)*$(value:type)(vectorvfBm($(P),
$(filterwidth),$(octaves),$(lacunarity),$(gain)));
#endif
#undef$(blockname)_$(value:type)
</rsl_code><rsl_include>rsl_shrimp_fractal.h</rsl_include><usage>3dimensionalfractionalBrownianmotionisasumationofnoisesatdifferentfrequencies.Notethattheoutputisnotclampedandmayexceed+1or-1.</usage></block><blockid="p"position_x="-1.39450604316325"position_y="-13.3009819923024"author="rconstruct"><outputname="P"type="point"storage="varying"description="Surface position"/><rsl_code>
$(P)=P;
</rsl_code><rsl_include/><usage>Notethatinallshadingcontexts,"P"isthesurfaceposition,theonlyexceptionbeingvolumeshaders,inwhich"P"isthelightrayorigin.Alsonotethatinimagershaders,"P"isthepositionofthepixelcenterinrasterspace,withthezcoordinatebeing0.</usage></block><blockid="p_2"position_x="-16.7115410916356"position_y="13.1905536047005"author="rconstruct"><outputname="P"type="point"storage="varying"description="Surface position"/><rsl_code>
$(P)=P;
</rsl_code><rsl_include/><usage>Notethatinallshadingcontexts,"P"isthesurfaceposition,theonlyexceptionbeingvolumeshaders,inwhich"P"isthelightrayorigin.Alsonotethatinimagershaders,"P"isthepositionofthepixelcenterinrasterspace,withthezcoordinatebeing0.</usage></block></network>
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Could you provide some more information, such as the console output (if you find anything interesting in there) and if possible either the scene that crashes the edit function or how to reproduce it.
Thanks.
I get similar seg faults while editing shader projects as well. Sometimes it varies but it seems to be caused by a form of corruption in the XML file, such as when trying to change a shader project and removing nodes and trying to render a preview will cause Shrimp to crash. Other times it happens when you do not disconnect links before trying to connect another node - when disconnecting the node after that (when there looks like 2 links to the same value), then reconnect and render this will cause Shrimp to crash as well. This does not happen ALL the time and sadly there is no output in the terminal other than Cannot open file and then Segmentation Fault (not even a line number for any source code, in either Shrimp source or XML project source.
Here is an example shader project that caused crashes.
<shrimp name="new_scene" authors="">
<about>
<network>
<block id="user-content-Add" position_x="-2.07192569924735" position_y="9.09605669333631" author="rconstruct">
<input name="A" type="color" storage="varying" value="1" description="1st input" type_parent="value">
<connection parent="Multiply" output="value">
<input name="B" type="color" storage="varying" multi="+" value="1" description="2nd or subsequent inputs" type_parent="value">
<connection parent="Diffuse" output="Ci">
<output name="value" type="color" storage="varying" description="val = A + B">
<rsl_code>
$(value) = $(A) + $(B);
</rsl_code>
<rsl_include>
<usage>Adds 2 or more inputs. All the input pads will inherit the type of the output pad. </usage>
</rsl_include></output></connection></connection></block>
<block id="user-content-Add_2" position_x="1.56260527885542" position_y="8.33094071887955" author="rconstruct">
<input name="A" type="color" storage="varying" value="1" description="1st input" type_parent="value">
<connection parent="Add" output="value">
<input name="B" type="color" storage="varying" multi="+" value="1" description="2nd or subsequent inputs" type_parent="value">
<connection parent="WardAniso" output="Ci">
<input name="B_2" type="color" storage="varying" multi_parent="B" description="">
<connection parent="WardAniso" output="Ci">
<output name="value" type="color" storage="varying" description="val = A + B">
<rsl_code>
$(value) = $(A) + $(B);
</rsl_code>
<rsl_include>
<usage>Adds 2 or more inputs. All the input pads will inherit the type of the output pad. </usage>
</rsl_include></output></connection></connection></connection></block>
<block id="user-content-Add_3" position_x="4.92130097459826" position_y="7.20283131521404" author="rconstruct">
<input name="A" type="color" storage="varying" value="1" description="1st input" type_parent="value">
<connection parent="Add_2" output="value">
<input name="B" type="color" storage="varying" multi="+" value="1" description="2nd or subsequent inputs" type_parent="value">
<connection parent="Add_4" output="value">
<output name="value" type="color" storage="varying" description="val = A + B">
<rsl_code>
$(value) = $(A) + $(B);
</rsl_code>
<rsl_include>
<usage>Adds 2 or more inputs. All the input pads will inherit the type of the output pad. </usage>
</rsl_include></output></connection></connection></block>
<block id="user-content-Add_4" position_x="1.46330746391087" position_y="6.23025040211311" author="rconstruct">
<input name="A" type="color" storage="varying" value="1" description="1st input" type_parent="value">
<connection parent="Reflection" output="value">
<input name="B" type="color" storage="varying" multi="+" value="1" description="2nd or subsequent inputs" type_parent="value">
<connection parent="Refraction" output="value">
<output name="value" type="color" storage="varying" description="val = A + B">
<rsl_code>
$(value) = $(A) + $(B);
</rsl_code>
<rsl_include>
<usage>Adds 2 or more inputs. All the input pads will inherit the type of the output pad. </usage>
</rsl_include></output></connection></connection></block>
<block id="user-content-Add_5" position_x="6.39673460341699" position_y="-11.5677441178921" author="rconstruct">
<input name="A" type="point" storage="varying" value="1" description="1st input" type_parent="value">
<connection parent="p" output="P">
<input name="B" type="point" storage="varying" multi="+" value="1" description="2nd or subsequent inputs" type_parent="value">
<connection parent="Normal2Point" output="value">
<output name="value" type="point" storage="varying" description="val = A + B">
<rsl_code>
$(value) = $(A) + $(B);
</rsl_code>
<rsl_include>
<usage>Adds 2 or more inputs. All the input pads will inherit the type of the output pad. </usage>
</rsl_include></output></connection></connection></block>
<block id="user-content-Blotches" position_x="-14.5723432671048" position_y="11.5495251365674" author="rconstruct">
<input name="P" type="point" storage="varying" value="P" description="Surface point to evaluate">
<connection parent="Transform_5" output="Pout">
<input name="radius" type="float" storage="varying" value="0.3" description="Blotch radius">
<input name="frequency" type="float" storage="varying" value="5" description="Frequency">
<input name="offset" type="float" storage="varying" value="0.35" description="Offset">
<input name="jittering" type="float" storage="varying" value="0.8" description="Jittering">
<input name="metric" type="float" storage="uniform" value="2" description="Voronoi distance metric">
<output name="value" type="float" storage="varying" description="Output value">
<rsl_code>
$(value) = blotches( $(radius), $(frequency), $(offset), $(jittering),
$(metric), $(P) );
</rsl_code>
<rsl_include>rsl_shrimp_extrapatterns.h </rsl_include>
<usage>Generates random blotches, based on single feature Voronoi cell noise. "Jittering" controls the Voronoi cell noise jittering, generating a less or more evenly distribution of blotches. "Offset" controls the center offset, a value of 0 generating a hollow blotch, and 1.0 an solid blotch. "Radius" controls the radius, and "frequency", the frequency of the blotches. "Metric" controls the distance metric used for the Voronoi noise, when different than 0 the metric being the Minkowski metric, with "metric" as Minkowski's P parameter, being P = 1, the Manhattan metric, P = 2 the Euclidian metric, and allowing higher orders of P tending towards Tchebychev results. </usage>
</output></connection></block>
<block id="user-content-CalcNormal" position_x="8.45512385529192" position_y="-11.7108634966467" author="rconstruct">
<input name="P" type="point" storage="varying" value="P" description="Point to calculate normal at">
<connection parent="Add_5" output="value">
<output name="N" type="normal" storage="varying" description="NN is normal at p">
<rsl_code>
$(N) = calculatenormal( $(P) );
</rsl_code>
<rsl_include>
<usage>Returns the surface normal of the given point on the surface. You should always recalculate the normals after a displacement. </usage>
</rsl_include></output></connection></block>
<block id="user-content-Diffuse" position_x="-4.62303135746799" position_y="8.01797958720871" author="rconstruct">
<input name="Cdiff" type="color" storage="varying" shader_parameter="1" value="1 0.94902 0.564706" description="Diffuse color">
<connection parent="Mix_2" output="value">
<input name="Kd" type="float" storage="varying" shader_parameter="1" value="0.65" description="The diffuse coefficient">
<input name="N" type="normal" storage="varying" value="normalize(N)" description="The surface normal">
<input name="P" type="point" storage="varying" value="P" description="Surface position, see usage">
<input name="coneangle" type="float" storage="varying" value="PI/2" description="Cone angle, see usage">
<input name="model" type="float" storage="uniform" value="0" description="Toggle 1 or 3 argument diffuse, see usage">
<output name="Ci" type="color" storage="varying" description="The amount of diffuse light">
<rsl_code>
aov_surfacecolor += $(Cdiff);</rsl_code></output></connection></block></network></about></shrimp>
Attribute "visibility" "int specular" [ 1 ]
Attribute "visibility" "int camera" [ 1 ]
Attribute "visibility" "int diffuse" [ 1 ]
Attribute "visibility" "int photon" [ 1 ]
Attribute "shade" "string transmissionhitmode" "shader"
Attribute "shade" "string specularhitmode" "shader"
<imager_statement>
<input name="Ci" type="color" storage="varying" shader_parameter="1" value="0" description="Incident ray colour">
<connection parent="Add_3" output="value">
<input name="Oi" type="color" storage="varying" shader_parameter="1" value="1" description="Incident ray opacity">
<input name="P" type="point" storage="varying" shader_parameter="1" value="P" description="Displaced surface position">
<connection parent="Add_5" output="value">
<input name="N" type="normal" storage="varying" shader_parameter="1" value="N" description="Displaced surface shading normal">
<connection parent="CalcNormal" output="N">
<input name="Cl" type="color" storage="varying" shader_parameter="1" value="0" description="Outgoing light ray colour">
<connection parent="ShadowSpotLight" output="Cl">
<input name="Ol" type="color" storage="varying" shader_parameter="1" value="1" description="Outgoing light ray opacity">
<input name="Cv" type="color" storage="varying" shader_parameter="1" value="0" description="Attenuated ray colour">
<input name="Ov" type="color" storage="varying" shader_parameter="1" value="1" description="Attenuated ray opacity">
<input name="Cm" type="color" storage="varying" shader_parameter="1" value="0" description="Output pixel colour">
<input name="Om" type="color" storage="varying" shader_parameter="1" value="1" description="Output pixel opacity">
<input name="AOV" type="color" storage="varying" shader_parameter="1" value="1" description="AOV preview output">
<connection parent="Add_3" output="value">
<rsl_code>
<rsl_include>
<usage>
<block id="user-content-ShadowSpotLight" position_x="4.88358811575387" position_y="18.8819714035225" author="rconstruct">
<input name="intensity" type="float" storage="varying" shader_parameter="1" value="5000" description="Light intensity">
<input name="lightcolor" type="color" storage="varying" shader_parameter="1" value="0.909804 0.909804 0.847059" description="Light color">
<input name="position" type="point" storage="varying" shader_parameter="1" value="point "shader" ( -15, 10, 5 )" description="Light source position">
<input name="target" type="point" storage="varying" shader_parameter="1" value="point "shader" ( 0, 0, 0 )" description="Light source target position">
<input name="coneangle" type="float" storage="uniform" shader_parameter="1" value="30" description="Cone angle">
<input name="conedelta" type="float" storage="uniform" shader_parameter="1" value="5" description="Cone delta angle">
<input name="beam" type="float" storage="uniform" value="2" description="Beam distribution">
<input name="shadowmap" type="string" storage="uniform" shader_parameter="1" value=""raytrace"" description="Shadow map name">
<input name="filter" type="string" storage="uniform" value=""gaussian"" description="Filter type">
<input name="samples" type="float" storage="uniform" shader_parameter="1" value="4" description="Shadow map samples">
<input name="blur" type="float" storage="varying" shader_parameter="1" value="0.05" description="Shadow map blur">
<input name="width" type="float" storage="uniform" value="1" description="Shadow map filter width">
<input name="bias" type="float" storage="uniform" shader_parameter="1" value="0.01" description="Shadow map bias">
<input name="attenuation" type="float" storage="varying" shader_parameter="1" value="1e6" description="Attenuation">
<input name="nondiffuse" type="float" storage="uniform" value="0" description="Non-diffuse light">
<input name="nonspecular" type="float" storage="uniform" value="0" description="Non-specular light">
<input name="category" type="string" storage="uniform" value="""" description="Light category">
<output name="Cl" type="color" storage="varying" description="Light ray color">
<rsl_code>
__nondiffuse = $(nondiffuse);
__nonspecular = $(nonspecular);
__category = $(category);
/ tmp storage for shadows /
color $(blockname)_inshadow = color(0);</rsl_code></output></block></usage></rsl_include></rsl_code></connection></connection></connection></connection></connection></imager_statement>