Jump to content

Bug with preprocess function of BABYLON.Scene


rixdeturcan
 Share

Recommended Posts

Hello,

 

I'm an user of your great webgl framework. Actually, i'm trying to reproduce some realistic environement.

In order to realize an ocean, i useda grid uniformly sampled in the eye space, then projected on the world Y-plane.

 

To do that efficiently, I precompute the border positions of the tetragon out of the shader, then I interpolate in the shader linearly using the uv coordinates.

 

To precompute them, I use the camera transform matrix (which I invert). This is done in the preprocess of the render function (BABYLON.Scene.beforeRender)

 

I saw that if I move the camera fastly, there is a strange sliding effect of the plane, as it was late in time.

I investigated, and saw that the transform matrix used in the render is not the same that the one in the preprocess !

 

I've found the source : the function BABYLON.Scene.setTransformMatrix is called for each cameras after the preprocess function: There is an issue I think.

 

To solve that, I think that we should be able to register a preprocess function for each camera, in addition to the actual global preprocess function, which does not depend on the camera.

 

What do you think about this fix ?

 

Cordialy

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