Elvas Tower: 3D Cabview Window Alpha Issue - Elvas Tower

Jump to content

  • 2 Pages +
  • 1
  • 2
  • You cannot start a new topic
  • You cannot reply to this topic

3D Cabview Window Alpha Issue Rate Topic: -----

#1 User is offline   superheatedsteam 

  • Engineer
  • Group: Posts: Contributing Member
  • Posts: 608
  • Joined: 28-June 08
  • Location:Perth, WA
  • Country:

Posted 06 May 2022 - 05:25 AM

I have found a problem with OR v1.4 and MG v123 not displaying 8-bit alpha translucency consistently in a 3D cabview. If the camera view is not within approximately 1.3 metres of origin point of the object that has the texture applied, then the alpha channel is drawn as if it was a 1-bit alpha (completely transparent). The problem does not occur in OR v1.3 so this may have something to do with the change in graphics engine that OR v1.4 and MG share.

When starting in the 3D cabview, you will see the 'Right Side Front' and 'Right Side Rear' windows as well as the 'Front and rear windows' are drawn with a translucent alpha (8-bit). These windows have their origin points within 1.3 metres of the starting camera position where the drivers head would be. Rotate the view to the left of the cab and observe the 'Left side rear' and 'Left side front' as well as the 'Left front door' windows are drawn completely transparent as one would expect with a 1-bit alpha.

Attached Image: example2.jpg

The image below has lines pointing to the origin points for the respective objects in Blender.

Attached Image: origin_points.jpg

To view the problem, use the ALT + left cursor key to move the camera view towards the left side of the cab. When the camera position is within the 1.3 metres of the origin points for the respective left hand side windows, they will change from displaying as transparent to showing with translucency. Rotate the camera to view the the drivers side and the drivers side windows are now displaying as transparent. Moving the camera left and right will show the change in window transparency.

I have confirmed that it is the distance of the origin point for the object from the camera location that controls is the window is drawn as translucent or transparent. I did this by moving the origin point for the left side windows within 1.3 metres of the driver sitting position. That resolves the issue for the side windows but cannot be done for the front door as moving the origin point affects the rotation point for the door open/close animation.

Oddly if you move the camera view outside the left side of the cab the translucency remains on the front and rear windows when beyond the 1.3 metre distance yet disappears when the camera view is moved outside the right hand side of the cabview.

I have a attached a locomotive with the 3D cabview to demonstrate the issue. Excuse the crudeness of the models, they are a work in progress.

Attached File  AU_HI_SD50S.zip (26.81MB)
Number of downloads: 307

This may or may not be related to the following reported issues:

http://www.elvastowe...ow-alpha-issue/

http://www.elvastowe...aphical-issues/

Cheers,

Marek.

#2 User is offline   superheatedsteam 

  • Engineer
  • Group: Posts: Contributing Member
  • Posts: 608
  • Joined: 28-June 08
  • Location:Perth, WA
  • Country:

Posted 07 May 2022 - 07:48 PM

In addition to the above I have been testing another issue in the experimental version U2022.05.07-1836. It is not obvious when stationary, but when moving there was considerable Z fighting between closely located, but not co-planer geometry in this cab view.

This is most apparent on the labels on the control stand. This has been resolved by increasing the minimum gap between geometry to 1mm. Note that this Z fighting does not occur on the v1.4 release version.

The above reported 8-bit alpha display issue remains in the experimental version as well.

Cheers,

Marek.

#3 User is offline   ErickC 

  • Superintendant
  • Group: Posts: Elite Member
  • Posts: 1,061
  • Joined: 18-July 17
  • Gender:Male
  • Location:Hastings, MN, US
  • Simulator:ORTS
  • Country:

Posted 06 November 2022 - 02:25 AM

Unfortunately I haven't even had luck with moving the pivot close to the eye point. I am at my wits end with this problem. I have tried duplicating everything I did with my GP7/GP9 cab (which works fine) to no avail. I duplicated the material and hierarchy setup pretty precisely. It seems like OR is extremely capricious about exactly what alignment of the stars causes a shape to have properly working alpha channels in the cab.

Pretty much the only workaround that consistently works is separating the cab walls from the controls and making the cab walls a freight shape only visible in the 3D cab. It's just way more work than it ought to be.

#4 User is offline   superheatedsteam 

  • Engineer
  • Group: Posts: Contributing Member
  • Posts: 608
  • Joined: 28-June 08
  • Location:Perth, WA
  • Country:

Posted 06 November 2022 - 12:44 PM

Have a look at the following thread where Hamza97 found a workaround which also resolved the issue in my cab view.

http://www.elvastowe...passenger-view/

Cheers,

Marek.

#5 User is offline   Jonatan 

  • Vice President
  • Group: Posts: Elite Member
  • Posts: 2,770
  • Joined: 29-March 10
  • Gender:Male
  • Location:Somewhere.
  • Simulator:MSTS and Vehicle Simulator
  • Country:

Posted 06 November 2022 - 02:00 PM

Like Erick I still have these issues. I also followed the advice in that thread with no success.

#6 User is offline   ErickC 

  • Superintendant
  • Group: Posts: Elite Member
  • Posts: 1,061
  • Joined: 18-July 17
  • Gender:Male
  • Location:Hastings, MN, US
  • Simulator:ORTS
  • Country:

Posted 11 November 2022 - 04:08 PM

I actually finally got it to work after a few more tests. The main thing that I was missing is that the alpha parts need to have a whole separate material, not just a separate image in a multi-material (previously was using a single multi-material). Because everything in the 70-tonner cab is on a single image, what ended up working was exporting with a dummy texture in the second material, then editing the texture entries in the shape file so that both entries point to the same image.

So with 3D cabs, it makes sense to only use multi-materials on parts where a single part needs to have several different materials applied and doesn't have alpha transparency. This still feels unnecessary and it should be addressed someday, but at least we have a workable solution for now.

So the material setup I will likely use on the final model will be to have the cab walls use one material and the controls use a different material. One image will just be a copy of the main one but with a different filename to preserve the multiple entries. On export, since I have to edit the wiper animation length, animated part names, texture paths, and texture extensions anyway, I will change the dummy entry to point to the main image. Problem solved.

#7 User is offline   Jonatan 

  • Vice President
  • Group: Posts: Elite Member
  • Posts: 2,770
  • Joined: 29-March 10
  • Gender:Male
  • Location:Somewhere.
  • Simulator:MSTS and Vehicle Simulator
  • Country:

Posted 11 November 2022 - 09:19 PM

I use an alpha texture for my window planes, which are separate parts linked to the cab and with their own material and texture. Still no luck. I'm using Gmax.

The last resort would be to export the window planes as an FA and see if it works that way, an animated fire FA seems to show up in the cabview..

#8 User is offline   ErickC 

  • Superintendant
  • Group: Posts: Elite Member
  • Posts: 1,061
  • Joined: 18-July 17
  • Gender:Male
  • Location:Hastings, MN, US
  • Simulator:ORTS
  • Country:

Posted 11 November 2022 - 09:36 PM

Do you want the 70-tonner test export scene and exported model as an example? I could Dropbox 'em for ya.

#9 User is offline   akioyamamura 

  • Hostler
  • Group: Posts: Active Member
  • Posts: 90
  • Joined: 30-August 21
  • Gender:Male
  • Simulator:Open Rails
  • Country:

Posted 16 November 2022 - 02:51 PM

View PostErickC, on 11 November 2022 - 09:36 PM, said:

Do you want the 70-tonner test export scene and exported model as an example? I could Dropbox 'em for ya.


Please, if you could send me too I would be grateful. I tried everything too solve this problem unsuccessfully.

#10 User is offline   ErickC 

  • Superintendant
  • Group: Posts: Elite Member
  • Posts: 1,061
  • Joined: 18-July 17
  • Gender:Male
  • Location:Hastings, MN, US
  • Simulator:ORTS
  • Country:

Posted 26 November 2022 - 02:46 PM

Unfortunately the more I test the more I realize that the problem as it stands is unsolvable, especially as cabs become more functional. I can get the windows to work right if the camera is in a very specific spot and if the condition of the switches in the cab is very specific. But if I turn the gauge lighting on (which uses the cab light switch), the distance needed for parts to display correctly decreases significantly and we're back to 1-bit alpha for everything outside that narrow radius. The solution would be to move the pivots so they're all within a short distance of the seat at all times, sure, but OR was designed to allow us to move around the cab - so what's the point of even having a 3D cab if you have to constrict the seat position and the camera movement?

I think the reality is that TS20xx, for all its faults, is starting to look pretty good right now.

#11 User is offline   superheatedsteam 

  • Engineer
  • Group: Posts: Contributing Member
  • Posts: 608
  • Joined: 28-June 08
  • Location:Perth, WA
  • Country:

Posted 26 November 2022 - 05:29 PM

The issue is solvable, but it needs to be solved in the OR source code. The issue appears to have started when the conversion to 64-bit occurred. Prior to that point in time, the geometry in our 3D cab views did not, and still does not have an issue. We just need to wait for a programmer that has the time and inclination to find and fix the problem, or provide a stable solution that cab builders can implement.

I stopped adding any more fancy stuff or trying to find 'work arounds' as these can be broken later when the actual cause is resolved. In the mean time, I have no shortage of other projects that need some attention.

Cheers,

Marek.

#12 User is offline   ExRail 

  • Fireman
  • Group: Posts: Active Member
  • Posts: 188
  • Joined: 31-December 21
  • Gender:Male
  • Simulator:ORNYMG
  • Country:

Posted 25 July 2023 - 08:26 AM

I just ran into this issue, at first i just made the windows part of a Freight Animation since i knew 8 bit transparency worked there, but this time i tried the editing the s. file and changed Texdiff to BlendATexDiff as suggested and that works, then I look at the py script and changed Texdiff to BlendATexDiff witch resulted in a s. file with only one shader named BlendATexDiff and that also worked, then in 1.4 (where it did not work) I saw if I moved backwards the windows stared showing, so I set the objects Origin to Geometry(as some one suggested) in Blender 3.6 and that works both in 1.4 & 1.5 without needing any freight animation, editing of S. file or hacks. The Windows object materiel is set to normal lighting and Alpha Blended transparency, and the texture is a DDS DXT5.

Now the light in the narrow window makes it looks like it's a little bit steamy
Attached Image: Windows2.jpg

Now I want it animated, FS2004's 15 fps rain VC animation was not that bad and is way better than FSX's nothing.

#13 User is offline   pwillard 

  • Foreman Of Engines
  • Group: Posts: Contributing Member
  • Posts: 881
  • Joined: 03-March 08
  • Gender:Male
  • Location:Cumming, Ga
  • Simulator:OpenRails
  • Country:

Posted 25 July 2023 - 09:59 AM

So you are saying that for CABS, you "set the object's Origin to Geometry" instead of "world origin" and it works?

#14 User is offline   ErickC 

  • Superintendant
  • Group: Posts: Elite Member
  • Posts: 1,061
  • Joined: 18-July 17
  • Gender:Male
  • Location:Hastings, MN, US
  • Simulator:ORTS
  • Country:

Posted 25 July 2023 - 10:10 AM

View Postpwillard, on 25 July 2023 - 09:59 AM, said:

So you are saying that for CABS, you "set the object's Origin to Geometry" instead of "world origin" and it works?

It will work so long as all objects with 8-bit alpha have pivots within 1.5m of the camera eye at all times - so if you move the camera further than 1.5m from the window's pivot, the alpha will render as 1-bit. You also need to have at least two distinct images (not materials, images) specified in the model. Because my cabs are designed to minimize drawcalls and typically use a single texture, I get around this by assigning a material that uses a copy of the texture to at least one part, then editing the shape file to have two references to the same image after export (which is when I have to set the image paths anyway).

It's a bit tedious and I wish they would set this distance to something a lot greater than 1.5m, but it doesn't seem to be a priority for anyone and I don't think it will get fixed any time soon. 3D cab rendering doesn't seem to be much of a priority in general. The latest testing versions of OR have issues with animated nodes disappearing when the battery switch is off, and nobody really seemed interested in analyzing that bug, either.

#15 User is offline   mrmosky 

  • Foreman Of Engines
  • Group: Posts: Contributing Member
  • Posts: 810
  • Joined: 02-October 16
  • Gender:Male
  • Location:Chasetown
  • Simulator:Openrails
  • Country:

Posted 25 July 2023 - 10:45 AM

I have had this problem with my 3d cab, but it seems to be solved for me - at the moment.

It was moving the origin of the object that worked for me, as I described in another thread.I can move the camera where I like in the cab or outside, and the transparency remains stable and visible.

http://www.elvastowe...post__p__294599

I am happy to share my model with anyone who wants to verify this on another installation.

Erick - I don't attempt to minimise drawcalls on a 3d cab. After all, there is only ever going to be one of them in view at any time, and I have never had any fps issues. Why make life harder on myself?

Cheers,

Geoff

  • 2 Pages +
  • 1
  • 2
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users