Jump to content

Objects stretched when canvas resized if AAF activated


Vousk-prod.
 Share

Recommended Posts

Hi everyone,

 

I've just noticed something strange and a little annoying :

 

When the canvas is resized (after window resizing, or in responsive webpage, also when changing orientation on smartphone or when the engine goes fullscreen), the engine is correctly resized and everything is ok. But when I put some antialisas filter on my camera

camera.attachPostProcess(new BABYLON.FxaaPostProcess("fxaa", 1.0, camera, BABYLON.Texture.TRILINEAR_SAMPLINGMODE, _ENGINE, true));

on canvas resizing the whole scene is awfully stretched (it seems to keep the previous aspect ratio to recalculate the scene).

 

Any idea why and how I can prevent that ?

Link to comment
Share on other sites

I also have had weird re-size issues in the Voice-Sync Recorder I have been working on.  Not an issue I am worried about since it is a developer tool, not an end customer game.  Found I had to use tables-spans-(aligns & widths inside of td's) to group form controls with a canvas to get it to layout correctly on load, since div tags did not work at all. 

 

It is fixed by just reloading after resizing, but this is not feasible for all applications.  Could be doing something wrong, but I have so many things that are a higher priority than this.

 

Jeff

Link to comment
Share on other sites

In fact my code is not exactly the one I wrote here, I was using a reusable pp because I assign the new BABYLON.FxaaPostProcess to a aaf variable I attach to the camera in an other part of the code, and sometimes I detach the pp and reattach it later, so I thought I need to use a reusable pp, but maybe I misunderstood the "reusable" concept : is this for use on many different cameras, or for multi use on one same camera ?

 

(btw, how did you format the piece of code you have posted to have it beautifully colored ? when I use the "code" tag it simply put it in a rectangle but not color syntaxing... :huh: )

Link to comment
Share on other sites

And for the stretching problem, I've just double check and....  you're right, it works !! :) .... since babylon.2.0-alpha :lol:

 

I didn't notice because for now I haven't updated my scenes to this new version (because compared to previous version it's 150Ko heavier, and I'm concerned with the loading speed and data amount people will have to download to their phones. BTW is their a plan to one day split the library in some parts so that if we don't use one aspect for a project we can load only relevant part ? for now it's not so required but when bjs will be 1Mo or more, for instance).

Link to comment
Share on other sites

Erm, I'm already using this button, I certainly need to have some rest... :wacko:  I'm a little blind I think cause I never noticed that the text inside the "code rectangle area" is syntax-colored...

What appears strange to my eyes is that you managed to put some colorfull code without this "code rectangle" around... that looked just too magical... :)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...