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 / Using RenderToImage() to capture a 3D scene seems to have depth issues

Author
Message
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 1st Aug 2017 05:01 Edited at: 1st Aug 2017 05:04
I am using RenderToImage() to capture a 3D scene. The car at top left is a screen capture of the main screen. As you can see there appears to be a depth problem.
I am thinking i need to use some sort of depth command but i can't seem to find it. I have attached the project

Attachments

Login to view attachments
janbo
15
Years of Service
User Offline
Joined: 10th Nov 2008
Location: Germany
Posted: 1st Aug 2017 08:19 Edited at: 1st Aug 2017 08:25
Looks like the window is transparent ?
So you used SetObjectTransparency() on this object I guess ?
Transparent objects don't write to the depth buffer.
You can enable depth writing with SetObjectDepthWrite()


Uh, just saw the project

Aah, you write the RGBA data to the rendertarget, but you don't write the depth buffer for it:
SetRenderToImage(renderImage, -1) the -1 writes to the internal Buffer.

Using AGKv2 Tier1
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 1st Aug 2017 08:39
Awesome! Thanks again janbo

Login to post a reply

Server time is: 2024-09-30 05:41:46
Your offset time is: 2024-09-30 05:41:46