12.07.2015 Views

Mr Cool Ice Shader Help File

Mr Cool Ice Shader Help File

Mr Cool Ice Shader Help File

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>Mr</strong> <strong>Cool</strong> <strong>Ice</strong> <strong>Shader</strong> <strong>Help</strong> <strong>File</strong>Vanessa Salas Castilloi78324241


i. Summary“mr_cool_ice.sl” is a Renderman shader that renders deep blue icematerial using raytracing.“mr_cool_ice” replicates the main characteristics of blue ice: scatteringof light through the volume, reflections, refractions, fresnel effect, specularity.The shader is completely procedural, it does not use painted textures. Ioffers you the possibility of using noises to control its patterns.Ray tracing is used, however if the settings are optimised, it is a veryefficient shader.ii. PiecesAs “mr_cool_ice” uses subsurface scattering, a previous pass is needed.This pass bakes the radiance of your model and creates an albedo noise tosimulate the lack of uniformity of blue ice.Two options are offered:1. Baking the albedo, diffuse mean free path, radiance and the area of everymicropolygon on a point cloud with “bake_radiance_noise.sl”, and thenecified in Renderman Application Notes for Translucency and SubsurfaceScattering [PX]. This process has been automatised with a python script namedthat does the call for all these steps. This script can render more than oneframe as well.using ptfilter and brickmake as spAfter this, “mr_cool_ice” is called with the resulting brickmap as aparameter. As the diffuse simulation (see Renderman Application Notes forTranslucency and Subsurface Scattering [PX]) has been done, the shader justreads the result from the brickmap.2. Baking the area and transmitted direct illumination at each point on a pointcloud with “bake_info.sl”. Though not essential, it is recommended togenerate an organised point cloud out of the resultant point cloud. This pointcloud is a parameter for “mr_cool_ice_info.sl”.ATTENTION: for both of the prepasses, it is important to remember to setthe attributes “cull” “hidden” and ”cull” “backfacing” to 0 in the rib file.2


iii.“mr_cool_ice”1. ParametersCoefficients to modulate the effect of each of the components of theshaderName Type FunctionKo float Opacity coefficientKsss float Subsurface scattering coefficientKs float Specularity coefficientKwet float Specularity coefficient for wet effectKr float Reflection coefficientKt float Refraction coefficientKibl float Image based lighting coefficient. Env. DiffuseKd float Diffuse coefficient (for frost)Kb float Displacement coefficient (for frost)Global parametersName Type Functionenv_map string Environment map for the image based lightingcalculations.diffuse_map string Blurred map for the image based lighting calculations.coord_system string Coordinate system to do the environment look ups.premult float If its value is one, layers are multiplied by the opacitySpecularity parametersThis parameters control the behaviour of a Cook Torrance function to model thespecularity of ice.Name Type Functionspec_flag float 1: Compute specularitycook_roughness float Roughness of the surfacecook_specular_colourcolorColour of the speculargaussConstant float Gauss constant3


Wet effect parametersThis parameters control a wet effect produced with a Blinn specularity.Name Type Functionwet_flag float 1: Add wet effectwet_eccentricitywet_rolloffwet_reflectivityfloatfloatfloatspec_colour color Colour of the specularFresnel effect parametersParameters to activate and control the Fresnel effect. When active,automatically affects the reflections and refractions calculated in the shader.Name Type Functionfresnel_flag float 1: do fresnel effectior float Index of refraction. The actual index of refraction of iceis 1.31Reflection oclussion parametersThis is an image based lighting pass. It uses the environment map providedunder “env_map”. This is the most expensive pass. Set carefully the settings ofthe samples. Using values that are multiples of 4 is more efficient.Name Type Functionrocc_flag float 1: Compute reflection occlusion pass.reflectionocc_samplesfloatreflectionocc_blur floatNumber of samples. Acts as a quality knob.This value is later transformed to radians an used in thegather call as the cone angle.Refraction parametersIf computed uses a trace call and Fresnel if it has been activated.Name Type Functiont_flag float 1: Compute refraction.4


Subsurface Scattering parametersThe subsurface scattering pass gives translucency and most of its colour to ice.A brickmap with the result of the diffuse approximation done with ptfilter mustbe provided.Name Type Functionsss_flag float 1: Read subsurface scatteringsss_bkm string Name of the brickmap.Frost parametersThese are parameters to add frost to the superior part of the ice.Name Type Functionsnow_flag float 1: Add frost to the icesnow_height float Defines how low can the snow spread on thevolume. This value exists, because icebergs are80% underwater. It doensn't make sense thaticebergs are covered of snow underwater.snow_over float How horizontal should the surface be to becovered by snow.spark_eccentricityfloatBlinn eccentricity parameterspark_rolloff float Blinn falloff parameterDiffuse IBL and Ambient occlusion parametersThese parameter is used to modulate the result of the snow, not for the ice.Name Type Functionibldiff_flag float 1: Do image based diffuseibldiff_samples float Defines how low can the snow spread on thevolume. This value exists, because icebergs are80% underwater. It doensn't make sense thaticebergs are covered of snow underwater.occ_sample float Samples quantity to create the ambient occlusionpass.occ_maxvarfloat5


2. OutputsThe pre pass shader and the actual shader, both produce “arbitraryoutput values” or AOVs. There is an AOV acting as a secondary channel forevery different pass. Each of these secondary channels has to be madeavailable in the RIB file first. By using this strategy, even though a singleshader does all the calculations, it is still possible to have access to thedifferent passes. Afterwards manipulate them inside a compositing tool asdesired and achieve different results is quite easy. These secondary outputs aresaved as 'tif' images. The final image is saved as a 'tif' as well.Typeoutput varying coloroutput varying coloroutput varying coloroutput varying coloroutput varying coloroutput varying coloroutput varying coloroutput varying coloroutput varying coloroutput varying coloroutput varying colorName_diffuse_colour_diffuse_ibl_opacity_occlusion_reflection_occlusion_refraction_snow_mask_sparkles_specularity_specularity_blinn_subsurfaceiv. “mr_cool_ice_info”1. ParametersCoefficients to modulate the effect of each of the components of theshaderName Type FunctionKo float Opacity coefficientKsss float Subsurface scattering coefficientKs float Specularity coefficientKwet float Specularity coefficient for wet effectKr float Reflection coefficientKt float Refraction coefficient6


Kibl float Image based lighting coefficient. Env. DiffuseKd float Diffuse coefficient (for frost)Kb float Displacement coefficient (for frost)Global parametersName Type Functionenv_map string Environment map for the image based lightingcalculations.diffuse_map string Blurred map for the image based lighting calculations.coord_system string Coordinate system to do the environment look ups.premult float If its value is one, layers are multiplied by the opacitySubsurface Scattering parametersThe subsurface scattering pass gives translucency and most of its colour to ice.A brickmap with the result of the diffuse approximation done with ptfilter mustbe provided.Name Type Functionsss_flag float 1: Read subsurface scatteringsss_pointcloud string Name of the point cloud.sss_ior string Index of refractionalbedo_value color A colour to multiply the value of the albedodmfp_value color The value of the diffuse mean free pathsss_smooth float Activate smooth results for subsurface scatteringsss_unitlength float The unit length by default is mmsss_maxsolidanglefloatThe accuracy of the subsurface diffusion simulation.Albedo parametersThrough a varying albedo there are many visually interesting options. Marblenoise is used alter itName Type Functionveining float 1: Read subsurface scatteringice_tint string Name of the point cloud.vein_colour string Index of refractionalbedo_value color A colour to multiply the value of the albedo7


dmfp_value color The value of the diffuse mean free pathsss_smooth float Activate smooth results for subsurface scatteringsss_unitlength float The unit length by default is mmsss_maxsolidanglefloatThe accuracy of the subsurface diffusion simulation.Specularity parametersThis parameters control the behaviour of a Cook Torrance function to model thespecularity of ice.Name Type Functionspec_flag float 1: Compute specularitycook_roughness float Roughness of the surfacecook_specular_colourcolorColour of the speculargaussConstant float Gauss constantWet effect parametersThis parameters control a wet effect produced with a Blinn specularity.Name Type Functionwet_flag float 1: Add wet effectwet_eccentricitywet_rolloffwet_reflectivityfloatfloatfloatspec_colour color Colour of the specularFresnel effect parametersParameters to activate and control the Fresnel effect. When active,automatically affects the reflections and refractions calculated in the shader.Name Type Functionfresnel_flag float 1: do fresnel effectior float Index of refraction. The actual index of refraction of iceis 1.31Reflection oclussion parameters8


This is an image based lighting pass. It uses the environment map providedunder “env_map”. This is the most expensive pass. Set carefully the settings ofthe samples. Using values that are multiples of 4 is more efficient.Name Type Functionrocc_flag float 1: Compute reflection occlusion pass.reflectionocc_samplesfloatreflectionocc_blur floatNumber of samples. Acts as a quality knob.This value is later transformed to radians an used in thegather call as the cone angle.Refraction parametersIf computed uses a trace call and Fresnel if it has been activated.Name Type Functiont_flag float 1: Compute refraction.Frost parametersThese are parameters to add frost to the superior part of the ice.Name Type Functionsnow_flag float 1: Add frost to the icesnow_height float Defines how low can the snow spread on thevolume. This value exists, because icebergs are80% underwater. It doensn't make sense thaticebergs are covered of snow underwater.snow_over float How horizontal should the surface be to becovered by snow.spark_eccentricityfloatBlinn eccentricity parameterspark_rolloff float Blinn falloff parameterDiffuse IBL and Ambient occlusion parametersThese parameter is used to modulate the result of the snow, not for the ice.Name Type Functionibldiff_flag float 1: Do image based diffuseibldiff_samples float Defines how low can the snow spread on thevolume. This value exists, because icebergs are9


80% underwater. It doensn't make sense thaticebergs are covered of snow underwater.occ_sample float Samples quantity to create the ambient occlusionpass.occ_maxvarfloat10


2. OutputsThe pre pass shader and the actual shader, both produce “arbitraryoutput values” or AOVs. There is an AOV acting as a secondary channel forevery different pass. Each of these secondary channels has to be madeavailable in the RIB file first. By using this strategy, even though a singleshader does all the calculations, it is still possible to have access to thedifferent passes. Afterwards manipulate them inside a compositing tool asdesired and achieve different results is quite easy. These secondary outputs aresaved as 'tif' images. The final image is saved as a 'tif' as well.TypeNameoutput varying color _albedo_noiseoutput varying color _diffuse_colouroutput varying color _diffuse_ibloutput varying color _opacityoutput varying color _occlusionoutput varying color _reflection_occlusionoutput varying color _refractionoutput varying color _snow_maskoutput varying color _sparklesoutput varying color _specularityoutput varying color _specularity_blinnoutput varying color _subsurfacev. DependenciesTo be able to compile the shaders, the following files are necessary:vsl.utils: A library with utility functions is used with the purpose of storing avariety of noise functions, conversions, and any other method that providesreusable functionalities. Some of the noises and other functions were taken andslightly modified from the ones implemented by Slim.The “noises.h” library from Advanced Renderman [AP] is also included.“vsl_pass.h”: This library contains the functions that create the passesneeded by each shader.blinn.hfilterwidth.h11


patterns.h12


vi.References[PX] Pixar Animation Studios. 2009. Pixar's Renderman User's Manual. Availablefrom:http://nccastaff.bournemouth.ac.uk/jmacey/Renderman/prmandocs/RPS_14.0/(Accessed 12 May 2009).13

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!