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 / RenderToImage() appears to be inverting the depth

Author
Message
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 17th Mar 2019 23:06 Edited at: 17th Mar 2019 23:23
I have attached one of the models that is being inverted
I am trying to give my skyroads clone a pixely look so i am rendering to a screen image, then copying the area i want to scale up into the image used by a sprite that is scaled up by two.
Most of that is irrelevant because the problem is it appears that the depth has been inverted. One thing that is different to the way i have used RenderToImage() before is that the inverted
objects are all objects with children so i have used LoadObjectWithChildren() to create the shapes.
LOW REZ


HI REZ


This is my rezup code
canvas - The sprite that is scaled up x 2 (512x320)
screen - the renderrtoimage (1024x640)
lowrez - The image that is cut from the screen (512, 320)

Attachments

Login to view attachments
Bengismo
7
Years of Service
User Offline
Joined: 20th Nov 2017
Location: Yorkshire, England
Posted: 17th Mar 2019 23:28
SetRenderToImage(screen, 0) the 0 means your not using a depth buffer so no depth testing is used....

You could try

SetRenderToImage(screen, -1)


Id also consider rendering the captured image to a quad instead. And rather then chop the image....just set the screen image to the sprite and set the uv area to match the bit you want to show.

There are some great sprite pixel shaders for pixelising a high res image that have been posted up on these forums too.
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 17th Mar 2019 23:55 Edited at: 18th Mar 2019 00:02
*EDIT* : I added a clearscreen() as well and it worked so this code works


Thank you very much for your help Mr Gizmo

Attachments

Login to view attachments
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 18th Mar 2019 00:10
The 2D pixelate shader might be what you seek https://forum.thegamecreators.com/thread/222027?page=2

Its already been solved but my nightdriving code in the gamespack 1 does this for the stereoscopic view
fubar
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 18th Mar 2019 00:23
I will check that out. Thanks
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 18th Mar 2019 02:14 Edited at: 18th Mar 2019 02:15
Trying out your quad idea Mr Gizmo.
How do i make the quad appear in front of all the other objects and sprites?

Attachments

Login to view attachments

Login to post a reply

Server time is: 2024-11-23 02:00:54
Your offset time is: 2024-11-23 02:00:54