I have a project that uses assets from a game that is now 22 years old.
(For legal reasons, please note this is not a public project- won’t be until assets are replaced with my own.)
Someone made a tool that can export models and levels from this game into .OBJ, and if imported directly into Unity there is nothing wrong. (Except .mtl format incompatibility so textures break a bit)
Here is the issue itself though: When importing these .OBJ files into Blender, the faces that were double sided- gets turned into one-sided. And which side remains seems random.
From what I have heard is that these double sided faces also share the vertices- and Blender doesn’t like this so it tried to fix that. I need to disable this part of the obj. import feature.
I know most of you are thinking these faces probably actually only has 1 normal facing 1 way, but I can assure you there are actually 2 normals sharing the same vertices- but going the opposite ways.
I could duplicate the entire level and invert it- but this will leave a lot that doesn’t need to be rendered. Like the underside of grass.
Also I’d like to apologize for the horrible explanation, I hope someone has a clue.
Back in 2015 someone had the same issue, and they solved it- however they didn’t share how they did it.
Usually blender does use “double sided” material because it won’t backface cull by default. For EEVVEE you can deselect it in Material Properties → Settings. For cyles there is only a backface cull in the viewport (and if you want it in the render you have to use a node settup with ray to camera or something…)
If you really want different materials on the different sides then you have to setup something like here:
The thing is, this isn’t a culling issue. It’s the fact that .Obj import deletes one side completely.
Manually fixing this will take many hours. The Obj importer needs to be modified for my needs somehow, and I was hoping someone had done something similar themselves.
I can provide images of the issue when I’m home from work, if that should proove useful.
Ahh yes… i tried to make a simple file and by accident i found out:
# Blender v3.1.2 OBJ File: ''
# www.blender.org
mtllib quadBlenderE.mtl
o Cube
v 1.000000 0.000000 -1.000000
v 1.000000 0.000000 1.000000
v -1.000000 0.000000 -1.000000
v -1.000000 0.000000 1.000000
vt 0.625000 0.500000
vt 0.875000 0.500000
vt 0.875000 0.750000
vt 0.625000 0.750000
vn 0.0000 1.0000 0.0000
vn 0.0000 -1.0000 0.0000
usemtl Material
s off
f 1/1/1 3/2/1 4/3/1 2/4/1
usemtl Material2
s off
f 1/1/1 2/4/1 4/3/1 3/2/1 4/3/1
# last point is an accident but then you can see two normals and two faces with different materials
# but also this doesn't work
# f 1/1/2 2/4/2 4/3/2 3/2/2
with material file:
# Blender MTL File: 'None'
# Material Count: 2
newmtl Material
Ns 359.999993
Ka 1.000000 1.000000 1.000000
Kd 0.800000 0.025513 0.076087
Ks 0.500000 0.500000 0.500000
Ke 0.000000 0.000000 0.000000
Ni 1.450000
d 1.000000
illum 2
newmtl Material2
Ns 359.999993
Ka 1.000000 1.000000 1.000000
Kd 0.2800000 0.825513 0.076087
Ks 0.500000 0.500000 0.500000
Ke 0.000000 0.000000 0.000000
Ni 1.450000
d 1.000000
illum 2
But with the 3d-Viewer view3dscene you also can’t see two material ecxept with the 5-vertex version…
The problem may be that the OBJ-specification isn’t very detailed and sometimes some app interpret this in different ways…
Even Campbell Barton says so in https://developer.blender.org/T34547
A part of the problem with OBJ is the spec is not clear on what is/isn’t valid, and programs tend to work a bit differently.
So maybe you can find a small example file and “cripple” it by deleting something but it shows the problem…
I suspect blender just isn’t adding a face (with other normal) if this already exists (at least at the obj-import) ??
I didn’t quite know what you meant with cripple a small example, I could send you an example model if you’d like.
Here’s an example image of my issue, everything that has something on it’s other side get’s butchered by the import script. Like you said, it only adds one of the faces- when I really need them both.
I meant cut off most of it and just show the problem… you was talking about legal reasons and game ripped content as geometry data is not liked here on BA. So maybe just select a part of the roof or the front (no textures) ?? This is enough to show the problem…
But seeing your image now i assume the roof has no other texture on the inside and the same for the front…
So there are parts missing?? You said:
There are indeed parts directly missing, this isn’t culling, this is a face being completely removed during import.
There are supposed to be faces on both sides of this, inside and outside the building. The face isn’t culled away, it straight up doesn’t exist after import.
The issue is with Blender’s OBJ importer, nothing else.
Can you load your model with some other 3D app? Maybe MeshLab or anything else…
For blender and the double sided approach: i think this was a design decision to don’t allow two faces on the same vertices with inverted normal because you get Z-fighting in cycles and cycles uses every face to compute accurate lighting. If you have an engine which uses face culling to decide which side to show you don’t have Z-fighting… but eevee was later…
I think you’re right about that. Every 3D app seem to have a different result. Meshlab was more brutal than Blender in removing faces.
Unity reads the unedited version just fine, except for a incompatible .mtl file meaning textures don’t work as intended. I would also like to do light editing, and I highly prefer Blender.
Also, Z-fighting doesn’t happen when the normals are different directions.
Thanks so far, but what’s your next suggestion?
You said old game… think about how you get this in OBJ format… i assume the game isn’t using this… so you not-to-mention-here-app gives you just a bad model to edit…