How to make a .TgPcDx file invisible

Discuss almost anything about RailWorks.

How to make a .TgPcDx file invisible

Unread postby Shawmut » Thu Apr 24, 2025 6:52 pm

I've got a file for a very old (RS) UK emu that has a "shade" texture that floats over the track. The model runs fine in TSC 2024; there's no problem there. But that shade file looks just awful. In the old MSTS days I knew how to export alpha channels of ace files and modify same with black paint to allow something (for example, cab windows) to be visible. In the case of this shadow file, I don't want it to be visible, I want it to be transparent.

I read Buzz's tutorial on using DXTBmp and RSBinTool to modify TgPcDx files and it the instructions worked fine: I had no problem modifying a cab side, for example. But the instructions assume that the alpha file will remain the same. So my question is twofold: 1. Do I take the "shade" file and delete all of the pixels leaving a blank file. 2. Then do I modify the alpha channel so that the blank "shade" file literally becomes invisible?

Thanks for your thoughts!

Dave
User avatar
Shawmut
 
Posts: 30
Joined: Sat Jan 19, 2019 5:08 pm

Re: How to make a .TgPcDx file invisible

Unread postby Chacal » Thu Apr 24, 2025 6:57 pm

I seem to remember there was a fix specially for this shadow. But I don't remember what it was.
Over the hill and gathering speed
Chacal
Site Admin
 
Posts: 6439
Joined: Tue Jul 05, 2011 1:11 pm
Location: Quebec, Canada

Re: How to make a .TgPcDx file invisible

Unread postby QcRail » Fri Apr 25, 2025 9:47 am

There is possible solution which avoids the transparent layer issue.

Logically if a shadow is visible anywhere the engine might be located it is therefore part of the 3D model and will be imbedded in the .GeoPcDx file (sort of a child link).
As an expl. I have chosen the following diesel : Kuju\RailSimulatorUS\RailVehicles\Diesel\F7\Default\GN\F7A_GN.GeoPcDx and...

1. open this file with the XML File Editor thus each line of code is readable.
2. scroll down till you see this code:
Code: Select all
   <TransformName>
      <e d:type="cDeltaString">engine</e>
      <e d:type="cDeltaString">shadow_engine</e>
      <e d:type="cDeltaString">cab</e>
      <e d:type="cDeltaString">bo02</e>
      <e d:type="cDeltaString">bo02wh01</e>
   

Note the second line : <e d:type="cDeltaString">shadow_engine</e>, this call will figure as the second line to be found upward (just above in the same file) a vary important section as
it calls a specific function linked to a specific texture file, as ...
Code: Select all
   <SourceLToPTransform>
      <e d:numElements="16" d:elementType="sFloat32" d:precision="string">1.0000000 0.0000000 0.0000000 0.0000000 0.0000000 1.0000000 0.0000000 0.0000000 0.0000000 0.0000000 1.0000000 0.0000000 0.0000000 0.0000000 0.0000000 1.0000000</e>
      <e d:numElements="16" d:elementType="sFloat32" d:precision="string">1.0000000 0.0000000 0.0000000 0.0000000 0.0000000 1.0000000 0.0000000 0.0000000 0.0000000 0.0000000 1.0000000 0.0000000 0.0000000 0.0000000 0.0000000 1.0000000</e>
      <e d:numElements="16" d:elementType="sFloat32" d:precision="string">1.0000000 0.0000000 0.0000000 0.0000000 0.0000000 1.0000000 0.0000000 0.0000000 0.0000000 0.0000000 1.0000000 0.0000000 0.0000000 0.0000000 0.0000000 1.0000000</e>
[b]...[/b]
   </SourceLToPTransform>

3. You will recognize this as being the famous 16 variables of the matrix. No panic!!!, now the variable is the 16th or the last one in the matrix position
4. In the above expl. there are 3 matrix line code and in the second line, the last value is 1 which means that the shadow_engine is active and visible.
5. To render the shadow unseeable one has to change the value to 0.
6. Save the file and the shadow, while in the game, should not be visible. !*brav*!

Good luck, if you need help send me you .GeoPcDx file (or rather the all asset file so I can do testing).
QcRail
QcRail. aka Bernard Lafargue
QcRail
 
Posts: 468
Joined: Fri Jun 29, 2012 1:17 pm
Location: Montréal, Qc. Canada

Re: How to make a .TgPcDx file invisible

Unread postby Shawmut » Sat Apr 26, 2025 5:49 pm

Hello Bernard,

Thank you for your very detailed explanation. I followed your example, and though my particular model is slightly different (examples below) your suggestions worked, albeit with a problem.

transformname.jpg

Above is an image of the "TransformName" section of the DTSO's GeoPcDx file; there are 27 separate lines and the "shadow" section is the fourth: softshade.

In the image below I'm copying the section directly above the TransformName section, which also has 27 lines. It's entitled "TransformDependency." Do I need to do something to the fourth line here as well? I'll explain in a moment why I'm asking that question.
transformdependency.jpg


Lastly below is the "SourceLToPTransform" section, note that I've changed the end of the fourth line from 1.0000000 to 0.0000000.
sourceltoptransform.jpg


When I looked at the model in the editor the shadow was gone! However, my changes produced an unfortunate effect on the screen: it became unstable and moving around would render either the top or bottom half of the screen blank. The reason I copied the GeoPcDx's "TransformDependency" section is I wonder if changing the fourth line in that section would fix the instability. If my guess is correct, what should the "-1" be changed to?

If my guess is off-target (which is likely *!rolleyes!* ) do you have a suggestion as to how to fix the problem?

Again, thank you for the time and effort you put into your finely detailed response to my query!

Dave
You do not have the required permissions to view the files attached to this post.
User avatar
Shawmut
 
Posts: 30
Joined: Sat Jan 19, 2019 5:08 pm

Re: How to make a .TgPcDx file invisible

Unread postby QcRail » Sat Apr 26, 2025 6:01 pm

You are quite welcome and it was a pleasure to share my many hours invested in this fun hobby. More, sharing a very rewarding thus making a more enjoyable hobby.
QcRail. aka Bernard Lafargue
QcRail
 
Posts: 468
Joined: Fri Jun 29, 2012 1:17 pm
Location: Montréal, Qc. Canada


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 7 guests

cron