vurt 118 Posted 17 hours ago There's a guide here by J, but i'm not having much luck with doing them. i've selected all objects, and i run the auto bake from KOTOR. It creates a single lightmap, i save it, i unwrap it and i end up with a terrible looking ground with tons of black triangles. Not sure the lightmap even looks correct, its just a rather thin horizontal strip on a black texture, 80% is wasted on the pure black. I was thinking i could give these my own file names in the Lightmap slot (under Main Texture), but that doesn't work. It will only create 233telEA_lm0.tga, so i guess that's the name to go for in all lightmap slots for the objects? I am thinking i could skip it completely (adding tons of new trees and various plants to some maps) and while its still an improvement, even without the lightmaps, it would be interesting to see how it looks with proper lightmapping. Overall it seems like an extremely cumbersome thing to do, to even get it to unwrap is very, very inconsistent, often i can not make it mark the UV so that i can unwrap it (yes, all objects selected). Quote Share this post Link to post Share on other sites
DarthParametric 3,902 Posted 16 hours ago Lightmaps are arguably the hardest thing in KOTOR modding, both because of the fiddliness of setting them up and baking them in the first place, but also in trying to match the vanilla artistic lighting intent (assuming you are baking vanilla modules). It's a lot more straightforward in custom modules where you don't have pre-existing restrictions. To the first part, KBlender has made the baking process a hell of a lot better than it used to be in KMax, albeit you have to deal with all of Blender's alien logic for the setup. Since you mentioned UVs, I take it you're not doing this, but it's worth noting that you can't use vanilla lightmap UVs because the bakes will be terrible, even 20 years later at 50+ times the resolution. I gather Bioware baked the maps and then repacked the UVs afterwards for performance reasons on the Xbox, remapping the lightmaps to suit. My experiments with KBlender routinely found issues across UV seams, so my suggestion is to try and keep to contiguous islands as much as the geometry allows. In practice, this means condensing all meshes with shared diffuse textures as much as possible. I'm not sure how you do this in Blender, since I don't use it for modelling. Same with remapping the UVs - no idea how to do it in Blender. To give you an idea of the sort of thing I'm talking about, here's an example from some of my rebake experiments with the "hangar" of the Dantooine enclave. You can see most of the main floor geometry is a single contiguous island to minimise seam artefacts. At the bottom is a comparison of the vanilla maps vs the re-UV'd/rebaked maps. Quote Share this post Link to post Share on other sites
vurt 118 Posted 16 hours ago Those are great looking, what an improvement Yeah i dunno, seems too difficult, but i am not very technical, its why i prefer to do textures. Do you know if the engine supports vertex painting? i can always fake lightning via that instead, way easier and very fast to do. Not the same results, but its something. Actually, looking at the original maps, i first thought they had just painted dark blobs under the trees. Quote Share this post Link to post Share on other sites
DarthParametric 3,902 Posted 14 hours ago The problem with the vanilla lightmaps is that they reduced them down to tiny sizes. In some cases a single room might comprise two or three lightmaps each only 64x64. So whatever quality they were in their raw state (probably not that high res to begin with circa a quarter century ago using 3DS Max 8/9 and Photoshop 6/7), once they crunched them down for the shipped version everything got turned into blobs. It's honestly impressive they look as good as they do, all things considered. But they didn't "paint" them. If you look in the vanilla models you'll like see a bunch of empty null/dummy objects with light names. Those were all the fill lights they used originally to bake the lighting. They presumably got converted to nulls by their exporter since they weren't of an appropriate game type. As to vertex painting, no. The engine doesn't support displaying any colour information that way. Not that it would help you for lightmaps anyway. 1 Quote Share this post Link to post Share on other sites
vurt 118 Posted 14 hours ago some old games faked shadows with vertex painting, but yeah, not the same thing as lightmaps. Quote Share this post Link to post Share on other sites
J 66 Posted 5 hours ago Yeah it's a process but in most cases you need to rewrap with new UVs. Not only do you need to switch to the secondary UV on every mesh. You have to select each mesh that shares a lightmap and rewrap. Once you do that for every lightmap, you can bake new ones. Plus you have to adjust the light sources and world background color to get it looking right. You could also just edit the lightmap manually with an image editor. Quote Share this post Link to post Share on other sites
vurt 118 Posted 4 hours ago 1 hour ago, J said: Yeah it's a process but in most cases you need to rewrap with new UVs. Not only do you need to switch to the secondary UV on every mesh. You have to select each mesh that shares a lightmap and rewrap. Once you do that for every lightmap, you can bake new ones. Plus you have to adjust the light sources and world background color to get it looking right. You could also just edit the lightmap manually with an image editor. do you know how to give new meshes a lightmap? or how to get a lightmap that isn't just the name of the map, which seems to be the default. I think the hardest thing for me to understand how different lightmaps would even work for a scene, they overlap in layers? I'm totally new to lightmaps, never used it before. all the tedious things can easily be made into a .py script with chatgpt or any other AI, it will give you one in seconds. Like making sure the secondary UV is selected for all meshes, or anything else you need to do manually. As long as you can explain the whole process in great detail (show it screenshots too), it could make a 1-click solution for doing UV-maps, apart from lighting. I tried and it did read your guide, and looked at the source code, but so far no luck with a 1-click solution, parts of it works really well though, making sure everything is set up correctly. i think where it fails is the files themselves because i can not give it detailed information about how that part even works. Quote Share this post Link to post Share on other sites
J 66 Posted 2 hours ago They are just a texture. For a new mesh, you can duplicate the texture UV and turn on lightmap in the KOTOR mesh settings. The game engine blends the vertex shading, diffuse texture and the lightmap together (per pixel). Quote Share this post Link to post Share on other sites
vurt 118 Posted 2 hours ago yes i know they're textures, but i'm curious how it applies over the level mesh, especially when several are in use. yes, without turning on lightmapped it wont do anything if you click bake (auto). with duplicating UV, you mean just using the same name as some default UV lightmap? i do wonder if "shadow" is good to use or not too.. I'll give it some more shots though Quote Share this post Link to post Share on other sites
J 66 Posted 1 hour ago The UV defines how the texture is applied. You can see it if you select a mesh and switch to the UV tab. You can name it anything. The first UV is the texture. The second UV is the lightmap Quote Share this post Link to post Share on other sites
vurt 118 Posted 1 hour ago Tried that, if you just give it a name then it wont do the baking, it must have a name that already exists and you must click lightmapped. if you just give it a name you wont get any lightmap texture for that mesh, at least in my experience, i've looked in the image editor afterwards and its not listed. I've hade some luck using the same name, but the lightmap texture looks all wrong to me, with just a tiny strip in the middle, and the rest is just a pure black. I use Blender 4.2, maybe i should switch to an earlier version in case this is just completely bugged for 4.2 Quote Share this post Link to post Share on other sites
J 66 Posted 1 hour ago I thought you meant the UV name. I've actually never created a new lightmap but I have reassigned lightmaps to other existing ones, to balance out the spacing. Quote Share this post Link to post Share on other sites
vurt 118 Posted 1 hour ago ah right you said UV, no, the lightmap i tried giving another name. working on a script now, lets see how it works out. Quote Share this post Link to post Share on other sites