Baking material with absolute world coordinates

Is there any way to bake a material with absolute world coordinates? I have a material on procedural meshes that fakes lighting for HTML5, and I want to run it once and bake it into a texture for performance.

Anyone possibly know?

You can bake it in some 3d soft, like 3dsmax or Maya like baking simple AO or so.

In unreal, as far as I know, with RenderToTexture tools, you can bake only flat or unwrapped mesh from one fixed camera point.

link text

Yea, the meshes are loaded runtime from a server so that’s why I’m trying to find an in-engine solution for this.

I think baking something in runtime is not good idea, specially if you want to optimize performance.

In this case, everything you can do - is optimize materials you use on that meshes.

It’s not something that I’m baking each frame or something though, I want to bake it during the loading process of a scene. Basically, I have a virtual art gallery app, and art galleries are loaded from a server (customer generated galleries), which also includes data for lights. The lights themselves are meant to be static, but of course I can’t just make static lights because they are created at runtime, and dynamic lights aren’t really supported in HTML5. So I’m using the light data to fake it in a material. But since the light is “static” I want to just do it once and bake it into a texture; I would do this only once per mesh per each scene that is loaded, and that would greatly increase performance for me (especially on mobile) since I’m just loading a texture instead of running a bunch of custom HLSL each frame.

I never heard about something like this in unreal. I think there is no good way to bake light during loading or in runtime. Here is small proof:

https://forums.unrealengine.com/development-discussion/rendering/27069-can-unreal-bake-lights-at-run-time

But, theoretically, it is possible to load scene information on some “server”, which loads it into editor, bake lightning with regular light build flow, and return you a fully ready map, which you can load inro application.

Yeah, this is kinda very complex and difficult solution…

Yea, I’ve been pulling hairs with this for awhile. That’s a good idea but would require me changing back to implementing actual static lights instead of the fake lighting I have. I’ve been trying to create a function which queue’s up a rendering command which would basically do a render of each mesh, separate from the main rendering of the meshes that happen in the engine, and try to return the shader results so I could create a texture from that, but that’s also a whole new demon for me to conquer…might have to put it off for the time being.