Jump to content

Texture Loading


Go to solution Solved by mrwonko,

Recommended Posts

This is a bit of an expert query, but I'm wondering if anyone knows the answer.

 

I'm trying to find out what is best practice for using image files for player model textures in JKA in consideration to performance. Specifically I'm interested in four closely related questions:

 

1. When loading a texture for a section of the model, does JKA load the entire image file that's named as the source, or only the area of the image file that corresponds to the model section, based on the UV Map?

 

2. If the same image file is used on multiple sections of the model for the textures, will JKA reload the same image file each time, or keep it in memory and simply re-use it on each model section?

 

3. When using cull twoside, is it important to cover only the minimum two-sided texture area required?

 

4. How much of an impact do player model texture files make in practical terms on the speed of the game? Is this something that I should be worrying about at all?

Asgarath83 likes this
Link to comment
  • Solution
  • the whole file is loaded and kept in memory
  • each file is only loaded once
  • It may be marginally faster, but it probably makes no difference practically.
  • Probably nothing to worry about, unless you use dozens of textures at 2k+ resolution.
Cerez likes this
Link to comment

Makes sense. Thanks, @@mrwonko! So reusing the same image file as textures for different model sections (or even models) would technically improve performance, not hinder it, right?

 

I guess it's only a matter of how neat you want to keep your textures for ease of use, and how much space you have to work with within the given resolution of the image file.

 

(My biggest texture file is 1024x1024 currently, so I guess this question in my case is quite trivial, then.)

NumberWan likes this
Link to comment

@@Cerez

Yes, using the same texture helps a lot. It's also applicable, when you deal with NPC count for instance: you use the same model and NPC file, but different skins for instance. Thus instead of 300+ characters you can have thousands of them in your story.

Cerez likes this
Link to comment

Yep, reusing the texture file for different parts of the model would be beneficial. It means less images need to be loaded into memory at once. It's essentially a form of a Texture Atlas. For a list of all the images loaded by the game while playing, just use the /imagelist command in the console.

 

And yeah, it's just finding a good balance of separating textures into different files and working with the resolution you want to. If it's easier to split the textures out, do it. If it's easier to have it on one texture for UV mapping, do it. Optimisation can be left until afterwards if necessary.

Cerez likes this
Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...