Coder Social home page Coder Social logo

Comments (10)

curioustorvald avatar curioustorvald commented on August 28, 2024

It seems the tiling shader (or something else) is just overwriting the window when each layer is drawn.

from terrarum.

curioustorvald avatar curioustorvald commented on August 28, 2024

Currently the render now accepts FBO as an input, and that FBO is the one that the terrain is being drawn. Should be easy right? Blend terrain (a thing drawing now) over the wall (what's on the FBO). But can't get it to work, either my assumption is wrong or I missed a tiny little part, or use multiple FBOs which I want to avoid.

from terrarum.

curioustorvald avatar curioustorvald commented on August 28, 2024

Come and think of it, Torches and Clear Glasses (completely transparent) work, but regular Glass (semitransparent) won't? WTF?

from terrarum.

curioustorvald avatar curioustorvald commented on August 28, 2024

It must be fboRGB_lightMixed.inAction part that something is wrong as using separate FBO for wall and terrain made the same result.

from terrarum.

curioustorvald avatar curioustorvald commented on August 28, 2024

fboRGB itself is okay. Download TGA extractPastebin Base64 (filetype: gz)

Edit: NO it isn't; look at the alpha channel, it should contain no semitransparency but this one does.

from terrarum.

curioustorvald avatar curioustorvald commented on August 28, 2024

Adding more test set
FBO and screenshot ZIPPastebin Base64 (filetype: pkzip)

As you can see, alpha channel is not quite right, as if something went wrong in the blending.

Unrelated note: the rim of the Clear Glass is wrong, I should've not put the transparency on the reflection.

from terrarum.

curioustorvald avatar curioustorvald commented on August 28, 2024

Gdx.gl.glBlendEquationSeparate(GL20.GL_FUNC_ADD, GL30.GL_MAX) seems to do the trick, but now Crude Glass look like a sunscreen glass when placed against the open air. Also, use GL30 just for this? It kinda works but not optimal...

Edit: No, it doesn't do a trick.

from terrarum.

curioustorvald avatar curioustorvald commented on August 28, 2024

the separated equation AND setBlendFunctionSeparate(GL20.GL_SRC_ALPHA, GL20.GL_ONE_MINUS_SRC_ALPHA, GL20.GL_SRC_ALPHA, GL20.GL_ONE) seems work? (requires newest GDX nightly 20190112)

Then what about alpha premul?

Answer: still need to be premultiplied

from terrarum.

curioustorvald avatar curioustorvald commented on August 28, 2024

now it works without BlendEquationSeparate? What the hell man.

from terrarum.

curioustorvald avatar curioustorvald commented on August 28, 2024

In summary: Using batch.setBlendFunctionSeparate seems to done a trick, and it requires latest GDX build. I'm closing the issue now but if any unintended behaviour occurs, please re-open.

from terrarum.

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.