[OPTing] XWA OPT Editor
Re: [OPTing] a new opting tool is under construction
- Atx
- Posts: 1217
- Joined: Mon Feb 11, 2002 12:01 am
The shading errors can be sorta fixed by cutting the face in half - I did that sometimes with my little buck rogers starfighter opt and it worked well. It's all a matter of getting that vector to point in the right direction.
Wasn't there a small program that fixed the face orders and rendered them real-time with lighting in a viewer? That worked real well with some other stubborn opts I had.
Wasn't there a small program that fixed the face orders and rendered them real-time with lighting in a viewer? That worked real well with some other stubborn opts I had.
The Navbuoy is closed...long live the XWAU!!!
-
- Posts: 577
- Joined: Sun Mar 31, 2002 11:01 pm
- Contact:
that would only apply if your problems on concave quad and you use optech, sometimes its a bit more complex
if you look here you can see a shading artifact but the wirefram shows cuting a face isnt going to do much good likewise here
if you look here you can see a shading artifact but the wirefram shows cuting a face isnt going to do much good likewise here
You do not have the required permissions to view the files attached to this post.
-
- Posts: 577
- Joined: Sun Mar 31, 2002 11:01 pm
- Contact:
wireframe
but anyways this is a modeling issue and nothing really to do with jeremys tool
hte problems are hard to see there, its easier when your viewing the model in 3d, but cutting anythings not going to solve anything, problem is some points are off planar, mainly due too rhinos poor mesh editing tools. Easiest way to see in rhino with a complex mesh is try to weld the mesh with an angle of 0, if some edges arent selected somethings off planarbut anyways this is a modeling issue and nothing really to do with jeremys tool
You do not have the required permissions to view the files attached to this post.
- Atx
- Posts: 1217
- Joined: Mon Feb 11, 2002 12:01 am
Normally, when I did those sort of details I would plan ahead and manually slice the face to get the number of verticies I needed.
Delete the face and reinsert a clean one then slice the hell out of face making a nice tight grid and if possible, manually adjust the vertices to get the shape you desire and then do the indentation (negative extrusion?). That's a nice way to get your verticies coplanar if you can lock it down in Rhino like 3D Max allows...I'm pretty sure there's an option to move along the face's/vertex's local axis.
I never used cutaway tools or Boolean tools because you're leaving that up to the software to decide which isn't the best option in this case and you'll always end up with those ugly tris everywhere.
I had that issue from time to time but that was my workaround for me. God, it's been awhile but it's slowly coming back. LOL.
Delete the face and reinsert a clean one then slice the hell out of face making a nice tight grid and if possible, manually adjust the vertices to get the shape you desire and then do the indentation (negative extrusion?). That's a nice way to get your verticies coplanar if you can lock it down in Rhino like 3D Max allows...I'm pretty sure there's an option to move along the face's/vertex's local axis.
I never used cutaway tools or Boolean tools because you're leaving that up to the software to decide which isn't the best option in this case and you'll always end up with those ugly tris everywhere.
I had that issue from time to time but that was my workaround for me. God, it's been awhile but it's slowly coming back. LOL.
The Navbuoy is closed...long live the XWAU!!!
- JeremyaFr
- Posts: 4001
- Joined: Mon Jan 18, 2010 5:52 pm
- Contact:
"Triangling to infinity" problem workaround
Here is a possible workaround for the "triangling to infinity" problem.
This will replace the hardcoded vertex count limit (in the execute buffer) of 512 with 2048.
When the game engine reach this limit, it does not send the vertices to the execute buffer. So subsequent triangles draw uses previous vertices. That's what cause the "triangle to infinity" effect.
Here is a possible workaround for the "triangling to infinity" problem.
Code: Select all
At offset 193C4A, replace 750C with 9090.
At offset 193C53, replace 02 with 08.
When the game engine reach this limit, it does not send the vertices to the execute buffer. So subsequent triangles draw uses previous vertices. That's what cause the "triangle to infinity" effect.
-
- Posts: 50
- Joined: Fri Jan 17, 2014 8:09 pm
Thanks Jeremya! This is really cool stuff, as usual!
Is there a reason for raising the limit "only" to 2048 instead of, for example, 4096?
Is there a reason for raising the limit "only" to 2048 instead of, for example, 4096?
- Atx
- Posts: 1217
- Joined: Mon Feb 11, 2002 12:01 am
Sweet! So you bypassed (NOP'd) the 'sending to the buffer' code and quadrupled the limit.
Makes perfect sense...awesome stuff!
Also, the reason he didn't go any higher might have been for practical reasons...it could easily slow the game down even on modern day machines. Also, with him setting it to an 8 and not higher might be for the simple reason that it might not allow/accept more than the nybble (half byte)? so possibly throwing in a 15 (4095) might be the largest it can go...but to me that's highly doubtful.
4 times the limit is more than enough for a decent model for this old engine.
Makes perfect sense...awesome stuff!
Also, the reason he didn't go any higher might have been for practical reasons...it could easily slow the game down even on modern day machines. Also, with him setting it to an 8 and not higher might be for the simple reason that it might not allow/accept more than the nybble (half byte)? so possibly throwing in a 15 (4095) might be the largest it can go...but to me that's highly doubtful.
4 times the limit is more than enough for a decent model for this old engine.
The Navbuoy is closed...long live the XWAU!!!
- JeremyaFr
- Posts: 4001
- Joined: Mon Jan 18, 2010 5:52 pm
- Contact:
This modification will not remove the existing vertex count limit for opt files.
The vertex count limit is 512 per mesh and it cannot be changed.
The modification is related to the triangling problem.
By triangling, it means this kind of effects (in wireframe):
Triangles appear all accross the screen.
It happens when triangles are drawn using wrong vertices.
The triangling effect means that the opt model contains a FaceGroup that has too many triangles. The simplest way to solve it is to split the FaceGroup that has too many triangles in several FaceGroups.
The modification inscreases the triangle count a single FaceGroup can have.
There is no real reason to set only 2048. In fact, vertices are indexed using words. So the max vertex count can be 65535.
But remember that the vertex count limit per mesh is 512. I don't think the vertex count in a single FaceGroup will be as high.
The vertex count limit is 512 per mesh and it cannot be changed.
The modification is related to the triangling problem.
By triangling, it means this kind of effects (in wireframe):
Triangles appear all accross the screen.
It happens when triangles are drawn using wrong vertices.
The triangling effect means that the opt model contains a FaceGroup that has too many triangles. The simplest way to solve it is to split the FaceGroup that has too many triangles in several FaceGroups.
The modification inscreases the triangle count a single FaceGroup can have.
There is no real reason to set only 2048. In fact, vertices are indexed using words. So the max vertex count can be 65535.
But remember that the vertex count limit per mesh is 512. I don't think the vertex count in a single FaceGroup will be as high.
You do not have the required permissions to view the files attached to this post.
- Ramshu
- Posts: 74
- Joined: Sat Sep 21, 2013 10:42 am
- Contact:
I use "convert Opt textures to 32 bits" and "apply exe patcher" on a xwa upgrde folder. I detect a little problem, the ligths on cockpit and starships are off.
images to compare:
XWA Upgrade: http://i60.tinypic.com/v2r0jt.jpg
XWA Upgrade with 32bit texture convert: http://i62.tinypic.com/a4o0at.jpg
any idea how to fix it?
images to compare:
XWA Upgrade: http://i60.tinypic.com/v2r0jt.jpg
XWA Upgrade with 32bit texture convert: http://i62.tinypic.com/a4o0at.jpg
any idea how to fix it?
- JeremyaFr
- Posts: 4001
- Joined: Mon Jan 18, 2010 5:52 pm
- Contact:
This is because light maps are not yet supported.
-
- Posts: 1170
- Joined: Mon Apr 05, 2004 11:01 pm
Looks like it maybe related to "Diffuse Lighting" effect. Ramshu, have you tried adjusting your in-game single-player "Video" menu settings ?
W-I-P: TFTC, MC Viscount Cr., ISD-II Avenger, NL-1 Platform, Ton-Falk Esc. Cr., & Misc.
-
- Posts: 1170
- Joined: Mon Apr 05, 2004 11:01 pm
Jeremy, in your post above with the picture, are you saying that too many adjacent triangles or planes that share the same single vertice x1,y1,z1 can cause triangulation ? For a "FaceGroup" my understanding is you are defining that as two or more faces (triangles) in a given mesh that share the same textured bitmap file. Does a FaceGroup have to reference the entire bitmap coordinates of textured file, or can it reference part of bitmap file ? Why not just split a textured bitmap file into a separate file(s) before stitching to the faces? i.e. File.bmp is 1024x1024 total pixels. i.e. x0,y0 to 1023x,1023y uses whole image vs. x48,y111 to x624,y704 which is part of the 1024x1024 image. How many textured bitmap files are allowed to be imported and referenced, 100 ?
W-I-P: TFTC, MC Viscount Cr., ISD-II Avenger, NL-1 Platform, Ton-Falk Esc. Cr., & Misc.
- JeremyaFr
- Posts: 4001
- Joined: Mon Jan 18, 2010 5:52 pm
- Contact:
A Face is a triangle or a quadrangle.
A FaceGroup is a group of faces on which a texture is applied.
A MeshLod contains FaceGroups.
A Mesh contains MeshLods.
An Opt contains Meshes.
Execute Buffer
The triangling is related to the number of triangles that are rendered. A triangle that is outside the screen is not rendered.
The rendering is done with an execute buffer.
A vertex is described by a D3DTLVERTEX structure.
That is what causes the triangling effect.
The content of the execute buffer looks like this:
When the game is launched, the render states are initialized:
Then the render states are modified as needed.
Textures
A FaceGroup does not have to reference the entire texture coordinates space.
Xwa exe can handle up to 200 textures per opt. With the patch, the limit is 1024. If needed, it can be increased. The real limit is the memory consumption.
A FaceGroup is a group of faces on which a texture is applied.
A MeshLod contains FaceGroups.
A Mesh contains MeshLods.
An Opt contains Meshes.
Execute Buffer
The triangling is related to the number of triangles that are rendered. A triangle that is outside the screen is not rendered.
The rendering is done with an execute buffer.
XWA creates an execute buffer whose the size is 0x10000.DirectX 5 SDK:
execute buffer:
A fully self-contained, independent packet of information that describes a 3-D scene. An execute buffer contains a vertex list followed by an instruction stream. The instruction stream consists of operation codes, or opcodes, and the data that is operated on by those opcodes.
A vertex is described by a D3DTLVERTEX structure.
When XWA fills the buffer, it fills up to 512 vertices and ignores the extra vertices.typedef struct _D3DTLVERTEX {
D3DVALUE sx;
D3DVALUE sy;
D3DVALUE sz;
D3DVALUE rhw;
D3DCOLOR color;
D3DCOLOR specular;
D3DVALUE tu;
D3DVALUE tv;
} D3DTLVERTEX;
dvSX, dvSY, and dvSZ:
Values describing a vertex in screen coordinates.
dvRHW:
Value that is the reciprocal of homogeneous w.
dcColor and dcSpecular:
Values describing the color and specular component of the vertex.
dvTU and dvTV:
Values describing the texture coordinates of the vertex.
That is what causes the triangling effect.
The content of the execute buffer looks like this:
Code: Select all
10699 Execute Buffer:
0: ( 615 ; 749 ; 0 ) 0.29922 FF9A9090 00000000 ( 0.5 ; 0.083333 )
1: ( 615 ; 751 ; 0 ) 0.29909 FF303030 00000000 ( 0.071429 ; 1 )
2: ( 616 ; 750 ; 0 ) 0.298786 FF303030 00000000 ( 1 ; 1 )
3: ( 609 ; 749 ; 0 ) 0.297183 FF303030 00000000 ( 0.066667 ; 0.925926 )
4: ( 610 ; 749 ; 0 ) 0.296721 FF303030 00000000 ( 0.6 ; 1 )
5: ( 611 ; 744 ; 0 ) 0.29761 FF303030 00000000 ( 1 ; 0.111111 )
6: ( 609 ; 744 ; 0 ) 0.298075 FF303030 00000000 ( 0.4 ; 0.037037 )
7: ( 574 ; 726 ; 0 ) 0.287171 FF303030 00000000 ( 0.996656 ; 1 )
8: ( 615 ; 751 ; 0 ) 0.29909 FF303030 00000000 ( 0 ; 0.75 )
9: ( 615 ; 749 ; 0 ) 0.29922 FF9A9090 00000000 ( 0 ; 0.25 )
10: ( 575 ; 724 ; 0 ) 0.287372 FFF7D3D3 00000000 ( 0.996656 ; 0.083333 )
11: ( 611 ; 709 ; 0 ) 0.274725 FFCFBCBC 00000000 ( 0.004255 ; 0.006667 )
12: ( 589 ; 700 ; 0 ) 0.268666 FF333131 00000000 ( 0.017021 ; 1 )
13: ( 559 ; 715 ; 0 ) 0.281232 FF333131 00000000 ( 1 ; 0.7 )
14: ( 574 ; 722 ; 0 ) 0.285812 FFCFBCBC 00000000 ( 0.991489 ; 0.006667 )
0: PROCESSVERTICES
COPY start: 0 dest: 0 count:15
1: STATERENDER
TEXTUREHANDLE 3830
2: TRIANGLE
0 1 2
3 4 5
3 5 6
7 8 9
7 9 10
3: STATERENDER
TEXTUREHANDLE 3833
4: TRIANGLE
11 12 13
11 13 14
5: EXIT
Code: Select all
1024 Execute Buffer:
0: STATERENDER
TEXTUREPERSPECTIVE TRUE
TEXTUREMAG LINEAR
TEXTUREMIN LINEAR
SUBPIXEL TRUE
SUBPIXELX TRUE
WRAPU FALSE
WRAPV FALSE
ALPHABLENDENABLE FALSE
TEXTUREMAPBLEND MODULATE
SRCBLEND ONE
DESTBLEND ZERO
ALPHATESTENABLE TRUE
ALPHAFUNC NOTEQUAL
STIPPLEDALPHA FALSE
SHADEMODE GOURAUD
MONOENABLE TRUE
SPECULARENABLE FALSE
FOGENABLE FALSE
FILLMODE SOLID
DITHERENABLE TRUE
ANTIALIAS NONE
ZENABLE TRUE
ZWRITEENABLE TRUE
ZFUNC GREATER
CULLMODE NONE
1: EXIT
Textures
A FaceGroup does not have to reference the entire texture coordinates space.
Xwa exe can handle up to 200 textures per opt. With the patch, the limit is 1024. If needed, it can be increased. The real limit is the memory consumption.
-
- Posts: 1170
- Joined: Mon Apr 05, 2004 11:01 pm
Good to know. Probably safe to say most modern systems today have at least 4GB of main memory not including graphic cards' on-board memory. Recapping: so with the patch, then you could have up to 1,024 textured-bitmap files each potentially at 1024x1024 pixel dimensions, right?
A FaceGroup "family" cannot be part of more than one specific mesh, correct ? Every mesh has its own one or more FaceGroup(s).
If a FaceGroup is a group of faces on which a texture is applied, then is that same thing as saying one is just stretching a texture over those faces, like putting a blanket over a garden pegged at each corner? Or does each face (it's vertices) have to reference specific coordinate of the same bitmap-texture? Asked another way, for any given mesh, can each triangle face reference its own separate texture-bitmap file, or do all faces in a given mesh have to pull from the same texture-bitmap file (with same or different pixel coordinates) ? A one-to-one, one-to-many, or many-to-many relationship ?
A FaceGroup "family" cannot be part of more than one specific mesh, correct ? Every mesh has its own one or more FaceGroup(s).
If a FaceGroup is a group of faces on which a texture is applied, then is that same thing as saying one is just stretching a texture over those faces, like putting a blanket over a garden pegged at each corner? Or does each face (it's vertices) have to reference specific coordinate of the same bitmap-texture? Asked another way, for any given mesh, can each triangle face reference its own separate texture-bitmap file, or do all faces in a given mesh have to pull from the same texture-bitmap file (with same or different pixel coordinates) ? A one-to-one, one-to-many, or many-to-many relationship ?
W-I-P: TFTC, MC Viscount Cr., ISD-II Avenger, NL-1 Platform, Ton-Falk Esc. Cr., & Misc.
- JeremyaFr
- Posts: 4001
- Joined: Mon Jan 18, 2010 5:52 pm
- Contact:
For memory consumption, remember that xwa is a 32-bit exe.
With the patch, you can have up to 1024 textures per opt. It is safe to say that the size of a texture can be up to 4096x4096. The mininum size is 8x8.
Each mesh has its own geometry.
Each face can reference its own texture.
A texture can be referenced across several meshes.
Several textures can be added to a FaceGroup. Each one forms a flight groups color.
With the patch, you can have up to 1024 textures per opt. It is safe to say that the size of a texture can be up to 4096x4096. The mininum size is 8x8.
Each mesh has its own geometry.
Each face can reference its own texture.
A texture can be referenced across several meshes.
Several textures can be added to a FaceGroup. Each one forms a flight groups color.
-
- Posts: 577
- Joined: Sun Mar 31, 2002 11:01 pm
- Contact:
Unless you've a 4k monitor a 4096^2 texture is overkill as mip maps will be used at lower resolutions, at least as far as my understanding of it is.
- JeremyaFr
- Posts: 4001
- Joined: Mon Jan 18, 2010 5:52 pm
- Contact:
UPDATE for:
- Xwa Dat Editor
- Xwa Cbm Editor
- Xwa Opt Editor
- Darksaber
- Posts: 10931
- Joined: Mon Jan 10, 2000 12:01 am
- Contact:
might be a daft question, but where do I download
Xwa Dat Editor
Xwa Cbm Editor
I thought they where in with the XWA Opt Editor, (the link on the first post, then I thought they might be incorporate into the XWA Opt Editor, but I can't find that in there either
or am I missing something?
Xwa Dat Editor
Xwa Cbm Editor
I thought they where in with the XWA Opt Editor, (the link on the first post, then I thought they might be incorporate into the XWA Opt Editor, but I can't find that in there either
or am I missing something?
“You can please some of the people all of the time, you can please all of the people some of the time, but you can’t please all of the people all of the time”.”
- John Lydgate
Good Things Come To Those Who Wait....
Darksaber's X-Wing Station
- John Lydgate
Good Things Come To Those Who Wait....
Darksaber's X-Wing Station
-
- Posts: 1170
- Joined: Mon Apr 05, 2004 11:01 pm
Thanks Jeremy. Appreciate it. Forgot your tool is still W-I-P. Eventually to replace OptTech.
DS, all of the latest stuff is here at his site: https://onedrive.live.com/redir?resid=A ... 94FB%21116
DS, all of the latest stuff is here at his site: https://onedrive.live.com/redir?resid=A ... 94FB%21116
W-I-P: TFTC, MC Viscount Cr., ISD-II Avenger, NL-1 Platform, Ton-Falk Esc. Cr., & Misc.
-
- Posts: 50
- Joined: Fri Jan 17, 2014 8:09 pm
By the way, Jeremya, what happened to XwaStatisticsView? It's a very useful tool, much more userfriendly than BHE and way less buggy than MXvTED.
- JeremyaFr
- Posts: 4001
- Joined: Mon Jan 18, 2010 5:52 pm
- Contact:
A more complete and less buggy version of XwaStatisticsView will be soon available.
- Q
- Posts: 456
- Joined: Sat Dec 28, 2002 12:01 am
- Contact:
You can download all the files from JeremyaFr's virtual drive here: https://onedrive.live.com/redir?resid=A ... 94FB%21116JeremyaFr wrote:UPDATE for:If you use any of these tools, please re-download them to ensure that you use an up-to-date version.
- Xwa Dat Editor
- Xwa Cbm Editor
- Xwa Opt Editor
"I like work; it fascinates me. I can sit and look at it for hours."
-
- Posts: 1170
- Joined: Mon Apr 05, 2004 11:01 pm
Jeremy, is it possible you can adapt your editor to also import fully textured or untextured .3ds models and in any color format ?
Right now Anim8tor (from Anim8tor.com) a 3D program I use will only allow me to save/export it's .an8 model files into .3ds files (with it's in-house UV mapping tool), but they only allow 24-bit 8R8G8B textured .bmp files. .Obj files can also be exported but come with .mtl (materials reference file too, not the actual textured .bmp files.)
Or if your editor could import Anim8tor's native .an8 file format with textures already applied on the models, that would be even better. No worries, i can find other solutions, but wanted to ask anyway. Thanks
Right now Anim8tor (from Anim8tor.com) a 3D program I use will only allow me to save/export it's .an8 model files into .3ds files (with it's in-house UV mapping tool), but they only allow 24-bit 8R8G8B textured .bmp files. .Obj files can also be exported but come with .mtl (materials reference file too, not the actual textured .bmp files.)
Or if your editor could import Anim8tor's native .an8 file format with textures already applied on the models, that would be even better. No worries, i can find other solutions, but wanted to ask anyway. Thanks
W-I-P: TFTC, MC Viscount Cr., ISD-II Avenger, NL-1 Platform, Ton-Falk Esc. Cr., & Misc.
- JeremyaFr
- Posts: 4001
- Joined: Mon Jan 18, 2010 5:52 pm
- Contact:
When importing .obj files, the associated .mtl file is taken account. Let me know if you import an .obj file and the textures are not imported.
The .an8 file format looks simple. So it would be relatively easy to write an importer.
The .an8 file format looks simple. So it would be relatively easy to write an importer.