c-d-a / io_export_qmap

.map exporter for Blender
GNU General Public License v3.0
84 stars 18 forks source link

Bad Doom 3 .map output with Blender 3.4.1 #7

Closed motorsep closed 1 year ago

motorsep commented 1 year ago

I am getting this error in Dark Radiant when importing simple 64x64x64 cube map :( image

Exported map and reference map are attached, Blender_Doom3_testmap.zip

Export settings I used: image

c-d-a commented 1 year ago

Select "Quake 2" as the flag format. Doom 3 maps expect empty flags as an atavism. The exporter doesn't default to using them for Q4 compatibility. I can't check the export right now, but I believe that should be it.

motorsep commented 1 year ago

I'll check after work, thanks.

motorsep commented 1 year ago

Alright, that worked (DarkRadiant didn't complain). I am only using Brush setting right now.

Something if off with texturing: image

This is what it should look like: image

How do I need to set up UV in Blender to get the same result right out of the box ?

Also, if you diff the two files, you'll see that add-on adds -0 instead of putting 0 (and I am guessing other numbers are off because of texture coordinates?).

Blender_Doom3_testmap2.zip

c-d-a commented 1 year ago

Your material in Blender doesn't use any texture maps, so the exporter defaults to 64x64. There is no way to get correct UV scale without a reference size, though I suppose I should expose the fallback size in the export dialog and make this aspect clear in the readme. Currently, the exporter uses the first texture it stumbles upon in the node tree, doesn't have to be base color or even connected to anything. In case you're new to Blender, you add a texture by clicking on a yellow dot next to "Base Color", then pick "Image Texture", then create or pick an existing one (either will do). Additionally, the default cube in Blender uses a cross-shaped unwrap. If you want each face to occupy the entire UV space, press Tab -> U -> "Reset" -> Tab.

Now, those are the basics. However, it does seem like you found some sort of a bug related to exporting as a brush. Half the faces look normal, but half have bad UVs. Usually this happens when the convex hull operation patches over some concave faces, but it shouldn't affect a basic cube. I'll look into this later today. bugged_uvs For now, test it out in "Faces" mode instead.

motorsep commented 1 year ago

Here is video of me doing the whole thing: https://www.youtube.com/watch?v=sY2cpEnBKJw

c-d-a commented 1 year ago

Fixed convex hull in https://github.com/c-d-a/io_export_qmap/commit/0f1d518e5e57b085a40549cb91dbce0e897c0614 (reverted to how it used to be in the first version of the exporter; Blender's 'geom_interior' seems unintuitive/bugged) I'll update the readmes/fallback stuff some time later, after I do more testing.

The process:

https://user-images.githubusercontent.com/55441216/211718579-ccbb0d16-9159-44db-b170-891f1b86400a.mp4

c-d-a commented 1 year ago

Exposed the fallback size, made readme changes. Closing.