Author Topic: Diplaced objects after a call to removeRenderTarget()  (Read 3069 times)

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11777
    • View Profile
    • http://www.jpct.net
Re: Diplaced objects after a call to removeRenderTarget()
« Reply #15 on: February 24, 2013, 08:12:10 pm »
It's not displaced...it's just that the framebuffer doesn't fit on screen. The origin is in the lower left corner and your buffer has a size of 897 while your screen can only display 720 pixels. I'm not sure why it fits when you don't render to texture...maybe you are using a different buffer size then? Anyway, i really don't think that using a framebuffer of that size will take you anywhere. Get a device with a much lower resolution and you'll see, what i mean...

About the offset: As the docs state, the offset has be in normalized coordinates, i.e. a value of 1 or higher will shift the while scene out of view.

Offline kelmer

  • byte
  • *
  • Posts: 43
    • View Profile
Re: Diplaced objects after a call to removeRenderTarget()
« Reply #16 on: February 24, 2013, 08:37:44 pm »
maybe you are using a different buffer size then? Anyway, i really don't think that using a framebuffer of that size will take you anywhere. Get a device with a much lower resolution and you'll see, what i mean...

No, I'm using the same buffer size... and I did try in a smaller device and the problem gets worse indeed. I'm baffled as to how to find a solution. Because if I use a smaller buffer size (i.e. 960x720, for a 4:3 ratio), I get only a portion of the screen rendered  and the plane gets smaller (although ONLY after rendering to texture, even using a 640x480 resolution works perfectly without that step, which keeps me puzzled). And using the whole screen resolution (1196x720) results in objects being deformed (due to the camera being 4:3 and thus the marker based on those proportions?).

I tried using the normalized values for the offsets, it does fix the problem in the display buffer although not for the texture. It does help moving further though. I will keep investigating.

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11777
    • View Profile
    • http://www.jpct.net
Re: Diplaced objects after a call to removeRenderTarget()
« Reply #17 on: February 24, 2013, 08:39:18 pm »
...it does fix the problem in the display buffer although not for the texture.
I don't get that part...what do you mean exactly?

Offline kelmer

  • byte
  • *
  • Posts: 43
    • View Profile
Re: Diplaced objects after a call to removeRenderTarget()
« Reply #18 on: February 24, 2013, 09:09:16 pm »
If I set a vertical offset I get the plane rendered where it should be. But in the texture, it's rendered without the offset. (I can see this after applying the shader, which "crops" the rendering outside that plane).

The offset seems not to be applied when rendering to texture.

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11777
    • View Profile
    • http://www.jpct.net
Re: Diplaced objects after a call to removeRenderTarget()
« Reply #19 on: February 24, 2013, 09:21:41 pm »
Looking at the engine's code, it explicitly doesn't apply the offset when using a render target. I'm not sure, why i did that...it'll remove that restriction, upload that version and we'll see...

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11777
    • View Profile
    • http://www.jpct.net
Re: Diplaced objects after a call to removeRenderTarget()
« Reply #20 on: February 24, 2013, 09:26:52 pm »
Here you go: http://jpct.de/download/beta/jpct_ae.jar

You have to set Config.viewportOffsetAffectsRenderTarget=true; to enable the change.

Offline kelmer

  • byte
  • *
  • Posts: 43
    • View Profile
Re: Diplaced objects after a call to removeRenderTarget()
« Reply #21 on: February 24, 2013, 09:32:12 pm »
I'll reply with an image


it works :)

Thank you very much, I've tried a few engines and their support forums, and I think you are by far the most helpful developer ever  ;)

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11777
    • View Profile
    • http://www.jpct.net
Re: Diplaced objects after a call to removeRenderTarget()
« Reply #22 on: February 25, 2013, 08:15:07 pm »
Thank you very much, I've tried a few engines and their support forums, and I think you are by far the most helpful developer ever  ;)
Thank you. I'm doing my very best.

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11777
    • View Profile
    • http://www.jpct.net
Re: Diplaced objects after a call to removeRenderTarget()
« Reply #23 on: February 26, 2013, 08:18:13 pm »
BTW: Could you edit the wiki entry when you find the time? That would be great.

Offline kelmer

  • byte
  • *
  • Posts: 43
    • View Profile
Re: Diplaced objects after a call to removeRenderTarget()
« Reply #24 on: February 26, 2013, 08:20:43 pm »
You mean by adding the part that sets the FB objects? If you don't change the render target then it works without that step, in fact if you do that step you get the wrong result.

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11777
    • View Profile
    • http://www.jpct.net
Re: Diplaced objects after a call to removeRenderTarget()
« Reply #25 on: February 26, 2013, 08:35:10 pm »
I'm still pretty sure that it's wrong even without the render target when not doing this step. It just works "by accident", i just can't remember why anymore. Anyway, adding that part would be a nice addition IMHO.

Offline kelmer

  • byte
  • *
  • Posts: 43
    • View Profile
Re: Diplaced objects after a call to removeRenderTarget()
« Reply #26 on: February 26, 2013, 08:56:46 pm »
I have no problem adding it, I just fear users will then complain about not getting the proper results. I can add it as an "if" section in case anyone encounters any of these problems, is that okay? Also, they would need the build you provided me with. Should I link directly to that version?

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11777
    • View Profile
    • http://www.jpct.net
Re: Diplaced objects after a call to removeRenderTarget()
« Reply #27 on: February 26, 2013, 09:28:06 pm »
I have no problem adding it, I just fear users will then complain about not getting the proper results. I can add it as an "if" section in case anyone encounters any of these problems, is that okay? Also, they would need the build you provided me with. Should I link directly to that version?
Yes, adding it as an "if" section shoulds good. And yes, just link to the beta. I'll fix that once the beta is final, which won't happen very soon.

Offline kelmer

  • byte
  • *
  • Posts: 43
    • View Profile
Re: Diplaced objects after a call to removeRenderTarget()
« Reply #28 on: February 26, 2013, 09:56:50 pm »
Well then, it's done.

Please take a look and do the pertinent corrections  :-\