Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / DEPTH BUFFER SetRenderToImage() working ???

Author
Message
OminusPrime
9
Years of Service
User Offline
Joined: 30th Jun 2015
Location:
Posted: 10th Nov 2016 23:14
Hi Everone.
Im rendering the depth of a scene to an RGBimage using a shader, then im using this shader for depth testing. it works but the depth resolution is limited to a single channel of the RGB.
i would rather render the 32bit depth buffer direct to an image and send that. I see that AppGameKit can do it but it doesn't seem to be working???

//As a test
// i created a couple of images one set to rgb and the second for rendering depth
CreateRenderImage (2,2048,2048,0,0) //rgba
CreateRenderImage (3,2048,2048,1,0) //depth

//I render the scene using the render to image like this
SetRenderToImage(2,3)
//where the color info goes to image 2 and the Z depth goes to image 3
//The color is working fine. but the Depth buffer seems to be empty, no depth information at all.

Is this a broken feature of AppGameKit ????? for people writing shaders this is extremely important.
Paul Johnston
TGC Developer
22
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 28th Nov 2016 17:36
It should work, how are you accessing the depth buffer image? Note that currently only 3D objects use the depth buffer.
Preben
AGK Studio Developer
20
Years of Service
User Offline
Joined: 30th Jun 2004
Location:
Posted: 29th Nov 2016 17:33
I tried it and on Mac , displaying the generated depth buffer using a sprite , and everything is "white", also tried to save the image to see if there was something in the alpha but nothing.

The scene is rendered as normal , but it looks like its still using the 16bit Mac depth buffer (-1) and not the depthImage selected in SetRenderToImage.

But then again the generated depthImage its WHITE so something is going into it ?

best regards Preben Eriksen,

Login to post a reply

Server time is: 2024-11-24 22:56:30
Your offset time is: 2024-11-24 22:56:30