Diplaced objects after a call to removeRenderTarget()

Started by XOrDo, February 11, 2013, 03:06:03 PM

Previous topic - Next topic

EgonOlsen

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.

kelmer

Quote from: EgonOlsen on February 24, 2013, 08:12:10 PMmaybe 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.

EgonOlsen

Quote from: kelmer on February 24, 2013, 08:37:44 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?

kelmer

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.

EgonOlsen

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...

EgonOlsen

Here you go: http://jpct.de/download/beta/jpct_ae.jar

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

kelmer

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  ;)

EgonOlsen

Quote from: kelmer on February 24, 2013, 09:32:12 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.

EgonOlsen

BTW: Could you edit the wiki entry when you find the time? That would be great.

kelmer

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.

EgonOlsen

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.

kelmer

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?

EgonOlsen

Quote from: kelmer 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?
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.

kelmer

Well then, it's done.

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