Hello! I am trying to come up with a very basic BGE scene with baked textures. I am able to set up some materials in Cycles (a wall material and an emissive, fluorescent lamp-like material), and I am able to bake them into a texture. I am able to assign the texture. However, the texture does not show up in BGE until I remove the materials from the mesh.
Is it possible to keep the materials on the mesh for rendering in Cycles, and still use the baked texture in BGE? Ideally, I would like to make some modifications to my level, bake the textures, test it out, ad infinitum.
Attached is my very basic scene.
Edit: Maybe it is possible to use scenes to simulate a workflow like this? Like, one scene has the cycles version of the scene, and I can bake it down there and duplicate it to a new scene somehow? How are people handling this sort of workflow?
I think it is possible by using a Python script inside BGE to remove the Cycles materials while the game engine is running. If I find anything out, I’ll post it here.
I guess I’m just confused. Do people just fully birth the whole level in Cycles, bake it, and then pray they don’t have to modify something later?
The simple way: make two objects/scenes one with each material. Have the one in the game engine set to ‘invisible’ in the viewport or restricted to wireframe mode. You can also play around with per-object materials rather than per-mesh materials so you can share the same mesh. In my brief experimentation it seems that whatever per-object material was applied the longest ago gets shared to all instances of that mesh in the game engine. So it’s not perfect, but it is usable.
Most people establish a workflow for model creation aside from game creation. Have a look into these workflows are they are used not only in the game industry, but in nearly every part of the 3D model industry.
Thank you for your response. For now I can duplicate the object and place it in a different scene, clear out its materials and assign the baked texture material. If I want to make modifications I can remove the object in the latter scene and repeat the process.
I’ve been playing with the Python console and I’m able to get a reference to the object and its materials, and I can duplicate the object. So it should be possible to write a script which: 1) Clears any objects in the second scene, 2) Duplicates the object and places it in the second scene, 3) Removes the cycles materials from the object. I’ll follow up my post if I get it figured out. (Of course, such a script would work outside the BGE itself)