Jorzi wrote:Since the left and right propulsions use separate models, this means that, unless I make a separate normal map for the right and the left side, one side will have a flipped x-axis. Now this could be solved in three ways:
How about this as a solution:
Using tangent space normal maps and reusing the models by flipping the axis and reversing the windings.
For now you could just do the tangent space change until there's code support for reusing left and right propulsion models.
That would still require vertex normal interpolation, which I don't know how to do...
The coordinate transformation will also be more complicated but I can probably figure that out by looking at examples...
EDIT: Another solution to the problem would be simply ignoring it, since the shading error isn't really noticeable by mere mortals anyway.
EDIT2: Added screenshot, the new transport model is shaded only by the normal map
I was able to open your .pie in PieSlicer & see the connector. I'm not sure though if I removed it, re-did it below the cockpit & re-saved if it would turn-out correct. I had to make changes to the .pie header to be able to open it in PieSlicer & I'm not sure that after the save and reverting the header back there wouldn't be some unforeseen effect.
The connector should probably be at (0,0,0) right now, which is at landing gear level. I tried to put it at the correct coordinates I read from blender, but it resulted in the mg floating above the transport...
EDIT: from trial and error I came to the conclusion that 0.0000 -108.0000 18.0000 are the correct values for the connector. Now we just need to know how to specify that the turret should be upside down...
umm, the C1-cross? did you try manually changing it to 0.0000 -108.0000 18.0000?
Does pieslicer support pie 3? because apparently the program can read the file despite the vertices being floating-point.
What confuses me is, while the vertices are all in a y-up coordinate system, I had to specify the connector with z up and y-axis flipped
Jorzi wrote:umm, the C1-cross? did you try manually changing it to 0.0000 -108.0000 18.0000?
Yes... & no.
Does pieslicer support pie 3? because apparently the program can read the file despite the vertices being floating-point.
I changed the header. PieSlicer was coded for the original retail .pies
What confuses me is, while the vertices are all in a y-up coordinate system, I had to specify the connector with z up and y-axis flipped
For comparison - the CAM Transport.
(Have to get ready for work so must put off further investigation for now. Tomorrow I'll play around with it some more & see if I can get a connector change in-game.)
.
from trial and error I came to the conclusion that 0.0000 -108.0000 18.0000 are the correct values for the connector.
There was some discussion earlier about the connector coordinates being truncated (not rounded) to integers due to the requirements of the new networking code.
Safety0ff wrote:...and reusing the models by flipping the axis and reversing the windings.
Note: This part is only for convenience to the artist / not creating/loading 2 model files.
Jorzi wrote:Ok, well artistically, that isn't such a problem. The floating point coordinates are most important for things like circles being circular etc...
And polies lining up such that there aren't visible seams... (This is an issue seen in the current models).
Anyways, we plan on fixing this (for graphics purposes, the simulation will still use the truncated connectors).
I've been looking into implementing tangent space normal mapping, and have come to the conclusion that the tangent needs to be pre-calculated and stored for each vertex so that it can be accessed in the vertex shader (just like the normal).
The tangent vector should be orthogonal to the normal and parallell with the u-axis of the uv-map.
How hard is it to implement this?
Also, why are the normals flat and not gouraud-or phong-interpolated and can I change this in the vertex/fragment shader?
The normals are calculated in a very naive manner. This should be improved one day. I think the right place to do this is in the C++ code.
You want a tangent vector to be pre-calculated and available as a vertex attribute? I guess that should not be too hard. But this should also be possible to calculate in the shader, though? Just calculate from the cross product of the vertex normal? Or am I missing something?
The problem is, the normal defines a tangent plane, which means an infinite number of tangents. I need exactly the one that follows the direction of the texture's u-axis. This way, the normal defines the z-axis of the tangent space, the tangent defines the x-axis, and I can calculate the y-axis using the cross product.
Jorzi wrote:Also, why are the normals flat and not gouraud-or phong-interpolated?
If you will look into the original source code, you'll see that there was gouraud shading and also was the special flag for a polygons +0x1000 Gouraud Shading but someone had cut it.
Gouraud shading is the base for the smooth groups but we need only a 1 smooth group for a mesh like it's done to a map normals in the current master builds(it's very noticeable if you don't specify the terrain textures, you see the white shaded terrain).