Git Product home page Git Product logo

Comments (1)

SomaZ avatar SomaZ commented on September 26, 2024

Current implementation uses glRead to compare the view depth to the view distance of the flare to decide if you should render the flare or not. glRead is a blocking command though, as it needs to sync the gpu and the cpu to get the current view depth.

I want to replace this with an additional flare visibility FBO with an attached 1D texture. The 1D textures width would be the number of flares of the current map.

This FBO will be updated every frame after the depth prepass. We can bind the depth buffer to a texture unit and test in a fragment shader if the flare would be visable or not. If the flare is not visable, write a value of 0.0, else add some_magic_value/frame_time. Could also extend the depth testing to multiple pixels to account for partial occlusion of the flares.

Finally, the flare could be rendered with the rendered flare visibility texture.

Atlasing all the flare images per map would also be nice, so we can render all flares with one draw command.

from openjk.

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.