Notifications
Clear all
[Closed] Rendering Z-Depth
Jan 29, 2009 2:26 am
Im trying to render z-depth with a custom near and far range for my script, however I dont seem to be able to get it to work with my custom depth ranges…
-- paths stuff
mPath = scriptspath + "cam_depth.tga"
deleteFile mPath
tgaio.setColorDepth 24 --set to 24bit output!
-- output bitmap
mSize = 256
freeSceneBitmaps()
-- setup zdepth
mZDepth = Z_Depth()
mZDepth.enabled = true
mZDepth.zMin = 0.5
mZDepth.zMax = 1.5
mRenderManager = maxOps.GetCurRenderElementMgr()
mRenderManager.removeallrenderelements()
mRenderManager.AddRenderElement mZDepth
-- render
mRender = render camera:mRenderCam shadows:false renderhiddenobjects:false mapping:false rendertype:#normal channels:#(#zDepth) useRadiosity:false outputSize:[mSize,mSize] vfb:false superblack:true antiAliasing:false progressbar:true quiet:true
-- disable this after render
mRenderManager.removeallrenderelements()
-- mooch the depth
mDepthMap = getchannelasmask mRender #zdepth
-- open the rendered out bitmap!
display mDepthMap
1 Reply
Jan 29, 2009 2:26 am
ok this has something to do with the manual clip on my camera… all solved