MAPINFO - Precache Texture
Moderator: GZDoom Developers
- Ral22
- Posts: 531
- Joined: Sun Sep 05, 2010 12:09 pm
- Preferred Pronouns: He/Him
- Location: The Fortress of Dr. Radiaki
- Contact:
MAPINFO - Precache Texture
It was brought up within another thread, but I see a lot of merit and usefulness in a feature such as this. It would be format very similarly to "Precache Sounds" within the MAPINFO lump as well.
Example in use:
PrecacheTextures = "FWATER1", "NUKE1", "WOOD1"
It's usefulness comes more in handy when it could load large sky textures for the skybox, or if it could precache HudMessage graphics as well. In my standard gameplay, I usually encounter a small moment of lag when HudMessage graphics are displayed or I exit a room and see a large (Or GL) skybox.
What do you all think? A useful feature or no?
Example in use:
PrecacheTextures = "FWATER1", "NUKE1", "WOOD1"
It's usefulness comes more in handy when it could load large sky textures for the skybox, or if it could precache HudMessage graphics as well. In my standard gameplay, I usually encounter a small moment of lag when HudMessage graphics are displayed or I exit a room and see a large (Or GL) skybox.
What do you all think? A useful feature or no?
-
-
- Posts: 3202
- Joined: Wed Nov 24, 2004 12:59 pm
- Graphics Processor: ATI/AMD with Vulkan/Metal Support
- Contact:
Re: MAPINFO - Precache Texture
I think the reason this wasn't added is that it was deemed sufficient to simply add a dummy sector with the needed textures.
- Ral22
- Posts: 531
- Joined: Sun Sep 05, 2010 12:09 pm
- Preferred Pronouns: He/Him
- Location: The Fortress of Dr. Radiaki
- Contact:
Re: MAPINFO - Precache Texture
This is not always the case. For some reason (Perhaps GZDoom only) I only have the lag when I "look" at the textures. Even if the texture is placed on a map, it won't load until it is actually seen (At least, for me).
Nonetheless, perhaps this feature could be more beneficial if it would support HudMessage graphics. The loading of them sometimes ruins the fade in/out or scrolling effects I place on them.
Nonetheless, perhaps this feature could be more beneficial if it would support HudMessage graphics. The loading of them sometimes ruins the fade in/out or scrolling effects I place on them.
Last edited by Ral22 on Mon Sep 22, 2014 5:29 pm, edited 1 time in total.
Re: MAPINFO - Precache Texture
Waaaay back in time when my weather system was in its infancy, I used 100 separate textures that go from a clear sky to an overcast sky. The skybox would flip between these textures in real-time as the weather shifted around. This made the game appear really laggy as each texture is loaded for the first time (they were 1024x flats :O).
To work around this, I setup a dummy sector that shows all 100 flats in a single room (cut the sector into 100 strips and texturing them appropriately, and placed a camera far enough so that its initial POV would catch all of the textures) and finally setup a small 32x32 camera texture placed on the HUD but OFF SCREEN so essentially the player is "looking" at all of those 100 textures but you can't see them on the HUD because I placed them far away (had I continued to use this overly convoluted solution, I would eventually find out that my trick will break with multiple-monitor setups). This little camera texture would be drawn on on the screen with HUDMessage everytime the player enters that particular map.
Good thing I scrapped that convoluted shit as I developed more advanced ways to render the sky with cloud particles and eventually a skydome... :P
To work around this, I setup a dummy sector that shows all 100 flats in a single room (cut the sector into 100 strips and texturing them appropriately, and placed a camera far enough so that its initial POV would catch all of the textures) and finally setup a small 32x32 camera texture placed on the HUD but OFF SCREEN so essentially the player is "looking" at all of those 100 textures but you can't see them on the HUD because I placed them far away (had I continued to use this overly convoluted solution, I would eventually find out that my trick will break with multiple-monitor setups). This little camera texture would be drawn on on the screen with HUDMessage everytime the player enters that particular map.
Good thing I scrapped that convoluted shit as I developed more advanced ways to render the sky with cloud particles and eventually a skydome... :P
- NeuralStunner
-
- Posts: 12328
- Joined: Tue Jul 21, 2009 12:04 pm
- Preferred Pronouns: No Preference
- Operating System Version (Optional): Windows 11
- Graphics Processor: nVidia with Vulkan support
- Location: capital N, capital S, no space
- Contact:
Re: MAPINFO - Precache Texture
Thus why I support this feature suggestion.Nash basically wrote:

- justin_see
- Posts: 183
- Joined: Tue Jul 30, 2013 7:49 pm
Re: MAPINFO - Precache Texture
Projects with true high resolution resources would be greatly benefited by such a feature. The "texture on a wall" thing only works for smaller jobs. I can say for my own high resolution project I have to make this "cutscene intro" just to load the monsters and maps so the game runs normally. It looks fine but I would rather not have to resort to such a construct. Wouldn't push anyone to implement it but it is a great idea.
Re: MAPINFO - Precache Texture
Oh wow this is massive, thanks Graf!
- Graf Zahl
- Lead GZDoom+Raze Developer
- Posts: 49223
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: MAPINFO - Precache Texture
Nash wrote:Oh wow this is massive, thanks Graf!
Why massive, this was a 5 minute thing...

- Ral22
- Posts: 531
- Joined: Sun Sep 05, 2010 12:09 pm
- Preferred Pronouns: He/Him
- Location: The Fortress of Dr. Radiaki
- Contact:
Re: MAPINFO - Precache Texture
This is one of the finest things I've ever seen. Thank you kindly, Graf!
Does this support the cache-ing of Graphic lumps as well, such as for HudMessages? Or does this need testing to verify?
Does this support the cache-ing of Graphic lumps as well, such as for HudMessages? Or does this need testing to verify?
- NeuralStunner
-
- Posts: 12328
- Joined: Tue Jul 21, 2009 12:04 pm
- Preferred Pronouns: No Preference
- Operating System Version (Optional): Windows 11
- Graphics Processor: nVidia with Vulkan support
- Location: capital N, capital S, no space
- Contact:
Re: MAPINFO - Precache Texture
Isn't it all part of the same texture manager? I think it's worth a try.Ral22 wrote:Does this support the cache-ing of Graphic lumps as well, such as for HudMessages? Or does this need testing to verify?
I know one of my mods gets a small delay when first displaying a high-res scope graphic. Would be neat if that could be avoided.
Re: MAPINFO - Precache Texture
I tried the PrecacheTextures feature in MAPINFO, as follows:
PrecacheTextures = "XMETL08", "XMETL09", "XMETL10"
However, I get the following error when GZDooM loads up:
Script Error, "Paranoic.pk3: MAPINFO" Line 90:
Unknown Texture "XMETL08"
Script Error, "Paranoic.pk3: MAPINFO" Line 90:
Unknown Texture "XMETL09"
Script Error, "Paranoic.pk3: MAPINFO" Line 90:
Unknown Texture "XMETL10"
These graphics are in the Textures folder of the pk3.
I also used these graphics as patches to create "XMETL08A", "XMETL08B", etc. in the TEXTURES lump. When I insert these names in the MAPINFO I get the same error.
Is this feature intended only for textures defined in TEXTUREx and not in TEXTURES?
PrecacheTextures = "XMETL08", "XMETL09", "XMETL10"
However, I get the following error when GZDooM loads up:
Script Error, "Paranoic.pk3: MAPINFO" Line 90:
Unknown Texture "XMETL08"
Script Error, "Paranoic.pk3: MAPINFO" Line 90:
Unknown Texture "XMETL09"
Script Error, "Paranoic.pk3: MAPINFO" Line 90:
Unknown Texture "XMETL10"
These graphics are in the Textures folder of the pk3.
I also used these graphics as patches to create "XMETL08A", "XMETL08B", etc. in the TEXTURES lump. When I insert these names in the MAPINFO I get the same error.
Is this feature intended only for textures defined in TEXTUREx and not in TEXTURES?
- Graf Zahl
- Lead GZDoom+Raze Developer
- Posts: 49223
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: MAPINFO - Precache Texture
Ugh...
Looks like MAPINFO does not have access to those textures. This will need to be checked more thoroughly.
Looks like MAPINFO does not have access to those textures. This will need to be checked more thoroughly.
- Graf Zahl
- Lead GZDoom+Raze Developer
- Posts: 49223
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: MAPINFO - Precache Texture
Should be fixed now. Please note that the new code cannot check for texture presence anymore. Since the texture manager gets initialized after MAPINFO the only solution was to let MAPINFO store the textures' names and do the actual lookup during precaching itself.
Re: MAPINFO - Precache Texture
WTF O_O, that was one of the most waited feature I ever wished :O.
I think I even did a request in the zdoom fórum but it ended with a no ;I .
At least, it's now working
I think I even did a request in the zdoom fórum but it ended with a no ;I .
At least, it's now working

Nice solution, ignore if the texture is missing instead of game crash.Graf Zahl wrote:Should be fixed now. Please note that the new code cannot check for texture presence anymore. Since the texture manager gets initialized after MAPINFO the only solution was to let MAPINFO store the textures' names and do the actual lookup during precaching itself.