Hey.
I found the following thread...
https://forum.thegamecreators.com/thread/216625
in which Janbo tried getting depth rendering working, but it failed. Paul noted that a bug existed, however the bug still seems to be there, or at least for me. The below code should render a simple scene, witha depth image in the corner. I'm getting a totally white sprite, which suggests the depth buffer is always reporting zero depth?
// show all errors
SetErrorMode(2)
// set window properties
SetWindowSize( 1024*2, 768*2, 0 )
SetWindowAllowResize( 1 ) // allow the user to resize the window
// set display properties
SetVirtualResolution( 1024, 768 ) // doesn't have to match the window
SetOrientationAllowed( 1, 1, 1, 1 ) // allow both portrait and landscape on mobile devices
SetSyncRate( 30, 0 ) // 30fps instead of 60 to save battery
SetScissor( 0,0,0,0 ) // use the maximum available screen space, no black borders
UseNewDefaultFonts( 1 ) // since version 2.0.22 we can use nicer default fonts
//brick_tex=loadimage("brick.png")
//ground_tex=loadimage("ground.jpg")
myfloor=CreateObjectPlane(200,200)
RotateObjectLocalX(myfloor,90)
//setobjectimage(myfloor,ground_tex,0)
cube=CreateObjectBox(50,50,50)
setobjectposition(cube,-50,25,50)
//setobjectimage(cube,brick_tex,0)
sphere=createobjectsphere(50,15,15)
setobjectposition(sphere,50,25,50)
//setobjectimage(sphere,brick_tex,0)
cube2=createobjectbox(500,500,500)
SetObjectCullMode(cube2,0)
SetCameraPosition(1,0,25,0)
setcameralookat(1,0,25,0,0)
MoveCameraLocalZ(1,-100)
depth_img=CreateRenderImage(1024,768,1,0)
depth_sprite=createsprite(0)
setspritesize(depth_sprite,1024/4,768/4)
setcamerarange(1,0.01,2000.0)
do
setrendertoimage(0,depth_img)
clearscreen()
render3d()
setrendertoscreen()
setspriteimage(depth_sprite,depth_img)
Print( ScreenFPS() )
Sync()
loop