Skip to content

ExamplesImagesIrradianceMap

Ben Toogood edited this page Jun 13, 2013 · 2 revisions

Introduction

This example uses !ImageConvolveOp to build an irradiance environment map from a given environment map image. It convolves image channels using Spherical Harmonics with any given number of bands. Using 3 bands you get diffuse irradiance environment maps. Using more bands you get sharper maps ( for specular convolution ).

Based on "An efficient representation for irradiance environment maps." by Ramamoorthi, Ravi and Hanrahan, Pat - 2001.

Creating an irradiance map

The code below requires changing the the input and output images files.

import IECore

convolve = IECore.ImageConvolveOp()

envMap = IECore.Reader.create( "/myPath/inputImage.exr" )()

irradianceMap = convolve( input = envMap, bands = 3, samples = 100000 )

IECore.Writer.create( irradianceMap, "/myPath/outputImage.exr" )()
Clone this wiki locally