Elvas Tower: Option "prefer dds texture" problem - Elvas Tower

Jump to content

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

Option "prefer dds texture" problem Rate Topic: -----

#1 User is offline   Hannes44 

  • Fireman
  • Group: Posts: Active Member
  • Posts: 161
  • Joined: 10-October 17
  • Gender:Male
  • Location:Select State/Province
  • Simulator:Open Rails
  • Country:

Posted 19 January 2018 - 02:06 PM

Hi!

The option "Prefer dds texture if available" doesn't work with night textures. Some of my newer houses for my route have only dds textures in the normal folder and in the SNOW and NIGHT folders. In daytime everything works, but in the night all the houses with dds textures are gray.
Did I misunderstand anything or is it a bug?

#2 User is offline   edwardk 

  • Open Rails Developer
  • Group: Posts: Elite Member
  • Posts: 1,352
  • Joined: 11-December 09
  • Gender:Male
  • Location:Chula Vista, CA
  • Simulator:MSTS
  • Country:

Posted 20 January 2018 - 11:24 AM

I also ran a quick test on my test route and sure enough, the ace file used for night textures was fine, but when replaced with a dds file, no night texture. From what I know, the use of dds files is for locomotives, but I have to wonder if the dds usage was meant for scenery files as well. I hope James or someone else with a bit more knowledge can reply. I will investigate on my end.

Edward K.

#3 User is offline   edwardk 

  • Open Rails Developer
  • Group: Posts: Elite Member
  • Posts: 1,352
  • Joined: 11-December 09
  • Gender:Male
  • Location:Chula Vista, CA
  • Simulator:MSTS
  • Country:

Posted 20 January 2018 - 01:01 PM

There is a bug, but until I can figure out the issue do this(if you want). Modify the shape file so that the image is initially pointing to a .dds file. In my test, once this was done, the .dds night texture was used along with the daytime .dds file.

I also recall the gray issue you mentioned. This will happen if there is not enough memory. The use of the .dds texture file at night as an option is a bug.

Edward K.

#4 User is offline   Hannes44 

  • Fireman
  • Group: Posts: Active Member
  • Posts: 161
  • Joined: 10-October 17
  • Gender:Male
  • Location:Select State/Province
  • Simulator:Open Rails
  • Country:

Posted 20 January 2018 - 02:27 PM

I changed the *.ace to *.dds in the *.s files and now it works, as you said, but the method is a bit tedious.

#5 User is offline   Genma Saotome 

  • Owner Emeritus and Admin
  • PipPipPipPipPipPipPipPipPipPipPipPipPip
  • Group: ET Admin
  • Posts: 15,481
  • Joined: 11-January 04
  • Gender:Male
  • Location:United States
  • Simulator:Open Rails
  • Country:

Posted 20 January 2018 - 05:43 PM

Just a f.y.i., when the .dds option became available I switched a number of models to use it and did a check on how much RAM was being used... switched it all back and checked again. From what I saw the .dds textures used quite a bit more memory than did .ace files.

In hindsight I can't say it was a comprehensive test but what I saw was enough for me to not want to use .dds files until such time things like bump maps and surface normals were enabled in OR.

#6 User is offline   edwardk 

  • Open Rails Developer
  • Group: Posts: Elite Member
  • Posts: 1,352
  • Joined: 11-December 09
  • Gender:Male
  • Location:Chula Vista, CA
  • Simulator:MSTS
  • Country:

Posted 20 January 2018 - 09:35 PM

I am close to coming up with a fix for testing. If it is the case that dds files use more memory, then dds files will have to be used sparingly until we can switch to the monogame version.

Edward K.

#7 User is offline   Hannes44 

  • Fireman
  • Group: Posts: Active Member
  • Posts: 161
  • Joined: 10-October 17
  • Gender:Male
  • Location:Select State/Province
  • Simulator:Open Rails
  • Country:

Posted 21 January 2018 - 12:58 AM

Thanks for the info. So I'll stop using *.dds and go back to *.ace textures for now.

#8 User is offline   edwardk 

  • Open Rails Developer
  • Group: Posts: Elite Member
  • Posts: 1,352
  • Joined: 11-December 09
  • Gender:Male
  • Location:Chula Vista, CA
  • Simulator:MSTS
  • Country:

Posted 27 January 2018 - 09:02 AM

I removed the post with the original test files because I found a bug. If you do work with dds files, here are the fixed files based on X4045. The new files fixes the discovered bug and of course the bug reported by the original poster.

Edit: If you do work with dds files and have other issues such as winter. Let me know. Dave mentioned that dds files use more memory, but I have to wonder how the use of the files works under the Monogame version.

Edit2: As a reminder, if the shape file has been modified to use dds files, make sure the usage is for the shape file and the option to use dds files does not have to be checked. If the shape file is using a dds file, the file would have to be located in the main texture directory as well as the night directory.

I also realized the action of removing the post was not necessary. I should have removed the attached files.

Edward K.

Attached File(s)



#9 User is offline   James Ross 

  • Open Rails Developer
  • Group: Posts: Elite Member
  • Posts: 5,498
  • Joined: 30-June 10
  • Gender:Not Telling
  • Simulator:Open Rails
  • Country:

Posted 04 February 2018 - 01:38 AM

View Postedwardk, on 27 January 2018 - 09:02 AM, said:

I removed the post with the original test files because I found a bug. If you do work with dds files, here are the fixed files based on X4045. The new files fixes the discovered bug and of course the bug reported by the original poster.

Edit: If you do work with dds files and have other issues such as winter. Let me know. Dave mentioned that dds files use more memory, but I have to wonder how the use of the files works under the Monogame version.

Edit2: As a reminder, if the shape file has been modified to use dds files, make sure the usage is for the shape file and the option to use dds files does not have to be checked. If the shape file is using a dds file, the file would have to be located in the main texture directory as well as the night directory.

The code changes in X4052 for this fix have a few unnecessary changes I'd like you to undo:

  • All the changes in the "SceneryMaterial" constructor are unnecessary and will complicate maintenance by duplicating code from elsewhere - "Viewer.TextureManager.Get" already does the correct loading operation based on file type.
  • The change from "Simulator" to "Viewer" in the signature of "GetNightTextureFile" is unnecessary - please use "simulator.Settings" instead.


#10 User is offline   edwardk 

  • Open Rails Developer
  • Group: Posts: Elite Member
  • Posts: 1,352
  • Joined: 11-December 09
  • Gender:Male
  • Location:Chula Vista, CA
  • Simulator:MSTS
  • Country:

Posted 04 February 2018 - 03:10 PM

James,

Your message box must be full because I was unable to send you a message so here it is below.

I read your post and the first change was easy enough. I would have kept "Viewer.Simulator" if I found "Viewer.Simulator.Settings". The second issue needs more clarification. The changes I made in Materials.cs is based on the changes found at line #68.

Any ideas as to how I can improve the change since this is handling night textures? The changes in Helper is already passing back the ace file or dds file. The only catch is that the dds files needs this process.("DDSLib.DDSFromFile(nightTexturePath, viewer.GraphicsDevice, true, out NightTexture);") This means we still need to test if its either a dds file or ace file.

Edit: There are only 2 areas in Materials.cs that processes dds files. The first is in the area of line #68 and the area starting at #690 that handles night textures.

Edward K.

  • 3 Pages +
  • 1
  • 2
  • 3
  • 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