Advanced car-paint OSL shader

cglSurfaceCarPaint is an advanced car-paint OSL shader, free to download from CG-Lion studio’s website.

The cglSurfaceCarPaint car-paint material combines 3 layers:
Base: A blend of diffuse/metallic shading with a view-angle color mix
Metallic flakes: Distance blended procedural metallic flakes
Clear coat: Glossy clear coat layer with built-in procedural bump irregularity
And has been tested with:
Blender & Cycles
Maya & Arnold
3ds max & V-Ray

Download and more info

Getting started with OSL shaders

 

Maya – Setting the V-Ray Sun direction according to location, date and time

Software:
Maya 2018 | V-Ray 3.6

To set the VRaySun photometric light source diretion according to the location in the world, the date and the time:

  1. Select the VRaySun parent node – ‘VRayGeoSun1Transform‘ and rotate it so its Z axis points to the architectural plan’s south.
  2. Select the VRaySun node – ‘VRayGeoSun1‘ and in its attributes un-check Manual Position.
    This will make the location / date / time parameters accessible.
  3. Set the GMT zone of you architectural project’s location in the world, the Date and time.
    * haven’t found how to set daylight saving time….

Untitled-1

Related:
V-Ray for Maya Physical Camera
V-Ray for Maya White Balance
Daylight system addon for Blender

V-Ray for Maya toon shading

Software:
Maya 2018 | V-Ray 3.6

Toon shading in V-Ray consists of two elements:

  1. A VRayToon node that creates a graphic contour effect on the rendered image.
  2. A flat shader that uses surface luminance data to define color areas.
    * A VRayLightMtl can be used for that.

Creating the VRayToon node:

  1. Click the Create V-Ray Toon button in the V-Ray toolbar to create a VRayToon node.
  2. In the VRayToon node attributes, set line thickness, color, and more graphic properties.
    * if you created a VRayToon node and it’s not selected RMB click the Create V-Ray Toon button in the V-Ray toolbar and choose Select VRayToon node.
    * To delete the VRayToon node, select it and press Delete.

Creating the toon shader:

  1. Create a VRayLightMTL node as the object’s surface shader.
  2. Create a Ramp texture node, connect it’s output color to the VRayLightMTL’s color input and delete it’s accompanying 2D placement node.
  3. Create a surfaceLuminance node and connect it’s output to the Ramp node’s V Coord input.
  4. Optional remapValue node between the surfaceLuminance node and the Ramp node to clamp the luminance values.
  5. Optional floatMath node to scale or manipulate the surfaceLuminance output value.

Untitled-1Untitled-2

Related:
Arnold for Maya Toon Shading

V-Ray for Maya with XGen

Software:
Maya 2018 | V-Ray 3.6

The technical steps needed to render XGen hair with V-Ray and a VRayHair3Mtl in Maya:

  1. in the Plugin Manager,
    Make sure the xgenvray.py plugin is loaded.
    * Needless to say vrayformaya.mll must be loaded too.
  2. Set a Project Folder and save the scene.
  3. In Render Settings, set the Renderer to V-Ray.
  4. Select an object or mesh elements and create an XGen Description.
    * This can be done by clicking the Create New Description button in the XGen tab or XGen Window.
  5. In the XGen Output Settings set the Operation to Render and the Renderer to V-Ray.
  6. Edit / Design / Groom your hair.
  7. In the XGen window, Choose File > Export Collections or Descriptions,
    And export the hair Collection and Description.
  8. in the XGen window, Choose File > Export Patches for Batch Render,
    To export the hair cache abc (alembic) file.
  9. In the Hypershade, create a VRayHair3Mtl shader.
  10. In the Outliner, select the XGen Description.
  11. In the Hypershade Browser window,
    RMB click the VRayHair3Mtl and choose Assign Material To Selection.
  12. Make sure there is a light source, and render the scene.

 

Related:
V-Ray for Maya and nHair

Untitled-1

Untitled-1.01

Untitled-1.1.1.jpg

Untitled-2

Untitled-3

Untitled-3.1.jpg

Untitled-4

Denoising animations in V-Ray for Maya

Software:
Maya 2018 | V-Ray 3.6

Animated sequences require ‘Temporal Denoising’ in order to achieve a flicker-less result.
‘Temporal Denoising’ means that in addition to taking into account neighboring pixel data, the denoising process also takes into account pixel data from adjacent frames in the animation.
For that reason, the V-Ray Denoiser render Element can’t simply be used during the render process like we can use it when rendering still images,
And the animation sequence is denoised after it has been rendered, and stored with extra data needed for the V-Ray Denoiser to work.

Update:
In V-Ray Next the vdenoise.exe tool has a GUI that allows loading sequences easily.
NXT_vdenoise.png

In versions of V-Ray prior to V-Ray Next the vdenoise tool has to be operated through command line with the following easy steps:

This is a very useful article on the subject from Dabarti studio:
http://dabarti.com/vfx/using-v-ray-denoiser-tool-vdenoise-exe-with-send-to-scripts/

General sequence denoising setup that has to be done just once:

1) Create a command line denoising script batch file, and store it in the Windows ‘Send to’ folder:
Write the following script to a new text file.
* this script is from an article by Tomasz WyszoÅ‚mirski – Dabarti Studio.

@echo off
set input=%1
set denoiser_input=%input:~0,-8%????.exr
"C:\Program Files\Chaos Group\V-Ray\Maya 2018 for x64\bin\vdenoise.exe" -inputFile="%denoiser_input%" -useGPU=2 -display=0
pause

Save the file named ‘Denoise Sequence.bat’ in the Windows Send to folder.
* to find the Windows Send to folder quickly open the Windows ‘run’ utility and type: shell:sendto.

Render setup for denoising:

2) In your Maya scene, In the Render Settings window, In Render Elements tab, add a Denoiser Render Element.

3) Select the vrayRE_Denoiser Render Element,
And in the Attribute Editor, under Exta V-Ray Attributes set ‘Mode’ to ‘Only Generate Render Elements’.
Capture

4) In Render Settings > Common > Image File Output:
Choose exr (multichannel)
Capture

5) Render the Animation.

Denoising the animation:

Right click the first frame of the rendered sequence,
And choose Send to > Denoise Sequence.bat

Related post:
Rendering an animation with Maya and V-Ray

Rendering an Animation in Maya and V-Ray

Software:
Maya 2018 | V-Ray 3.6

  1. Set a Project Folder or Image output path.
  2. In Render Settings > Common under Image File Output,
    Set a file name and format.
  3. In Render Settings > Common under Animation,
    Set Animation to Standard.
  4. Set the Maya UI to Rendering and choose Render > Render Sequence,
    Or simply press the Render Button in the toolbar.

Untitled-1

 

Related post:
Denoising animations with V-Ray for Maya

Randomize textures in V-Ray for Maya

Software:
Maya 2018 | V-Ray 3.6

Connect the different texture options as inputs to a VRayMultiSubTexNode and connect it to the wanted material input.
In the VRayMultiSubTexNode attributes, set Get ID From to Random by Render ID.
* Press add new item in the VRayMultiSubTexNode attributes to add one or more inputs to the list.

Untitled-1

Maya V-Ray GPU texture resizing

Software:
Maya 2018 | V-Ray 3.6

By default V-Ray for Maya, when Production Engine is set to CUDA (GPU), resizes all the textures to 512×512 in order to save GPU memory.
Naturally, this may cause the textures to appear blurry and lacking detail in the rendered image.

To avoid this,
In Render Settings > V-Ray tab > Production renderer,
Set GPU Resize Textures to Full Size Textures, so the textures will not be resized at all (but consume more memory),
Or On-demand mipmapping, so the textures data will be optimized to reduce memory consumption (but not quality) in a pre-render process.

Note:
To get full size textures in IPR mode, do the same in the IPR tab

Untitled-3

Untitled-2

Untitled-1.jpg

Using VRayMtlHair3 shader with nHair in Maya

Software:
Maya 2018 | V-Ray 3.6

  1. Select the nHair object.
  2. In the Attribute Editor, in the hair system shape attributes.
    Open the Attributes menu, and choose VRay > Hair Shader.
  3. Create a VRayMtlHair3 shader.
  4. Connect the shader to the Hair Shader slot under VRay Extra Attributes in the hair system Shape Node attributes.

Untitled-1

 

Related:
V-Ray for Maya and XGen