PDA

View Full Version : Rendering Z-Depth


Gibbz
01-29-2009, 01: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

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

CGTalk Moderation
01-29-2009, 01: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.