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

Jump to content

  • 2 Pages +
  • 1
  • 2
  • 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: 162
  • 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,354
  • 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,354
  • 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: 162
  • 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 online   Genma Saotome 

  • Owner Emeritus and Admin
  • PipPipPipPipPipPipPipPipPipPipPipPipPip
  • Group: ET Admin Group
  • Posts: 15,651
  • 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,354
  • 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: 162
  • 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,354
  • 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,510
  • 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,354
  • 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.

#11 User is offline   edwardk 

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

Posted 05 February 2018 - 02:52 PM

I was just informed that there is a bug when running in Winter only. I will be looking into this.

Edit: On second thought, before I fix anything, the current bug is why we do not have night textures when its winter/snow. The current issue is that when running in Winter, its attempting to locate the "Night folder" in the "Snow directory". This does not currently exist. I would like to ask those to experiment by adding the "Night folder" to the "Snow directory" and let me know what the results are. My recent fix could have made having snow/night textures possible.

Edit: While testing older versions, this was always possible except the dds file was not recognized. Unfortunately, I did not know about it since I do not run activities at night in the snow. This may be old news.



Edward K.

#12 User is offline   edwardk 

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

Posted 05 February 2018 - 07:19 PM

James,

The second request you brought up should be fine. Turns out the only area that needed change was the helper area. Materials.cs is back to the way it was.

Edward K.

#13 User is offline   mbm_OR 

  • Conductor
  • Group: Posts: Active Member
  • Posts: 261
  • Joined: 03-July 15
  • Gender:Male
  • Location:Spain
  • Simulator:Open Rails
  • Country:

Posted 06 February 2018 - 02:12 AM

View Postedwardk, on 05 February 2018 - 02:52 PM, said:

its attempting to locate the "Night folder" in the "Snow directory".

Hi Edward K.,
It works, moving the Night folder to Snow folder.
But, is there no other option to avoid modifying all the original Msts textures folders? It's a suggestion.

Original tree:
Attached Image: Msts-folders-textures.jpg

Regards,
Mauricio

#14 User is offline   edwardk 

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

Posted 06 February 2018 - 03:01 PM

A recent submission on my part for X4056 was not complete which would cause the errors in compiling. This was now corrected as of X4057.

Edward K.

#15 User is offline   edwardk 

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

Posted 06 February 2018 - 04:00 PM

Mauricio brought up a good fact on having to modify everything. Once I know the recent submission I made is good, there is one test that I can perform and that will include checking if the Night folder is present. If not, a null is returned and there should be nothing but dark buildings. This would make having the Night folder anywhere else such as the Snow Directory an option. The main Night folder will always be present. Mauricio was the person who let me know that he had texture issues which I thought was odd. I am still in the process of checking into this.

Edit: This started as fixing the DDS file issue so the aspect of snow/night textures could very well involve possible resource issues. Once I submit the fix with the directory check, I will note it here and ask people to test it as much as possible.

Edward K.

  • 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