Parik27 / DragonFF

Blender Add-on to edit RenderWare and GTA Formats
GNU General Public License v3.0
346 stars 124 forks source link

The problem with rendering alpha textures in the game #192

Open Calvin-rgb opened 1 year ago

Calvin-rgb commented 1 year ago

I edited the model, it draws everything correctly in the program, all the settings seem to be correct, for some reason it does not draw the interior of the car through the rear-view window in the game. How to fix it?

In Blender:

Calvin-rgb commented 1 year ago

The hierarchy has not changed Such a bug appears when the player gets into the car

Calvin-rgb commented 1 year ago

At the same time, I just replaced one alpha texture with another alpha texture

Parik27 commented 1 year ago

Check #171

It's to do with the order of the models and materials. Make sure the windows are below the chassis in the model hierarchy.

Calvin-rgb commented 1 year ago

Check #171

It's to do with the order of the models and materials. Make sure the windows are below the chassis in the model hierarchy.

Yes, thank you But just like other people, names are very important for the script to work and renaming is not very easy I hope this can be fixed by changing the addon :)

Calvin-rgb commented 1 year ago

@Parik27 Hello I have studied this problem a bit, as I think it is very important for a modding tool. I used Zmodeler 2.2.6 to edit the car model, and found out that this program, when exporting a DFF car model, moves all alpha materials to the end of the list of the hierarchy of materials. That is, it does not matter how the objects are placed on the stage and in the hierarchy, but it is important in what order the alpha materials are displayed in the general dff hierarchy.

Am I thinking right?

If it still works, it would be possible to add this to DragonFF by adding a couple of parameters when exporting the model to the game. I would like to see a solution to this problem in the near future :)

Parik27 commented 1 year ago

@Calvin-rgb I don't think it does that. The order of the objects does matter from my testing (read my comments on #171 ). Making the plugin reposition alpha materials on export breaks alpha properties of other objects (I tried by exporting a default GTA model). It also did not fix the issue in #171 which requires repositioning the objects.

The material list is per-object, so even if you moved all alpha material to the bottom of the list, it won't fix the issue if the window model is placed above the chassis.

So to conclude, you can only see vertices through a transparent material:

It's not ideal to move all alpha materials to the bottom of the list (even if I add a checkbox, you might have a situation where you would want to have an alpha material placed above non-alpha materials). A more complex solution is required for this issue.

Calvin-rgb commented 1 year ago

@Parik27 I apologize for my wrong thoughts. I hope there is a solution to the problem, we will wait.

Calvin-rgb commented 1 year ago

There were problems with Z culling of the glass doors, I fixed it. Now I can't fix the interior display through the sunroof I duplicated the hatch object, renamed it "zzz" and deleted its original. According to the hierarchy, it is below the model of the car interior, so what is the problem? @Parik27

Calvin-rgb commented 1 year ago

Maybe try to implement flags for materials? As it is done in zmodeler, by type _glassmat [flag 4, spec]

Parik27 commented 1 year ago

I would need the dff file for investigating it.

Is that functionality not available in the DragonFF Materials menu?

Calvin-rgb commented 1 year ago

I would need the dff file for investigating it.

Is that functionality not available in the DragonFF Materials menu?

Here is the model


I was thinking, and I thought maybe this is due to the fact that I set the "Read Material Split" parameter when importing the native model? And because of this, the ID of materials does not work correctly @Parik27

ThePortuguesePlayer commented 1 year ago

For me, cars don't even import correctly without "Read Material Split" checked. They import with the materials assigned wrong.

Calvin-rgb commented 1 year ago

For me, cars don't even import correctly without "Read Material Split" checked. They import with the materials assigned wrong.

My imports are fine, even with the Read Material Split turned off

Dotterkletch commented 9 months ago

this occurs when the glass, and the surrounding model that you want to be visible through the glass, are connected. select the object that has the glass, go into edit mode, and select the faces that are going to have transparency, and press Y, this will detach it from the chasis, without separating it from its object. export it and check the results. I'm guessing this happens because just importing the model will merge the nearby vertices