Comments (4)
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.
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.
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.
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)
- Noisy lightmaps HOT 8
- Assert fail on boundary check HOT 5
- Shadow baking HOT 3
- License HOT 3
- Any further documentation ? HOT 10
- Baking a thickness texture HOT 2
- readme.md: uvatlas is now on Github HOT 1
- Duplicate Normalize line in the lightmapper code
- TrianglePacker is nessary?
- Can I decide which lightmap gets baked? HOT 2
- Lightmapper generates weird grey-ish margin? HOT 1
- About Spherical Harmonics
- Radiosity Normal Mapping?
- Normals get transformed twice
- Slow?
- Proper obj format HOT 5
- Lighting setup guide HOT 4
- Normal oriented HOT 2
- Small request for help - lightmapper in Qt HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lightmapper.