Skip to content

Implement texture compression and downscaling optimizations#1337

Draft
adfriz wants to merge 1 commit into
leezer3:masterfrom
adfriz:texture-compression
Draft

Implement texture compression and downscaling optimizations#1337
adfriz wants to merge 1 commit into
leezer3:masterfrom
adfriz:texture-compression

Conversation

@adfriz

@adfriz adfriz commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

WIP, only tested on windows with object viewer, route viewer and main program.

Just realize opengl technically support texture compression such as BC1 / DXT, if we use this this should use less RAM/VRAM

currently not have UI, needs to write manually the setting in the options.cfg or options_ov.cfg or options_rv.cfg under [Quality] sections.

compresstextures = true or false
maxtexturesize = 256 or 512 or 1024

max texture will downscale only the texture if greater than the resolution specified.
currently i use console logs for estimating the memory savings, AFAIK it wont drop the ram usage immediately, we need to wait the next GC sweep. Also, compressing and downscaling needs time, it will make the loading longer.

@adfriz

adfriz commented Jun 18, 2026

Copy link
Copy Markdown
Contributor Author

oops, this must be a PR draft 😅

@adfriz
adfriz marked this pull request as draft June 18, 2026 06:19
@leezer3

leezer3 commented Jun 20, 2026

Copy link
Copy Markdown
Owner

My initial thoughts would be that this whilst interesting I'm not sure this is really going to give us any decent gains if developers have actually optimised properly.
You're still storing the textures as uncompressed in RAM, and assuming VRAM is available, this is going to do nothing particularly helpful- I suspect the limitation here will be passing the texture over the RAM to VRAM bus.

You could possible compress the in-memory texture to DXT on load and copy the compressed data direct to VRAM, but that would probably come with re-writing the entire texture class.


The 'normal' problem trains in terms of RAM / VRAM are NYCTA content, such as those from here:
https://sites.google.com/view/openbvetraindownloads/trains

Essentially, they're an absolute disaster zone in terms of texture sizing (most way too big, and not to power of 2 either), total texture counts, and general practices.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants