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 / Full screen shader issue (createRenderImage and renderToImage)

Author
Message
lilpissywilly
AGK Developer
13
Years of Service
User Offline
Joined: 10th Sep 2010
Location: Office Chair
Posted: 8th Jul 2014 13:19 Edited at: 8th Jul 2014 13:23
I've run into a problem when trying out some full screen shaders.

The thing is, when I'm using a landscape resolution it works fine.
For example:


Above example works as expected, great.

If I however turn the screen into a portrait, 720x1280 in this case. And do the same when creating the render image, it doesn't work right. I'll show it with a screen grab:




Edit: Yeah, fudged up a bit on that image, the top of the landscape view is cut off, but that one works right.

My hovercraft is full of eels

Attachments

Login to view attachments
Paul Johnston
TGC Developer
21
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 10th Jul 2014 15:52
It seems there is an issue with SetRenderToImage if SetScissor is not set to 0,0,0,0, but I'm not sure how it could be fixed. If you set that does it behave?
lilpissywilly
AGK Developer
13
Years of Service
User Offline
Joined: 10th Sep 2010
Location: Office Chair
Posted: 10th Jul 2014 17:09 Edited at: 10th Jul 2014 17:47
That appears to work. However there is something with SetSpriteScissor that seems to not work on the ImageRender. I have an energy bar that gets clipped from the top when the energy drops and instead it goes from the bottom up, but it also clips the sprite horizontally partially.

Edit: On another note, I'm trying to rotate the quad and that doesn't appear to work either. It works with having a sprite showing the render image. Is that a limitation of drawObject perhaps?

My hovercraft is full of eels
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 10th Jul 2014 17:23
Paul, I have problems with render to image in 3D too. Z depth gets really messed up on primitives... If you create a bunch of textured planes you'll find they are showing through each other in most circumstances. Same with boxes.
Paul Johnston
TGC Developer
21
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 10th Jul 2014 17:58
Quote: "there is something with SetSpriteScissor that seems to not work on the ImageRender"


This would affect all scissor commands since the scissor coordinates are set for the original display but the render image has different dimensions, so I'll have to find a way to translate the coordinates without affecting the final render.

Quote: "I'm trying to rotate the quad and that doesn't appear to work either"


Quads can't be rotated, they are optimized to fill the entire screen.

Quote: "I have problems with render to image in 3D too. Z depth gets really messed up on primitives"


Do you have an example I can take a look at?
lilpissywilly
AGK Developer
13
Years of Service
User Offline
Joined: 10th Sep 2010
Location: Office Chair
Posted: 10th Jul 2014 18:50
Thanks Paul for the swift answers.

I'll just use a workaround to the setSpriteScissor if I want to use renderToImage for now.

My hovercraft is full of eels
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 13th Jul 2014 22:56
Quote: "Do you have an example I can take a look at?"

I'll re-send the email I sent previously.
lilpissywilly
AGK Developer
13
Years of Service
User Offline
Joined: 10th Sep 2010
Location: Office Chair
Posted: 16th Jul 2014 17:45 Edited at: 16th Jul 2014 19:13
Got a bit of a new issue now that I've started testing on a phone.

It seems like the image that is rendered is cropped on all sides on the phone while it's perfect on PC.

I'm projecting the image onto a plane and setting the size of the plane and the camera position as to perfectly fit the screen, it works very well on PC.

The reason for the plane is I'm rotating it.

Moving the camera to show more did not work on android, it's still cropped.

My hovercraft is full of eels

Login to post a reply

Server time is: 2024-04-20 05:40:43
Your offset time is: 2024-04-20 05:40:43