Author Topic: FrameBuffer resize  (Read 2097 times)

Offline kkl

  • float
  • ****
  • Posts: 291
    • View Profile
FrameBuffer resize
« on: February 05, 2013, 04:48:18 pm »
Hi I'm trying to resize the framebuffer from (800, 600) to (360, 600), but any object located outside of (360, 600) bound is clipped. Is it possible to resize the framebuffer while objects are still displayed beyond the resized bound?

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11777
    • View Profile
    • http://www.jpct.net
Re: FrameBuffer resize
« Reply #1 on: February 05, 2013, 05:40:26 pm »
 ??? I don't get it...you want to resize it but you also want to render objects outside of the resized buffer? I don't understand....

Offline kkl

  • float
  • ****
  • Posts: 291
    • View Profile
Re: FrameBuffer resize
« Reply #2 on: February 06, 2013, 08:10:52 am »
Yea. The reason I'm doing that is to simulate android live wallpaper in pc so that object's scale factor and location stays the same in both platforms for easier development. The resized buffer represents the device screen while outside of boundary represents the entire live wallpaper. I tried simulating it by changing camera frustum, but I'm not sure how. Perhaps I'm not doing right? Or is there any alternative? Thanks.

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11777
    • View Profile
    • http://www.jpct.net
Re: FrameBuffer resize
« Reply #3 on: February 06, 2013, 08:38:30 am »
I still don't get it...maybe a drawing might help.

Offline kkl

  • float
  • ****
  • Posts: 291
    • View Profile
Re: FrameBuffer resize
« Reply #4 on: February 06, 2013, 09:56:31 am »
I tried to upload some pics, but it doesn't hav the attachment option to upload in the new forum. ;( There is "Choose file" option in jpct android forum though.
« Last Edit: February 06, 2013, 10:00:24 am by kkl »

Offline kkl

  • float
  • ****
  • Posts: 291
    • View Profile
Re: FrameBuffer resize
« Reply #5 on: February 06, 2013, 01:27:43 pm »
I posted the drawings in JPCT-android forum anyway~






The first image is the one I would like achieve while the second image is the one without framebuffer resizing.

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11777
    • View Profile
    • http://www.jpct.net
Re: FrameBuffer resize
« Reply #6 on: February 06, 2013, 08:57:07 pm »
I see...what's wrong with calling buffer.resize(360,600); ? It's not meant to be used for that, but it actually does what i think you want. It limits the viewport to (0,0)-(360,600) and adjusts yFov accordingly.

BTW: I've checked board permissions...the old board (once imported from phpBB) seemed to have different permissions than the new ones (which were all set to "default"). I've set them all to "default" now. Maybe that fixes the problem with the image upload.

Offline kkl

  • float
  • ****
  • Posts: 291
    • View Profile
Re: FrameBuffer resize
« Reply #7 on: February 07, 2013, 04:25:59 pm »
Yea. I guess I'm using the wrong way to do it. Any good suggestion for that case? Perhaps changing the viewport and adjust yFov manually?

p/s: The fix works. Now I see the "Choose file" option.

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11777
    • View Profile
    • http://www.jpct.net
Re: FrameBuffer resize
« Reply #8 on: February 08, 2013, 10:16:48 am »
By default yFov adjust automatically to ensure that it fits the xFov without distorting the rendered objects at the given resolution. It's the same on Android, so i'm still failing to see the problem... ???

Offline kkl

  • float
  • ****
  • Posts: 291
    • View Profile
Re: FrameBuffer resize
« Reply #9 on: February 11, 2013, 02:51:16 pm »
Well~ It's not really a problem though... I think it works perfectly... Just that if I could adjust manually for viewport, it would be easier for me to develop android app in pc (like game engine). It's ok.. I'll just use whatever available.. Thanx alot ;)