Page 5 of 5
Re: [OPTing] texture limits
Posted: Wed Aug 08, 2018 11:31 am
by Warb_Null
I have a question.
I have a model of a fighter with a transparent canopy that keeps crashing the game.
I narrowed it down to the canopy being the cause. When i delete the canopy everything is fine. When i apply a BMP texture to the canopy everything is fine. When i apply a PNG texture it crashes the game. I tried using the canopy texture from the A-wing, stil crashing.
The pilots goggles also have a transparrent PNG but this causes no problem.
Re: [OPTing] texture limits
Posted: Thu Aug 09, 2018 7:20 pm
by JeremyaFr
Hello,
When a PNG image is imported, it is loaded as a 32-bit texture. You need to convert it to 8-bit by clicking on "Convert All to 8 bits".
Re: [OPTing] texture limits
Posted: Thu Aug 09, 2018 9:01 pm
by Warb_Null
I did that but it still crached
I think it mhas something to do with the mesh. I remade the canopy with a lower facecount and that seemed to resolve it. No more crash
Could there be a different limit for face number when using tranparency?
Anyway, it's resolved now. Thanks for the help.
Re: [OPTing] texture limits
Posted: Fri Aug 10, 2018 3:42 pm
by JeremyaFr
I'm able to reproduce the crash.
You're right. The game crashes when a mesh with a high face count has a transparent texture.
Re: [OPTing] texture limits
Posted: Fri Aug 31, 2018 7:37 pm
by JeremyaFr
UPDATE
Hello,
I've include the 'triangling to infinity' patch to the opt limit hook.
Please redownload xwa_hook_opt_limit.zip
Re: [OPTing] texture limits
Posted: Mon Nov 05, 2018 12:48 am
by Bman
Hi Jeremy, wanted to clarify the vertice possibilities. Assume an .opt model is maxed out at 50 meshes (not including low LOD meshes).
If I set the hook_opt_limit.cfg file to "Size = 32768" does that mean "each" mesh can have up to a maximum of 32,768 vertices ?
If not, what would be limits per any given mesh ? Thanks.
Re: [OPTing] texture limits
Posted: Mon Nov 05, 2018 8:41 pm
by JeremyaFr
Hi Bman,
I think it is safe to have up to 15000 vertices per mesh. With more, the game may crash.
With this patch, one can reach up to 20000 vertices. With more, the game may crash or the craft may not be rendered.
Code: Select all
; increase the vertex count
At offset 0882D0, replace 00A60E00 with 00B12100.
At offset 0882DF, replace 409C0000 with 60670100.
Re: [OPTing] texture limits
Posted: Tue Nov 06, 2018 12:26 am
by Bman
Great! 20k.
So implementing the above Offset patch, I'm still confused on what the hook_opt_limit.cfg (Size = value) means. The .dll uses default of 4096. Does "value" represent the maximum allowed vertice count for any given mesh, or does "value" represent the maximum vertices allowed per FaceGroup within a given mesh ?
You mentioned earlier you had fixed the crashing issue of a "FaceGroup with more than around 1024 3d vertices. I've increased the size of the execute buffer to fix the buffer overflow. The limit is now around 32768 3d vertices." I think I'm getting the two confused. Thanks
Re: [OPTing] texture limits
Posted: Tue Nov 06, 2018 9:25 am
by JeremyaFr
The value in hook_opt_limit.cfg represents the vertices count in the mesh vertices node in the opt file. In XwaOptEditor, the value is shown in the V column of the mesh list or in the Geometry/Vertices tab. When the limit is exceeded (without the hook, the limit in the exe is 512), the game may crash when the craft is hit.
Re: [OPTing] texture limits
Posted: Tue Nov 06, 2018 2:11 pm
by Driftwood
Is this something that is going to be made a default increase to 15-20k vertices at some point, or should we plan on sticking with 4096/mesh?
Re: [OPTing] texture limits
Posted: Tue Nov 06, 2018 3:17 pm
by JeremyaFr
Hello,
Here is a few test opt files:
opt_limits_70.zip
Setup:
- Set Size=12000 in hook_opt_limit.cfg
- Apply the above patch
Results:
- limits_1_1_69_69.opt seems to work
- limits_1_1_70_70.opt seems to work
- limits_1_1_71_71.opt doesn't work
If the patch works and the game doesn't crash, I will add it to the hook.
Posted: Fri Nov 09, 2018 4:27 am
by Bman
.
Re: [OPTing] texture limits
Posted: Mon Nov 26, 2018 8:52 pm
by JeremyaFr
UPDATE
Hello,
Here is a tool to easily download my editing tools:
XwaToolsDownloader.zip
Usage:
1) Run XwaToolsDownloader.exe.
2) It will download the tools list ( "xwa_tools_list.txt" ) from GitHub. To redownload the list, delete the "xwa_tools_list.txt" file.
3) It will create a directory named "_archives" and download the tools into this directory. Only the new tools are downloaded.
4) It will extract the tools. Only the new tools are extracted.
Supported tools:
- XwaDatEditor
- XwaCbmEditor
- XwaOptEditor
- XwaImcEditor
- XwaSnmConverter
- ZtPatcher
Re: [OPTing] texture limits
Posted: Tue Nov 27, 2018 8:47 am
by Darksaber
Thanks Jeremy
Re: [OPTing] texture limits
Posted: Sat Dec 01, 2018 1:52 pm
by JeremyaFr
TEST
Hello,
I found how to remove the vertices count limit for meshes that have a transparent texture. It seems to also work for non transparent textures.
limits_1_1_150_150-2.zip
This opt contains a mesh that has 90 000 triangles, 180 000 vertices. To test it, you have to set "Size = 65536" in "Hook_Opt_Limit.cfg".
I will update the Opt dll and XwaOptEditor to apply the change. It seems that there is no longer a vertices count limit. The limit will be the performance.
EDIT: done
Re: [OPTing] texture limits
Posted: Sat Dec 01, 2018 2:10 pm
by Driftwood
Glen merge buff dun!?
Holy moly!
Luxury yacht's going to be getting an update then. It shall be absolutely opulent! I've got other stuff in working on at the moment, but I wasnt fully satisfied with the interior.
I'm imagining all the potential in regards to larger items and environment props, rather than small ships.
Re: [OPTing] texture limits
Posted: Sat Dec 01, 2018 2:41 pm
by Darksaber
Confucius say.... Just because you can, doesn't mean you should
Re: [OPTing] texture limits
Posted: Sat Dec 01, 2018 6:19 pm
by Bman
Brilliant. Then low level LOD's become more relevant to offset high poly count meshes.
There you go DTM, an open door for a new Death Star model and surface buildings and cities and landscape projects.
Re: [OPTing] texture limits
Posted: Sat Dec 01, 2018 7:39 pm
by JeremyaFr
UPDATE
Hello,
I've updated the opt limit hook to increase the vertices size limit from 4096 to 65536.
Please redownload xwa_hook_opt_limit.zip
Re: [OPTing] texture limits
Posted: Sat Dec 01, 2018 7:44 pm
by Driftwood
I can't seem to access your onedrive, it's crashing.
Re: [OPTing] texture limits
Posted: Sun Dec 02, 2018 4:36 pm
by JeremyaFr
My OneDrive is fine.
Re: [OPTing] texture limits
Posted: Sun Dec 02, 2018 5:13 pm
by Driftwood
Must have been doing server maintenance then when I checked.
Re: [OPTing] texture limits
Posted: Fri Dec 14, 2018 5:38 pm
by JeremyaFr
UPDATE
Hello,
I've included a patch to the opt limit hook. This patch fixes a crash when a face has a flat texture.
Please redownload xwa_hook_opt_limit.zip
Re: [OPTing] texture limits
Posted: Fri Dec 14, 2018 6:40 pm
by Darksaber
Thank you
Re: [OPTing] texture limits
Posted: Sun Apr 05, 2020 12:56 pm
by JeremyaFr
UPDATE
Hello,
I've updated the opt limit hook.
I've included a patch to fix a bug related to the depth buffer.
At certain orientations, there were triangles that were drawn where they should not have.
This is related to how the depth values are computed and to the distribution of the z values along the 0.0 to 1.0 range. These lead to a wrong depth order.
I've fixed that.