Shader Quality - How Does This Affect Texture Rendering?

The place to discuss scripting and game modifications for X³: Terran Conflict and X³: Albion Prelude.

Moderators: Moderators for English X Forum, Scripting / Modding Moderators

Post Reply
User avatar
XenonArchitect7
Posts: 110
Joined: Fri, 5. Jul 19, 07:19

Shader Quality - How Does This Affect Texture Rendering?

Post by XenonArchitect7 » Wed, 3. Jun 20, 14:13

Hello, I know my chances of getting help with this are low, but I figured I'd put it out there. My issue is with a custom ship, but this ship was made out of parts from other ships already existing in X3, thus the texture submaterials were already defined from the parts. It took me some tweaking to get the textures loading correctly after collapsing the model, but I've run into a problem where the texture is wrong only when "Shader Quality" in the graphics settings is set to high. I've tested the Glow setting, Ship color variations, and dynamic light sources, and these do not make any difference.
https://i.imgur.com/NzmUFDI.png

My ship textures work perfectly fine when the setting is on low, so I was wondering if anyone knows what exactly this shader quality does. As you can see below, there is some sort of black texture all over the ship while on the high setting. By comparison, the Xenon P for reference does not have this problem.
https://i.imgur.com/0jGnnVR.png
https://i.imgur.com/B0EBjsv.png

I don't think it's an issue with the light maps, since the illumination works perfectly fine on the low shader quality, as I have tested it in a dark sector. I tried disabling all the spec maps (removing them from the materials in the bod file itself), but that did not solve the issue. It could be bump maps, but I highly doubt that. I might test it with those disabled if the issue persists.

So does anyone know what this Shader Quality setting is doing, and why it it appears to mess up my texture?
Note that I have never had this problem when working with custom ships and custom textures (I have worked on many star wars ships that don't have this problem). But this is the first time I have worked with existing X3 textures, so there might be additional properties I am not aware of.
Last edited by X2-Illuminatus on Tue, 27. Oct 20, 17:16, edited 1 time in total.
Reason: removed img tags from oversized images


User avatar
XenonArchitect7
Posts: 110
Joined: Fri, 5. Jul 19, 07:19

Re: Shader Quality - How Does This Affect Texture Rendering?

Post by XenonArchitect7 » Wed, 3. Jun 20, 23:10

So I've isolated the problem to the bump maps. For some reason, they are causing all sorts of problems when the shader quality is set to high. So I removed all bump maps from my materials. It's a small price to pay for a quick solution, they don't make too much of a notable difference anyway if you aren't looking at the ship very closely. This makes me wonder: Are bump maps not rendered with shader quality on low? That would explain it, and the problem is simply that my bump maps aren't mapped properly. But I don't know for sure.


On an unrelated note... I have noticed that my ship reacts to the sun in a sector in the opposite manner than one would expect. The side of the ship facing away from the sun is lit up while the sun shines darkness onto the side it faces. It's a really strange thing to see, especially next to all other ships and stations in the sector that are being lit properly. The sector has a single sun, but its lighting effects on my ship are reversed. I can see it in real time while rotating the ship too. Has anyone ever seen this issue with modded ships before?

User avatar
Killjaeden
Posts: 5366
Joined: Sun, 3. Sep 06, 18:19
x3tc

Re: Shader Quality - How Does This Affect Texture Rendering?

Post by Killjaeden » Fri, 5. Jun 20, 00:52

XenonArchitect7 wrote:
Wed, 3. Jun 20, 23:10
So I've isolated the problem to the bump maps. For some reason, they are causing all sorts of problems when the shader quality is set to high. So I removed all bump maps from my materials. It's a small price to pay for a quick solution, they don't make too much of a notable difference anyway if you aren't looking at the ship very closely. This makes me wonder: Are bump maps not rendered with shader quality on low? That would explain it, and the problem is simply that my bump maps aren't mapped properly. But I don't know for sure.


On an unrelated note... I have noticed that my ship reacts to the sun in a sector in the opposite manner than one would expect. The side of the ship facing away from the sun is lit up while the sun shines darkness onto the side it faces. It's a really strange thing to see, especially next to all other ships and stations in the sector that are being lit properly. The sector has a single sun, but its lighting effects on my ship are reversed. I can see it in real time while rotating the ship too. Has anyone ever seen this issue with modded ships before?
I would also check the material, i'm sure there will be a modifier for bump intensity - that should solve the issue to some extent.

Strange lighting is either because of improper smoothing / material splitting or wrong normals. Or your ship's faces are all inverted (activate back face culling in your 3d model editor so see inverted faces)
[ external image ]
X-Tended TC Mod Team Veteran.
Modeller of X3AP Split Acinonyx, Split Drake, Argon Lotan, Teladi Tern. My current work:
Image

Majo64
Posts: 11
Joined: Fri, 21. Aug 09, 19:42
x3ap

Re: Shader Quality - How Does This Affect Texture Rendering?

Post by Majo64 » Fri, 5. Jun 20, 21:24

XenonArchitect7 wrote:
Wed, 3. Jun 20, 23:10
On an unrelated note... I have noticed that my ship reacts to the sun in a sector in the opposite manner than one would expect. The side of the ship facing away from the sun is lit up while the sun shines darkness onto the side it faces. It's a really strange thing to see, especially next to all other ships and stations in the sector that are being lit properly. The sector has a single sun, but its lighting effects on my ship are reversed. I can see it in real time while rotating the ship too. Has anyone ever seen this issue with modded ships before?
It sounds exactly like the issue I've run into as described here: viewtopic.php?f=94&t=427712&sid=2ae007a ... 07a03ebf21. I figured this issue has to have something to do with the textures but I haven't been able to fix it yet.

User avatar
XenonArchitect7
Posts: 110
Joined: Fri, 5. Jul 19, 07:19

Re: Shader Quality - How Does This Affect Texture Rendering?

Post by XenonArchitect7 » Sun, 21. Jun 20, 00:20

Killjaeden wrote:
Fri, 5. Jun 20, 00:52
Strange lighting is either because of improper smoothing / material splitting or wrong normals. Or your ship's faces are all inverted (activate back face culling in your 3d model editor so see inverted faces)
Thank you for the tips, I checked with back face culling and smoothing, but I was able to isolate the issue to the spec maps. By deleting all spec maps from each material, the result is proper lighting on the ship. The only issue now, however, is that without bump maps or spec maps, the ship looks like it does on low graphics settings even when graphics are on max and other ships become glossy with high shaders. But something with the spec maps was causing the inverted lighting issue.

I am going to try setting a global specular level rather than the maps, although I think I am going to settle for it at this point. Thanks again for the help.

Majo64
Posts: 11
Joined: Fri, 21. Aug 09, 19:42
x3ap

Re: Shader Quality - How Does This Affect Texture Rendering?

Post by Majo64 » Wed, 24. Jun 20, 14:12

Since I was experiencing the same "inversed lighting" issue you described and removing specular textures didn't work for me, I had to do some more testing, but I found a fix that might be worth looking into.

I noticed that some of the .obj models that I was exporting from Maya into GMax were working fine in the game, while others were causing the inversed lighting issue. When I was combining a working and a non-working .obj model into one .bod file, the resulting model did also lit incorrectly in the game. But I also found out that models that were created in Gmax from the beginning always showed up correctly in game. So I tried the following:

1. loaded one of the "corrupted" .bod ship models into gmax

2. created a Standard Primitive (a Box but my guess is that any shape would work) and moved it to the center of the scene (0,0,0)

3. right-click on the Box -> Convert to editable poly

4. right-click on the Box -> Attach List

5. in the window that opens, I select the "corrupted" ship model to attach to the box. The simple Box is now essentially the new ship model.

6. export the "box" as .bod and proceed as usual


For me, this has proven to be a reliable way to fix the inversed lighting issue even if it's more of a bandaid fix and I still haven't been able to fully figure out what caused the issue in the first place. But for my ship models, it works.

User avatar
Killjaeden
Posts: 5366
Joined: Sun, 3. Sep 06, 18:19
x3tc

Re: Shader Quality - How Does This Affect Texture Rendering?

Post by Killjaeden » Tue, 27. Oct 20, 00:46

XenonArchitect7 wrote:
Sun, 21. Jun 20, 00:20
Thank you for the tips, I checked with back face culling and smoothing, but I was able to isolate the issue to the spec maps. By deleting all spec maps from each material, the result is proper lighting on the ship.
Without specularity it's impossible to see issues with smoothing/ normals, so its not the issue that is fixed, but simply made impossible to see (at the cost of it looking like low graphics).
Majo64 wrote:
Wed, 24. Jun 20, 14:12
For me, this has proven to be a reliable way to fix the inversed lighting issue even if it's more of a bandaid fix and I still haven't been able to fully figure out what caused the issue in the first place. But for my ship models, it works.
The way you describe it, i'm almost 100% certain that it was a vertex normals issue, . Because that is one way to "reset" the vertex normals to default. I suggest reading up on vertex normals, they are quite important for 3d models (no matter if old games or "next gen").
see https://www.youtube.com/watch?v=_kONIPr_gBM
a good explanation of the basics https://www.youtube.com/watch?v=0xB7nb0E448 - ignore that it is for maya, the basics are exactly the same for every modern tool - blender, max, etc.

In fact, modern techniques make even more concious use of vertex normals to achieve a much nicer look with fewer textures, by weighting them in certain ways.

Face normals are different, they just describe which direction a face is showing (easily detectable when backface culling option is enabled)
[ external image ]
X-Tended TC Mod Team Veteran.
Modeller of X3AP Split Acinonyx, Split Drake, Argon Lotan, Teladi Tern. My current work:
Image

Post Reply

Return to “X³: Terran Conflict / Albion Prelude - Scripts and Modding”