Code Monkey home page Code Monkey logo

Comments (4)

Hopson97 avatar Hopson97 commented on May 21, 2024

Good issue. I believe this would also happen with leaf blocks.

Also your solution makes sense. A flag like "isOpaque" could be added, allowing the meshbuilding to code to add faces when it is set to false.

from open-builder.

GrossoDev avatar GrossoDev commented on May 21, 2024

It might be necessary to specify which faces have to be rendered. Not only because of optimization reasons (1 extra face vs all 6 faces), but because the faces inside water shouldn't be rendered, only the faces that contact with other blocks.

I'll be working on implementing this, if that's not a problem of course.

from open-builder.

Hopson97 avatar Hopson97 commented on May 21, 2024

That is fine :)

It might be necessary to specify which faces have to be rendered.

This is true, for now though (to keep things nice and simple, and the face I don't have anything like stairs or slabs in the game for now), it could just be all faces.

but because the faces inside water shouldn't be rendered,

IIRC, the chunk meshing code will not add block faces if the neighbour block is the same (This is what allows the terrain faces to render underwater, while "underwater faces" are not rendered)

from open-builder.

GrossoDev avatar GrossoDev commented on May 21, 2024

Good news:

image

Bad news (but hey, the trees are visible underwater :D):

image

This happens inside the water, where the back-faces appear, because isOpaque afects all faces.

It gets spaghetti to hardcode the water not to render its sides when isOpaque == false, so fluids will always render their top face for now.

Until the stair update comes around, I'll be preparing a fix/faces-not-rendering-through-gaps branch with a (hopefully) proper solution.

from open-builder.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.