Jump to content

Fool the Frustum Culling


Pryme8
 Share

Recommended Posts

https://www.babylonjs-playground.com/#3D3RPL#32

I am assuming the frustum culling is based off of boundingbox.   Because all the blades of grass are positioned dead center and are offset in the shader when you look side to side the blade will disappear from the rendering list when the center of the zone is obfuscated/out of range.

Is there a way around this, I was kinda thinking I could manually adjust the bounding box and that might do it but Im not sure.


*BONUS POINTS*
If you set the density too high, it gives an error... how do you enable higher polycounts again?

https://www.babylonjs-playground.com/#3D3RPL#34

Link to comment
Share on other sites

Got it.
https://www.babylonjs-playground.com/#3D3RPL#37

with this workaround:

var _bb = new BABYLON.Mesh.CreateBox('tempBox', 1, scene);
_bb.scaling = new BABYLON.Vector3(this.args.zoneSize.x, this.args.bladeHeight*2.0, this.args.zoneSize.y);
_bb.position.y = (this.args.bladeHeight*2.0)*0.5;
_bb.bakeCurrentTransformIntoVertices();
 
mesh._boundingInfo = _bb._boundingInfo;
_bb.dispose();
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...