Giter Site home page Giter Site logo

Comments (4)

MartinSStewart avatar MartinSStewart commented on July 28, 2024 1

Maybe a phantom type could be used to prevent the misconfiguration? Adding a stencil/depth check to an entity forces it to have a specific extension record as a phantom type (i.e. { a | needsStencil : (), needsDepth : () }) and then the option to add that must be included in WebGL.withHtml.

from webgl.

w0rm avatar w0rm commented on July 28, 2024

@MartinSStewart i investigated this, seems that inconsistent behavior is because the depth buffer is disabled in toHtmlWith, but the depth test is performed by the entity.

I wonder what should be the result of a depth test if there is no depth buffer ? Perhaps different browsers interpret this differently

from webgl.

MartinSStewart avatar MartinSStewart commented on July 28, 2024

Yeah, it seems like it's browser specific (hence why I get difference results on Chrome and Firefox). I think the solution to this would be to make sure whatever happens, it's consistent between browsers?

from webgl.

w0rm avatar w0rm commented on July 28, 2024

I am not sure how important is to fix browser inconsistencies in the case of misconfiguration. Perhaps the documentation could be better to prevent this? The somethingWith functions are meant for advanced usage where it may be ok to assume folks know what they are doing.

Alternatively maybe the WebGL API could be changed to prevent this. Maybe different versions of toHtml that pass down something similar to the Key from elm/browser, that is necessary to create the depth test or stencil test settings for entities. This would complicate the API quite a bit.

Or the implementation — if there is an entity with the depth test in the list of entities — the depth buffer is getting automatically turned on. This can only happen on the first render though. Doing this implicitly may be a bit weird.

from webgl.

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.