SPDL Version = "2.0.0.0"; Reference = "{19672007-1116-6660-3400-A71CE0040425}"; PropertySet "sj_sss_fast_simple_mat_v2_params" { Parameter "out" output { guid = "{4C6879FF-7EC8-11D0-8E3B-00A0C90640EC}"; type = color; } Parameter "lightmap" input { GUID = "{19672007-1116-6660-3401-A71CE0040425}"; Type = texture; Inspectable = on; Texturable = on; } Parameter "samples" input { GUID = "{19672007-1116-6660-3402-A71CE0040425}"; Type = integer; Value = 300; Value Minimum = 1; } Parameter "bump" input { GUID = "{19672007-1116-6660-3403-A71CE0040425}"; Type = vector; Value = 0.0 0.0 0.0; Texturable = on; } Parameter "ambient" input { GUID = "{19672007-1116-6660-3404-A71CE0040425}"; Type = color; Texturable = on; Value = 0.0 0.0 0.0; } Parameter "ambience" input { title = "Scene Ambience"; guid = "{3515CC74-082C-11D0-91DE-00A024C78EE3}"; type = color; value = 0.1 0.1 0.1; flags = 1; inspectable = off; texturable = off; } Parameter "overall_color" input { GUID = "{19672007-1116-6660-3405-A71CE0040425}"; Type = color; Texturable = on; Value = 1.0 1.0 1.0; } Parameter "diffuse_color" input { GUID = "{19672007-1116-6660-3406-A71CE0040425}"; Type = color; Texturable = on; Value = 1.0 1.0 1.0; } Parameter "diffuse_weight" input { GUID = "{19672007-1116-6660-3407-A71CE0040425}"; Type = scalar; Texturable = on; Value = 0.5; Value Minimum = 0.0; Value Maximum = 1.0; } Parameter "front_sss_color" input { GUID = "{19672007-1116-6660-3408-A71CE0040425}"; Type = color; Texturable = on; Value = 0.8 0.4 0.1; } Parameter "front_sss_weight" input { GUID = "{19672007-1116-6660-3409-A71CE0040425}"; Type = scalar; Texturable = on; Value = 0.5; Value Minimum = 0.0; Value Maximum = 1.0; } Parameter "front_sss_radius" input { GUID = "{19672007-1116-6660-3410-A71CE0040425}"; Type = scalar; Texturable = on; Value = 10.0; Value Minimum = 0.0; } Parameter "back_sss_color" input { GUID = "{19672007-1116-6660-3411-A71CE0040425}"; Type = color; Texturable = on; Value = 0.8 0.4 0.1; } Parameter "back_sss_weight" input { GUID = "{19672007-1116-6660-3412-A71CE0040425}"; Type = scalar; Texturable = on; Value = 0.5; Value Minimum = 0.0; Value Maximum = 1.0; } Parameter "back_sss_radius" input { GUID = "{19672007-1116-6660-3413-A71CE0040425}"; Type = scalar; Texturable = on; Value = 10.0; Value Minimum = 0.0; } Parameter "back_sss_depth" input { GUID = "{19672007-1116-6660-3414-A71CE0040425}"; Type = scalar; Texturable = on; Value = 10.0; Value Minimum = 0.0; } Parameter "specular" input { GUID = "{19672007-1116-6660-3415-A71CE0040425}"; Type = color; Texturable = on; Value = 0.5 0.5 0.5; } Parameter "exponent" input { GUID = "{19672007-1116-6660-3416-A71CE0040425}"; Type = scalar; Value = 33.0; Value Minimum = 0.0; } Parameter "radiance" input { guid = "{19672007-1116-6660-3417-A71CE0040425}"; type = color; value = 1.0 1.0 1.0 1.0; texturable = on; } Parameter "scale_conversion" input { GUID = "{19672007-1116-6660-3418-A71CE0040425}"; Type = scalar; Value = 1.0; Value Minimum = 0.0; } Parameter "falloff" input { GUID = "{19672007-1116-6660-3419-A71CE0040425}"; Type = scalar; Value = 2.0; Value Minimum = 0.0; } Parameter "screen_composit" input { GUID = "{19672007-1116-6660-3420-A71CE0040425}"; Type = boolean; Value = on; } Parameter "lights" input { GUID = "{19672007-1116-6660-3421-A71CE0040425}"; UI "mapping" = "{38D56C23-8C0D-11D0-857D-00A02417D029}"; Inspectable = off; Type = array { Parameter "lights" input { GUID = "{19672007-1116-6660-3422-A71CE0040425}"; Type = light; } }; } Parameter "useLightsList" input { guid = "{19672007-1116-6660-3423-A71CE0040425}"; type = boolean; flags = 1; value = false; texturable = on; } Parameter "lightsList" input #LIGHT LIST { title = "Lights List"; guid = "{19672007-1116-6660-3424-A71CE0040425}"; Inspectable = on; Texturable = off; Persistable = on; ui "control" = "LightListParamItem.LightListParamItem.1"; type = array { Parameter "lightsList" input { title = "Lights List"; guid = "{19672007-1116-6660-3425-A71CE0040425}"; type = light; Inspectable = on; Texturable = off; Persistable = on; ui "control" = "LightListParamItem.LightListParamItem.1"; } }; } Parameter "channel" input { GUID = "{19672007-1116-6660-3426-A71CE0040425}"; Type = string; } Parameter "storeInChannel" input { GUID = "{19672007-1116-6660-3427-A71CE0040425}"; Type = boolean; Value = off; texturable = on; } } MetaShader "sj_sss_fast_simple_mat_v2" { Name = "sj_sss_fast_simple_mat_v2"; Type = material; Renderer "mental ray" { Name = "sj_sss_fast_simple_mat_v2"; BeginText # Phenomenon wiring diagram Node "diffuse_switch" = guid "{85C16046-BCFA-11D1-90E9-0000F804EB21}"; Node "specular_switch" = guid "{85C16046-BCFA-11D1-90E9-0000F804EB21}"; Node "channel_switch" = guid "{85C16046-BCFA-11D1-90E9-0000F804EB21}"; Node "diffuse" = guid "{FAE49B0B-412E-4667-AFB8-B004155ED2C9}"; # misss_lambert_gamma Node "lldiffuse" = guid "{FAE49B0B-412E-4667-AFB8-B004155ED2C9}"; # misss_lambert_gamma Connection "diffuse::ambient" = interface "ambient"; Connection "diffuse::ambience" = interface "ambience"; Connection "diffuse::diffuse" = interface "diffuse_color"; Connection "diffuse::diffuse_curve" = value 1.0; Connection "diffuse::indirect" = value off; Connection "diffuse::mode" = value 0; Connection "diffuse::lights" = interface "lights"; Connection "lldiffuse::ambient" = interface "ambient"; Connection "lldiffuse::ambience" = interface "ambience"; Connection "lldiffuse::diffuse" = interface "diffuse_color"; Connection "lldiffuse::diffuse_curve" = value 1.0; Connection "lldiffuse::indirect" = value off; Connection "lldiffuse::mode" = value 0; Connection "lldiffuse::lights" = interface "lightsList"; Connection "diffuse_switch::input1" = "diffuse"; Connection "diffuse_switch::input2" = "lldiffuse"; Connection "diffuse_switch::switch" = interface "useLightsList"; Node "specular" = guid "{03CE36D2-0D54-4A95-9F82-1105CB114C38}"; # misss_skin_specular Node "llspecular" = guid "{03CE36D2-0D54-4A95-9F82-1105CB114C38}"; # misss_skin_specular Connection "specular::overall_weight" = value 1.0; Connection "specular::primary_weight" = value 1.0; Connection "specular::primary_spec_color" = interface "specular"; Connection "specular::primary_shinyness" = interface "exponent"; Connection "specular::mode" = value 0; Connection "specular::lights" = interface "lights"; Connection "llspecular::overall_weight" = value 1.0; Connection "llspecular::primary_weight" = value 1.0; Connection "llspecular::primary_spec_color" = interface "specular"; Connection "llspecular::primary_shinyness" = interface "exponent"; Connection "llspecular::mode" = value 0; Connection "llspecular::lights" = interface "lightsList"; Connection "specular_switch::input1" = "specular"; Connection "specular_switch::input2" = "llspecular"; Connection "specular_switch::switch" = interface "useLightsList"; Node "bump" = guid "{F0E05130-6240-11D3-8C0A-00A0243E3672}"; # sib_bump Connection "bump::bump" = interface "bump"; Connection "bump::inuse" = value on; Node "mtlsh" = guid "{85A7775B-31B3-4C37-BDD3-AFE4767B67B6}"; # misss_fast_shader Connection "mtlsh::lightmap" = interface "lightmap"; #shared Connection "mtlsh::bump" = value "bump"; #unique Connection "mtlsh::diffuse_illum" = value "diffuse_switch"; #unique Connection "mtlsh::diffuse_color" = interface "overall_color"; #unique Connection "mtlsh::diffuse_weight" = interface "diffuse_weight"; #unique Connection "mtlsh::specular_illum" = value "specular_switch"; #unique Connection "mtlsh::screen_composit" = interface "screen_composit"; #unique Connection "mtlsh::front_sss_color" = interface "front_sss_color"; #unique Connection "mtlsh::front_sss_weight" = interface "front_sss_weight"; #unique Connection "mtlsh::front_sss_radius" = interface "front_sss_radius"; #unique Connection "mtlsh::back_sss_color" = interface "back_sss_color"; #unique Connection "mtlsh::back_sss_weight" = interface "back_sss_weight"; #unique Connection "mtlsh::back_sss_radius" = interface "back_sss_radius"; #unique Connection "mtlsh::back_sss_depth" = interface "back_sss_depth"; #unique Connection "mtlsh::scale_conversion" = interface "scale_conversion"; #unique Connection "mtlsh::falloff" = interface "falloff"; #unique Connection "mtlsh::samples" = interface "samples"; #unique # indirect Node "irradiance" = guid "{25C69C36-E7E3-11D2-8AF6-00A0C9892542}"; # sib_photon_matte Connection "irradiance::input" = interface "radiance"; # - mtlsh/irradiance mix Node "mtlsh_mix" = guid "{6EE27300-A1E2-11D3-AE51-00A0C96E63E1}"; # sib_color_math_basic Connection "mtlsh_mix::input1" = "mtlsh"; Connection "mtlsh_mix::input2" = "irradiance"; Connection "mtlsh_mix::op" = value 0; Connection "mtlsh_mix::alpha" = value off; Node "sib_store_color" = guid "{2653160B-6494-450c-A71C-97E40817D27C}"; Connection "sib_store_color::input" = "mtlsh_mix"; Connection "sib_store_color::channel" = interface "channel"; Connection "channel_switch::input1" = "mtlsh_mix"; Connection "channel_switch::input2" = "sib_store_color"; Connection "channel_switch::switch" = interface "storeInChannel"; Connection root = "channel_switch"; EndText } } Defaults { samples { Name = "Lightmap Samples"; UIRange = 1 To 1000; } ambient { Name = "Ambient Colour"; UIType = "rgb"; Commands = "{F5C75F11-2F05-11D3-AA95-00AA0068D2C0}"; } overall_color { Name = "Overall Colour Multiplier"; UIType = "rgb"; Commands = "{F5C75F11-2F05-11D3-AA95-00AA0068D2C0}"; } diffuse_color { Name = "Colour"; UIType = "rgb"; Commands = "{F5C75F11-2F05-11D3-AA95-00AA0068D2C0}"; } diffuse_weight { Name = "Weight"; Commands = "{F5C75F11-2F05-11D3-AA95-00AA0068D2C0}"; } radiance { Name = "Radiance"; UIType = "rgb"; Commands = "{F5C75F11-2F05-11D3-AA95-00AA0068D2C0}"; } front_sss_color { Name = "Colour"; UIType = "rgb"; Commands = "{F5C75F11-2F05-11D3-AA95-00AA0068D2C0}"; } front_sss_weight { Name = "Weight"; Commands = "{F5C75F11-2F05-11D3-AA95-00AA0068D2C0}"; } front_sss_radius { Name = "Radius"; UIRange = 0.0 To 50.0; Commands = "{F5C75F11-2F05-11D3-AA95-00AA0068D2C0}"; } back_sss_color { Name = "Colour"; UIType = "rgb"; Commands = "{F5C75F11-2F05-11D3-AA95-00AA0068D2C0}"; } back_sss_weight { Name = "Weight"; Commands = "{F5C75F11-2F05-11D3-AA95-00AA0068D2C0}"; } back_sss_radius { Name = "Radius"; UIRange = 0.0 To 50.0; Commands = "{F5C75F11-2F05-11D3-AA95-00AA0068D2C0}"; } back_sss_depth { Name = "Depth"; UIRange = 0.0 To 50.0; Commands = "{F5C75F11-2F05-11D3-AA95-00AA0068D2C0}"; } specular { Name = "Colour"; UIType = "rgb"; Commands = "{F5C75F11-2F05-11D3-AA95-00AA0068D2C0}"; } exponent { Name = "Decay"; UIRange = 0.0 To 50.0; Commands = "{F5C75F11-2F05-11D3-AA95-00AA0068D2C0}"; } scale_conversion { Name = "Scale"; UIRange = 0.0 To 10.0; } falloff { Name = "Sample Falloff"; UIRange = 0.1 To 10.0; } screen_composit { Name = "Use Screen Compositing for Colours"; } useLightsList { Name = "Use Lights List"; } lightsList { Name = "Lights List"; UIType = "LightListParamItem.LightListParamItem.1"; } channel { Name = "Render Channel"; UIType = "combo"; } storeInChannel { Name = "Enable"; } } Logic { Sub useLightsList_OnChanged() lightsList.enable(useLightsList.value) End Sub Sub storeInChannel_OnChanged() channel.enable(storeInChannel.value) End Sub Sub AddChannel_OnClicked Dim sName sName = InputBox( "Render Channel Name" ) If sName = "" Then Exit Sub On Error Resume Next sName = CreateRenderChannel( sName, siRenderChannelColorType ) LogMessage Err.Number If Err.Number <> 0 Then LogMessage "Unable to create channel. Does a channel with that name already exist?" Exit Sub End If If sName <> "" Then For Each oInspected In PPG.Inspected oInspected.channel = sName Next OnInit End If End Sub Sub ChannelInit() Dim oRenderChannels Set oRenderChannels = ActiveProject.ActiveScene.PassContainer.Properties( "Scene Render Options" ).RenderChannels If TypeName(oRenderChannels) = "Nothing" Then LogMessage "Scene Render Options property not found. Can't enumerate render channels.", siError Exit Sub End If If oRenderChannels.Count = 0 Then LogMessage "No render channels defined.", siError Exit Sub End If Dim idx ReDim oChannelList( oRenderChannels.Count * 2 + 1 ) idx = 0 for each oChannel in oRenderChannels If oChannel.ChannelType = siRenderChannelColorType And oChannel.UserDefined Then oChannelList( idx * 2 + 0 ) = oChannel.Name oChannelList( idx * 2 + 1 ) = oChannel.Name idx = idx + 1 End If next ReDim Preserve oChannelList( idx * 2 - 1 ) Dim oChannelCombo Set oChannelCombo = PPG.PPGLayout.Item( "channel" ) oChannelCombo.UIItems = oChannelList PPG.Refresh End Sub Sub Info_OnClicked() dim s s = "sj_sss_fast_simple_material_v2 ------------ by Stefano Jannuzzo" & vbCrlf s = s & "---------------------------------------------------------------" & vbCrlf s = s & "Should be used coupled with sj_sss_fast_simple_lightmap_v2" & vbCrlf s = s & "Changes from v1:" & vbCrlf s = s & "- Global illumination fixed" & vbCrlf s = s & "- Added render channel support" & vbCrlf s = s & "- Added local lights list (optional)" & vbCrlf s = s & " If enabled, the lights in the list only are used." & vbCrlf s = s & " The list should match the one in sj_sss_fast_simple_lightmap_v2" XSIUIToolkit.MsgBox(s) End Sub Sub OnInit useLightsList_OnChanged storeInChannel_OnChanged ChannelInit End Sub } Layout "Default" { Tab "Surface" { ambient; overall_color; Group "Diffuse" { diffuse_color; diffuse_weight; } Group "Specular" { specular; exponent; } } Tab "Scattering" { Group "Front Scattering" { front_sss_color; front_sss_weight; front_sss_radius; falloff; } Group "Back Scattering" { back_sss_color; back_sss_weight; back_sss_radius; back_sss_depth; } Group "Scatter Controls" { samples; } } Tab "Advanced Settings" { Group "Indirect Illumination" { radiance; } Group "Miscellaneous" { scale_conversion; screen_composite; } } Tab "Extra" { Group "Lights" { useLightsList; lightsList; } Group "Render Channel" { storeInChannel; Row { channel,nolabel; Button AddChannel,alignright = "Add..."; } } Group "Info" { Button Info = "Info", 200; } } lightmap; } Layout "RenderTree" { bump; Group "Diffuse" { ambient; overall_color; diffuse_color; diffuse_weight; } Group "Front Scattering" { front_sss_color; front_sss_weight; front_sss_radius; } Group "Back Scattering" { back_sss_color; back_sss_weight; back_sss_radius; back_sss_depth; } Group "Specular" { specular; exponent; } Group "Indirect" { radiance; } Group "Extra" { useLightsList; lightsList; storeInChannel; } lightmap; }