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 / Need help grasping RenderToImage (full-screen shading)

Author
Message
lilpissywilly
AGK Developer
14
Years of Service
User Offline
Joined: 10th Sep 2010
Location: Office Chair
Posted: 25th Oct 2014 09:50 Edited at: 25th Oct 2014 09:51
Right. I've been doing some tests. What I want to achieve is to render the screen onto a plane that I can manipulate, and it works, but I can't grasp some of the things involved here.

Changing the size of the RenderImage does unexpected things, and the plane itself. Also I appear to get multiple versions of the screen pasted onto the plane because when I change the angle of the plane artifacts appear as if there are mirrored versions behind or in the plane.

About the sizing of the renderimage and the plane to display on. If I make the renderImage bigger, it doesn't all display on the plane no matter if I also make the plane bigger.

Code

Setup:


The main loop:


My render to plane function:





Some general understanding on what is going on here would be nice. I can't figure it out by testing because it behaves illogical to me.

My hovercraft is full of eels

Attachments

Login to view attachments
Hockeykid
DBPro Tool Maker
17
Years of Service
User Offline
Joined: 26th Sep 2007
Location:
Posted: 25th Oct 2014 10:27
Quote: "Also I appear to get multiple versions of the screen pasted onto the plane because when I change the angle of the plane artifacts appear as if there are mirrored versions behind or in the plane. "


Try hiding the plane when you are rendering to the image, then unhide it when rendering it to the screen.


Sean

lilpissywilly
AGK Developer
14
Years of Service
User Offline
Joined: 10th Sep 2010
Location: Office Chair
Posted: 25th Oct 2014 10:52
Quote: "Try hiding the plane when you are rendering to the image, then unhide it when rendering it to the screen.


Sean"


Nice catch, thanks. That was a bit silly.


Still wondering what's going on with the sizing.

My hovercraft is full of eels
Paul Johnston
TGC Developer
22
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 25th Oct 2014 19:56
I think for now render targets have to be a power of two in size, otherwise AppGameKit will increase the render target to the nearest power of 2 and mess up the layout.
lilpissywilly
AGK Developer
14
Years of Service
User Offline
Joined: 10th Sep 2010
Location: Office Chair
Posted: 25th Oct 2014 23:11
Righto. I'll keep that in mind

My hovercraft is full of eels

Login to post a reply

Server time is: 2024-11-25 09:33:07
Your offset time is: 2024-11-25 09:33:07