Jump to content

  • Log In with Google      Sign In   
  • Create Account

Banner advertising on our site currently available from just $5!


1. Learn about the promo. 2. Sign up for GDNet+. 3. Set up your advert!


Scale up viewport to fit window.


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
2 replies to this topic

#1 Hintze   Members   -  Reputation: 121

Like
0Likes
Like

Posted 26 August 2014 - 01:29 PM

Hey guys!

I got a little problem that hopefully is an easy to solve one.

I am using a mbp with a retina screen so when i in glfw call to create a window it creates one with twice the size of the parameters i send in. 

I have implemented deffered rendering so i tried creating the textures with my desired resolution(half the size of the actual framebuffer). If I create my viewport with my desired resolution I only get a quarter of the screen when i draw out. But if I create a viewport with the actual frame buffer size I can scale up the texture but the center of the screen is somehow in the top corner, as if i try to move towards an object i move diagonally towards the top right corner.

 

Hope someone can shed some light on this one :)

 

thanks for your time!

//Hintze



Sponsor:

#2 L. Spiro   Crossbones+   -  Reputation: 18921

Like
0Likes
Like

Posted 26 August 2014 - 02:20 PM

Fix your projection matrix or, if you are just rendering a 2D texture, don’t even use a projection matrix and use vertex coordinates from -1 to 1.

There isn’t much else to say unless you post some code.

 

 

L. Spiro



#3 Hintze   Members   -  Reputation: 121

Like
0Likes
Like

Posted 31 August 2014 - 07:57 AM

I figured out one way to solve it and thought i share it if someone ever gets the same issue.

I simply made a viewport with the desired texture resolution and then rendered into the texture and then before drawing the texture to the screen resizing the viewport to the actual window size and then scaling the texture up in the shader.

 

//Hintze






Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS