Disappearing Meshes in Entrenchment 1.05 Solution

I'm just putting this out there as an fyi for everyone running into this problem with trying to run 1.041 mods on 1.05. If the mod you want to play loads successfully, but none of the ships, planets, buildings, etc show up in game, this should solve the problem.

1. Find where you installed the mod.

2. Open the PipelineEffect folder for the mod.

4. Delete the following files from the PipelineEffect folder:

  • GS_Asteroid.fx
  • GS_Planet.fx
  • GS_Ship.fx
  • GS_ShipBuilding.fx
  • GS_ShipPhasedOut.fx

Delete those and the meshes should show up, and the mod will work correctly, although you will get a couple of StringNotFound errors.

I've tested this with my mod, Sins of the 13th Tribe, as well as Star Wars Requiem, which has the same problem.

27,874 views 32 replies
Reply #1 Top

Yeah, I found that out yesterday by complete chance. I don't even know what you can change in those files for a mod, anyway. But removing them fixed the problems.

Reply #2 Top

Those files are probably from one of the graphics mods, my guess is the Volumetric Effects, though why they changed how the game reads them is beyond me.

Reply #3 Top

the files are also in bailknights as well as volumetric, so they could have come from either mod in vanilla sins days, especially as the files are all dated 2008.

harpo

 

Reply #4 Top

Quoting GoaFan77, reply 2
Those files are probably from one of the graphics mods, my guess is the Volumetric Effects, though why they changed how the game reads them is beyond me.

That is my guess, too.

Reply #5 Top

Quoting GoaFan77, reply 2
...though why they changed how the game reads them is beyond me.

These patch have not change how the files are read but now the engine is more sensible to error... the fx file are outdated... they use the texture system who was used for sins 1.05 and before... not the new system implemented in sins 1.1 ... you remember when the cl alpha was switch with the da red channel !!!

By example, in the GS_Ship.fx, in the old version, you find :

   float4 teamColorScalar = (dataSample.r * g_TeamColor.a);

who need to be replaced by

   float4 teamColorScalar = (colorSample.a * g_TeamColor.a);

or a other example :

float4 GetSpecularColor(float3 light, float3 normal, float3 view, float4 colorSample)
{
   float cosang = max(dot(reflect(-light, normal), view), 0.f);
   float glossScalar = colorSample.a;
   float specularScalar = pow(cosang, g_MaterialGlossiness) * glossScalar;
   return (g_Light0_Specular * specularScalar);
}

who need to be replaced by :

float4 GetSpecularColor(float3 light, float3 normal, float3 view, float4 dataSample)
{
   float cosang = max(dot(reflect(-light, normal), view), 0.00001f);
   float glossScalar = dataSample.r;
   float specularScalar = pow(cosang, g_MaterialGlossiness) * glossScalar;
   return (g_Light0_Specular * specularScalar);
}

You don't need to delete the files, simply replace it by any version of the original sins who is after sins 1.05 ( 1.1 or older ) and it will normally resolve the problem...

When i will have time, i will check for more difference but from a first check, particule effect using a mesh will not have problem since only the RGB channel of the cl is used... cl without alpha will lead to problem with any mesh... nm map saved in dtx5 mode can lead to problem too... need to "//using nvidia's DXT5_NM format:" ... these format move itself the red nm to the alpha for better quality...

Forcing modders to use the correct code is a good thing... with time, it will lead to more stability for the mod and the game itself...

Reply #6 Top

I see, that makes sense.

I use dxt5 with interpolated alpha for all of my dds files - should I be using something different? Sorry, I didn't quite understand what you meant by that.

Reply #7 Top

Quoting IskatuMesk, reply 6
I use dxt5 with interpolated alpha for all of my dds files - should I be using something different? Sorry, I didn't quite understand what you meant by that.

dxt5 with alpha is good for the cl and the da map...

For the nm map, a lot of people was making a copy of the red channel to the alpha channel and save it in dxt5 format... reason is simple... a better quality nm map... the alpha channel use more bit for the compression that the red channel... by example, Id Software worked around the normalmap compression issues in Doom 3 by moving the red component into the alpha channel before compression and moving it back during rendering in the pixel shader.

Now, saving a nm map using dxt5 will lead to a bad quality... saving it in Dxtn ( or what it is called in your plug-in, i use gimp and the gimp plug-in ) is like moving the red channel to the alpha and save it in dxt5 format... if you take a look at the shader code of the GS_Ship.fx, it is clearly write in the comment :

float3 GetNormalInTangentSpace(float2 texCoord)
{
    //using nvidia's DXT5_NM format:
    //http://discuss.microsoft.com/SCRIPTS/WA-MSD.EXE?A2=ind0507D&L=DIRECTXDEV&P=R1929&I=-3
    float4 sample = 2.f * tex2D(TextureNormalSampler, texCoord) - 1.f;
    float x = sample.a;
    float y = sample.g;
    float z = sqrt(1 - x * x - y * y);
    return normalize(float3(x,y,z));
}

For more info, take a look at : http://www.poopinmymouth.com/tutorial/dds_types.html ... and it work with ATI card because ATI have use it first, was included later with nvidia... if you wish to use the usual dxt5, you need to :

- Copy the NM output Red Channel to the Alpha Channel.
- Then color Red and Blue channels solid black.

before saving...

By the way, you can see in the sins ship shader code that only sample.a ( alpha channel ) and sample.g ( green channel ) is used for normal map... so, if you don't use the dxt_nm or the dxt5 with moving the red channel to the alpha ( the red and blue solid black lead to smaller file size )... you will be only using only the green channel of the normap map who like a simple grey scale bumpmap...

Hope that it "makes sence" again !!!

These post and the previous one are more about explaining the "why"... and are only related to sins 1.1 and newer version...

PS: make a try with one of your normal map texture ( the colored one )... use the dxt_nm or dxt5 with red chhannel moved to the alpha... and see the difference in game... by the way, thank to Tobi from the B5 mod who have explain me the "how" for the nm map ( moving red channel to the alpha )... for the "why", i have simply need to read the Stardock shader code...

 

Reply #8 Top

I see. I think I understand why some of the normal maps weren't looking correct, now. Thanks!

Reply #9 Top

This is unrelated but thanks Thoumsin, you made me go back and have another look at exhaust colour and using a hack saw I actualy got the texture colour visable by adding a pixel shader technique to the file.

Not sure if what I did is useful but I got 543 experince points for it. That was a few hour trip through a totaly dark river of ignorance.

I still have no idea how they work, I wish I could pull the info from the particle but I don't think that is in the pipeline anywhere :(.

Reply #10 Top

I would kill to get the distortion effect the Star's use onto a ship mesh somehow.

Reply #11 Top

The problem would be how do you apply it to only those ships, if the code works.

Reply #12 Top

Well, is it contained in those shader files? Can you reference to it from a Particle? Because whenever I referenced to one of those shaders from a particle it would be invisible.

Reply #13 Top

I think that effect is hardcoded.  Yes, yet another hardcoded item in Sins of a Solar Empire.

Reply #14 Top

Depressing, but not wholly surprising at this rate.

Reply #15 Top

regarding the five fx files would an effective fix be to COPY the  files from the sins pipelineeffects folder?

harpo

 

Reply #16 Top

Quoting harpo99999, reply 15
regarding the five fx files would an effective fix be to COPY the  files from the sins pipelineeffects folder?

Copy from the sins folder or delete in the mod folder...

By deleting them, the mod use directly the original in the sins folder... it is the best way since you will always use the last version...

In fact, i don't understand why the files was included in the bailknights/volumetric mods since they was not modified from the original sins... a mod need to have only the modified and added files, and don't need the non modified one...

Reply #17 Top

Quoting Aractain, reply 11

I would kill to get the distortion effect the Star's use onto a ship mesh somehow.

The problem would be how do you apply it to only those ships, if the code works.

I think that effect is hardcoded.  Yes, yet another hardcoded item in Sins of a Solar Empire.

It can maybe be possible... what follow is only idea who have never be tested...

Maybe we can modify manually the .mesh for include a new texture since some texture field are not used ( like the displacement map )... modify the GS_ship.fx for include code for use these new texture with the Noise3D code... a black texture will lead to no noise, colored part to noise...

If not possible, maybe use a particule system like in the B5 mod... two mesh... one usual and one using the particule system... since the particule force have the GS_star.fx included, it is maybe possible to make the second mesh call the fx via a particule effect... best will be both mesh having his own texture set...

It is only idea... have not time for check more now... but once i will begin work on the Vorlon ship for the B5 mod, i will try to find a way for have these distortion effect... since i need them for have canon ship !!! If i am able to make it, i will post about it...

Reply #18 Top

I hypothesized that you could make a particle mesh and call the shader that way, but I couldn't get any of the shaders to show up. Might need a special dds setup of some kind?

Reply #19 Top

Quoting Thoumsin, reply 16

Quoting harpo99999, reply 15regarding the five fx files would an effective fix be to COPY the  files from the sins pipelineeffects folder?

Copy from the sins folder or delete in the mod folder...

By deleting them, the mod use directly the original in the sins folder... it is the best way since you will always use the last version...

In fact, i don't understand why the files was included in the bailknights/volumetric mods since they was not modified from the original sins... a mod need to have only the modified and added files, and don't need the non modified one...

I had tried the delete and when zoomed in the colour was there, but the look of the planets was not, that is why i suggested the copy

harpo

 

Reply #20 Top

Quoting IskatuMesk, reply 18
I hypothesized that you could make a particle mesh and call the shader that way, but I couldn't get any of the shaders to show up. Might need a special dds setup of some kind?

Sorry for the delayed reply but at work, i am very limited with my laptop...

Now, i have make some test and it work... and i will show it to you...

- download the B5 mod at https://forums.sinsofasolarempire.com/361694/page/47  for Ent 1.041...

- Start Ent, enable the mod... Start a new game, EA against EA... build a capital factory... build a Omega... zoom it and enjoy the rotating piece... save the game and quit...

- Download the file at http://www.love-from-russia.be/OmegaRotate.particle ... put it in the B5 mod particules folder... start Ent, load the save game and zoom on the previously rotating part... i have dissable the rotation and enable the moving texture...

I don't know something about the particule forge, i have directly edit the particule effect created by Tobi with my notepad... for more info about how to work with two mesh, and particule, Tobi is the master... if you can make what he make, the rest is only a question of edit a particule file...

Color are not very good but it is mainly because we have use one single texture for two mesh... better use two cl, one for the particule mesh and one for the usual mesh... if needed, at the modeling level, i can give you some tip since i have already create several mesh with moving part for the B5 mod... i will apply the same technic for the Vorlon ship with the little modification for have moving texture in place of moving mesh...

Point is that it is possible, i have show it... i have not all the needed knowledge for help you since the B5 mod is a collaboration between numerous people who have each his own experience... it is the sum of these various experiences who lead to very good on-screen quality...

 

 

Reply #21 Top

Quoting harpo99999, reply 19

I had tried the delete and when zoomed in the colour was there, but the look of the planets was not, that is why i suggested the copy

Surely my mistake... if have only compare the old shader code and new shader code from a few files ( these related to ship and star )...

In all case, delete or replace will change nothing... if you delete them, sins will fall back to the file in the game folder... if you replace them, the mod will use the replace files but since they are identical to these of the sins folder, nothing will change...

First, it is possible that for planet, some change was made by manshooter... it is very possible too that manshooter use some texture who was not upgraded when sins have move from 1.05 to 1.1 ...

I will need to check my old archive when i have time... for now, i have a 2 day ETA for one model and some more mod waiting some job from me ... so, i am very busy...

Anyway, i am not a expert coder like you... i have simply jump in these topic because i was able to explain the "why" of the initial problem... and for the other thing ( moving texture ), because i like challenge... never forget, i am just a modeler who is very curious...not a coder...

When i will have time, i will try to see and resolve the planet problem but i bet that you will find a solution before i have time... in the meantime, if you know a good site related to shader programming language, feel free to post a link... i think that wonder can be made at the visual level if you know how to create new shader code...

Reply #22 Top

Okay, that effect is awesome and you've got me really excited to try to put this on the Undead, now.

 

I think I have a good idea on how to get the particle mesh thing going but I'm kind of bottlenecked in my modeling pipeline right now to actually get a mesh ready to try this one (have to wait on friend to port them from XSI to sins format). But I have a theory about how I can go about this. I might just try to spawn a duplicate mesh of an existing ship on top of itself. Unless a particle mesh calls upon hardpoints, then it'll call itself, and we'll have a nice big infinite loop going on.

Reply #23 Top

Quoting IskatuMesk, reply 22
I might just try to spawn a duplicate mesh of an existing ship on top of itself

Not really a good idea... both mesh will use the same space and you will have a "clipping" effect... i mean that for each screen point, the engine will render the normal texture or have the moving thing...

If you wish partial moving texture, simply extrude a little the surface you wish with the moving texture, loop cut them, combine them in a second mesh used with the particule effect... like in the pic below, red part are the part with moving texture... whhen it is in the right place, it look like the yellow part...

Since XSI hate me, i never make the hardpointing or convert to .mesh... but there is enough people around

and we'll have a nice big infinite loop going on

Will crash the game or come short of memory...each call use particule, texture and poly... so loop will bring down the game very fast...

Reply #24 Top

Alrighty, so I went ahead an tried this with my modeled zeral.

 

I made a basic model which was a tiny square; this contains all of the hardpoints and the such.


Then there's the particle mesh, which is the actual body of the ship.

I spawned it with a particle.

It spawns perfectly, it's oriented fine, ect.

But it's bright white. I can't see anything going on at all, much less nice shiny distortion.

I tried setting the particle mesh to just use the diffuse texture and no spec/bump, but it makes no difference. I tried loading the B5 Omega's da/nm textures on it and it makes no difference.

Any ideas?

Also the particle randomly vanishes and the ship along with it for several seconds.

Reply #25 Top

Quoting IskatuMesk, reply 24
Also the particle randomly vanishes and the ship along with it for several seconds.

Remember that sins limit for particule is only 6000 ... have similar problem with the B5 mod when i have a lot of ship onscreen with rotating part...

In my case, i have always my users.ini having the maxparticule count at 16000 ...

Have not yet test in E1.05 where a lot of change was made in how the particule work... test was made in E1.041