Table of Contents

Scripts > BakeLightOntoTexture

Description A script to bake the light map onto the texture map.
Author Aaron
Created 2010/05/24
Requires L3DT v2.9 beta 2 or later.
Download BakeLightOntoTexture.zs

Script contents

// check lightmap
hvar hLM hTX
set hLM <GetMap "LM">
set hTX <GetMap "TX">

assert <map.GetWidth hLM> "Light map is not initialised!"
assert <map.GetWidth hTX> "Texture map is not initialised!"

// store a backup
L3DTio_Backup.ExtBackupMap "TX" "Bake LM onto TX" 0 "view.ShowMap \"TX\""

// apply the overlay
ZeoImage.StretchDrape hTX hLM 80

// show the texture
view.ShowMap "TX"

Comments

None.