RenderKit / ospray

An Open, Scalable, Portable, Ray Tracing Based Rendering Engine for High-Fidelity Visualization
http://ospray.org
Apache License 2.0
981 stars 178 forks source link

Generating Lightmaps? #318

Open oschakravarthi opened 5 years ago

oschakravarthi commented 5 years ago

Hi Thank you very much for the great effort.

I have a question. I request you to help. Sorry for asking my question as a "issue". I could not find any option in github to post a message to you.

I have been looking for a library which generates shadow map images (Image Based Lighting) for each mesh of my scene. (2nd UV channel). I mean, when we bake lighting of a scene in 3D editors like Blender/Maya/3ds max, it generates lightmap images which contain shadow information. I want to generate the same images programatically without using any such 3d editors. I have attached a a sample image to this post. 9551170d15e201dad1c45266079ec43f8eaade55

Is it possible to achieve the same with OSPRay or Embree? If not possible, do you know any such library which is free/opensource?

I have seen many Path-Tracing/Ray-Tracing libraries but they all are rendering the complete scene without giving a clue how to generate those images. I have been struggling for more than 2 months.

Awaiting your reply. Thanks in advance.

johguenther commented 5 years ago

Hi, generating lightmaps is not supported yet with OSPRay, at least not out-of-the-box. It would be a new feature (we though about that before), however, not with high priority.

Maybe have a look at Unity, it is free for non-professional use, and supports the generation of lightmaps.

Cheers, Johannes

carsonbrownlee commented 5 years ago

I am actually working on a prototype lightmapper using OSPRay, but this is currently strictly exploratory and not expected to be publicly released anytime soon if at all. Johannes suggestion is a good one, as I know with Unity you can view and should be able to export generated lightmaps in the editor, if you can import your scene data into Unity. Unreal may have similar functionality.

oschakravarthi commented 5 years ago

Thank you for your response. I cannot use unity for my requirement. I want to develop a service which does baking. So, when a 3d model is pushed to this service, it should bake it and export it and publish it to CDN. That is why I have been searching for such a library for more than 3 months. Not getting any clue.

carsonbrownlee commented 5 years ago

that sounds great and I'd love to hear how it progresses. I'll try to remember to post to this issue if and when anything is released on our end. It's pretty niche and generally built into game engines so I'm not too surprised you're not seeing many hits for a third party middleware. you might try enlighten: https://www.siliconstudio.co.jp/middleware/enlighten/en/ . This is actually what Unity uses in its legacy lightmapper.

oschakravarthi commented 5 years ago

Thank you. But enlighten is not a free/open source solution. 😣On 30-Apr-2019 1:38 AM, carsonbrownlee notifications@github.com wrote:that sounds great and I'd love to hear how it progresses. I'll try to remember to post to this issue if and when anything is released on our end. It's pretty niche and generally built into game engines so I'm not too surprised you're not seeing many hits for a third party middleware. you might try enlighten: https://www.siliconstudio.co.jp/middleware/enlighten/en/ . This is actually what Unity uses in its legacy lightmapper.

—You are receiving this because you authored the thread.Reply to this email directly, view it on GitHub, or mute the thread.

ghost commented 1 year ago

Hi, Any news on this subject? thanks

johguenther commented 1 year ago

No, computing light maps is not planned anytime soon.

johguenther commented 1 year ago

See idea at https://github.com/ospray/ospray/issues/553#issuecomment-1432867926: would it be ok if the app/user needs to provide the geometry image (of the mesh to compute the light map for)?