View Full Version : Rendering Z-Depth

01 January 2009, 02: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

-- setup zdepth
mZDepth = Z_Depth()
mZDepth.enabled = true
mZDepth.zMin = 0.5
mZDepth.zMax = 1.5
mRenderManager = maxOps.GetCurRenderElementMgr()
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

-- mooch the depth
mDepthMap = getchannelasmask mRender #zdepth

-- open the rendered out bitmap!
display mDepthMap

01 January 2009, 02:39 AM
ok this has something to do with the manual clip on my camera... all solved :)

CGTalk Moderation
01 January 2009, 02:39 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.