Giter Site home page Giter Site logo

Comments (4)

ands avatar ands commented on September 25, 2024

Hey,

from my experience it is fairly common that OpenGL libraries expect OpenGL to be in pretty much its default state upon calls to the lib (unless stated otherwise).
I can add this as a comment to the library to avoid confusion though :)

Do you have a good architectural reason for handling state in the lib?
Fixing/resetting the whole OpenGL state machine on each call would be quite a bit more than just resetting GL_BLEND. I don't think this should be part of all the library calls. The user knows best what states were changed and need to be reverted.

Kind regards,
ands

from lightmapper.

ziocleto avatar ziocleto commented on September 25, 2024

Yes I think you can see it both ways, from my experience exposing a functionality in a lib should work deterministically, and be state agnostic. I think best/standard practice is to save/restore openGL states to keep determinism.

In my case I have a PBR rendering pipeline doing normal work then if/when required I spawn up a lightmap calculation (btw great code yours I like a lot your GPU solution). Usually the state in which openGL stack is upon request is not very easy to guesstimate. We also use imGUI as backdrop debug tool and they too have save/restore states.

PS: I'm using thekla to generate mesh charting on the fly, do you use their generated uv's as your primary uv for the scene_t, vertex_t inputs in your example.c sample? I think I'm still missing a connection in there as the lightmaps won't be generated correctly yet.

Cheers,
Dado.

from lightmapper.

ands avatar ands commented on September 25, 2024

I'll take another look at dear imgui and see if I can afford to do the same here :).

Yes, I used thekla_atlas to generate the uv set for the example.
If you want, you can open another issue and show me the problems that you get.

Best regards,
ands

from lightmapper.

ziocleto avatar ziocleto commented on September 25, 2024

Thanks, I'm 100% sure it's something wrong in my code anyway, I might open another issue to ask you how to deal with multiple bounces once I dig deeper in the code. (We are replacing our old SH pipeline so we are evaluating few alternatives)

Cheers,
Dado.

from lightmapper.

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.