How do I Disable useless 3D Faces?

0 favourites
  • 6 posts
From the Asset Store
Cat Face
$199 USD
Match the cat face, brain game with funny cat faces
  • Hello. What I am currently doing is playing with Advanced Random and 3DShape plugins. Of course I have tried to make some kind of Minecraft's terrain generation, and the result satisfies me.

    However, the lack of performance pushed me to the idea of ​​optimization. One of the ideas was to disable faces that collide with each other.

    So, what can I do to achieve this? Any ways to check "If 3DShape on %side%" or something? Thanks for advice!

  • Well you can set a face as being visible/invisible, but the sorting for that would have to also be optimized. It definitely wont be happening every tick. The formula for picking faces shouldn't be real hard since you have the camera angle, and can cast from that to figure out which faces aren't looking at the camera.

    Occlusion culling is another matter...

    You should also look at offscreen culling as well.

    Also don't forget we have depth shaders now, although I don't believe they will help with optimization.

    Something like Minecraft can be done, but I think it will have to be on a much smaller scale, with way way less cubes.

  • It should be pretty straightforward, assuming those boxes are created from some other data source. If you have something like an array representing where boxes are, when creating a box, you can just check if each of the adjacent six sides also has a box - if so, set that face to invisible. Then you'll end up with only the outer faces of the 3D shapes set to visible across the entire level.

  • Unfortunately, I didn't handle it. Seems too complicated for me.

    I would be very glad if someone could help me and do this. Thanks a lot!

    .c3p's attached

    drive.google.com/file/d/1vteALHtVnmeg78QsvM7r32BkxfK1toaf/view

    Thanks again

  • You can switch face visibilities according to the player position.

    Do it only when the player is moving.

    For example:

    If moving up or down:

    Set top face invisible

    Set bottom face invible

    Then:

    -If 3dcamera z-elevation is greater than 3Dshape z-elevation + 3dshape z-height: set top face visible

    -If 3dcamera z-elevation is less than 3Dshape z-elevation: set bottom face visible

    This applies only to static 3Dshapes.

    Apply same logic for X and Y positions.

    Object-wise culling should be way more interesting though, but much harder to achieve.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Hello, thanks for reply!

    I've just implemented your method, and it worked! But it seems to be even more laggier than without any tweaking..

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)