Jump to content

Make Only certain boxs render


Pryme8
 Share

Recommended Posts

http://www.babylonjs-playground.com/#CQJMX#0

How can I stop the boxes that are not needed to be displayed because they are covered by other blocks not compute?

If i increase the grid size to like 32 or even 64 then it lagggggggsssss....  especially if I increase the height. There is a lot of useless script in there I whipped this up in like 20 mins just to get the idea down, now I want to extend and refine it.

Link to comment
Share on other sites

we need to re-run (press back on RUN after first load) your PG because the perlin noise script is not loaded.

Btw, you don't need to write "new" before the calls to "CreateXXX()" what are static methods.

If you want to set a mesh as invisible "mesh.isVisible = false;" should do the trick.

In your PG, actually you create many (2000+) similar meshes (boxes). Maybe you should consider using "instances" instead : http://doc.babylonjs.com/tutorials/How_to_use_Instances

or a solid particle system : http://doc.babylonjs.com/overviews/Solid_Particle_System

Both will render only one mesh ;)

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