FastBlurredShadows

From Odwiki

Jump to: navigation, search


Contents

Using ShadowMaps

You can render a shadow map to disk, and then use that as a basis for a Shadow SHOP (SHader OPerator). The benefits are that you then don't have to render shadows each time, and you can manipulate them and easily blur them. In Houdini 9.0, the generic Light makes this a lot easier and some of this might be unnecessary, although the concept remains the same.

Create a light

In the Shading tab (towards the bottom), change Shadow Shader from "No Shadow" to "Z (Depth Map) Shadow".

We want to render the ShadowMap to disk, so in the Shading tab (near the top) change Depth Map from "No Auto-Generate Depth Map" to "Auto Generate (mid-point Z)". Then in the DepthMap field, type the location and filename to use for the shadow map. Apprentice users should use a file in .picnc format, as it will not contain the WaterMark.

Rendering Your Scene to generate ShadowMaps

This will create the shadow map file. Then, change Depth Map back to "No Auto Generate Depth Map", as you do not need to re-create the depth map each time (unless the scene changes).

In the object panel create a SHOP network. (tab -> SHOP). Right-click, and enter network.

Create a VEX Standard -> VEX Shadow operation (not VEX blur shadow).

Change Type from "Fast Shadow (Opaque)" to "Z-Depth". In the now-available Z-Depth Map field select the location and filename of your previously generated shadow map file.

Adjust the Z-Depth Softness value.

Finally, you need to go back to the object level and assign this shader to the light. On the light's Shader Tab, locate the SHOP Shader and select your newly created SHOP net's operation.

Rendering Your Scene using these DepthMaps

Go back into the SHOP network to adjust the shadow parameters to suit.

© 2009 od[force].net | advertise