How to tell GZDoom to scale a custom animated texture?

Ask about editing graphics, sounds, models, music, etc here!
Shaders (GLSL) and SNDINFO questions also go here!

Moderators: GZDoom Developers, Raze Developers

Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.
ichxg0
Posts: 38
Joined: Mon Nov 18, 2024 3:08 pm

How to tell GZDoom to scale a custom animated texture?

Post by ichxg0 »

I'm trying to make some new graphics, and I'm just replacing files with new ones of the same name.. For the most part. One of them I want to animate, which I have down, but now that I have all these new frames of animation, for some reason GZDoom is only scaling the base texture.. I've been running through the wiki, but I can't seem to mimic their examples well enough, I must be missing something.

I think I must need to define the new frames of the custom texture in a TEXTURES definition.. But that's about as far as I get.

Here is video of the issue: https://streamable.com/rlt1b0

this is all my TEXTURES def is:

Code: Select all

Texture SILVER2, 128, 256
{
   XScale 2.0
   YScale 2.0
   Patch SLVR2, 0, 0
   Patch SLVR2a, 0, 0
   Patch SLVR2b, 0, 0
   Patch SLVR2c, 0, 0
   Patch SLVR2d, 0, 0
   Patch SLVR2e, 0, 0
   Patch SLVR2f, 0, 0
   Patch SLVR2g, 0, 0
   Patch SLVR2h, 0, 0
}	
and here is the ANIMDEFS:

Code: Select all

TEXTURE silver2
	Pic slvr2 Tics 12
	Pic slvr2a Tics 2
	Pic slvr2b Tics 2
	Pic slvr2c Tics 2
	Pic slvr2d Tics 2
	Pic slvr2e Tics 2
	Pic slvr2f Tics 2
	Pic slvr2g Tics 2
	Pic slvr2h Tics 24
	Pic slvr2g Tics 2
	Pic slvr2f Tics 2
	Pic slvr2e Tics 2
	Pic slvr2d Tics 2
	Pic slvr2c Tics 2
	Pic slvr2b Tics 2
	Pic slvr2a Tics 2
I also have a GLDEFS:

Code: Select all

brightmap flat SILVER2     { map "BRIGHTMAPS/BM.SILVER2.png" DISABLEFULLBRIGHT }
(Separate, but this should work for a bright map, even on this animated texture, right? assuming the files are in place)

What am I doing wrong here guys?
User avatar
Enjay
 
 
Posts: 26689
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland

Re: How to tell GZDoom to scale a custom animated texture?

Post by Enjay »

OK, I think I see what's wrong here. You have actually only defined one texture, and put 9 patches inside it. They are all at the same coordinates, so they are just sitting on top of each other and hiding one another.

Your textures lump should be more like this (names are just suggestions, but make sense):

Code: Select all

Texture SILVER2, 128, 256
{
   XScale 2.0
   YScale 2.0
   Patch SLVR2, 0, 0
}

Texture SILVER2A, 128, 256
{
   XScale 2.0
   YScale 2.0
   Patch SLVR2a, 0, 0
}

Texture SILVER2b, 128, 256
{
   XScale 2.0
   YScale 2.0
   Patch SLVR2b, 0, 0
}
...
and so on. One texture for each of the appearances.

and your ANIMDEFS should be changed to reflect this:

Code: Select all

TEXTURE silver2
	Pic silver2 Tics 12
	Pic silver2a Tics 2
	Pic silver2b Tics 2
	...
and so on again

You might also want to look at whether the "WorldPanning" flag would be suitable for your texture. This makes the offsets of a scaled texture behave as if it was the same size as the scaled result. This is useful when you are replacing a low-res texture because the low res texture may have been given offsets on the walls it appears on. If you don't use WorldPanning, the texture will be offset by the pixels in the hi-res image, not the effetive scaled down size. e.g. an x offset of 32 will move your scaled texture 32 texture pixels (i.e. 1/4 of the width of your picture) but with WorldPanning, it will move it 32 world units (i.e. 1/2 the width of the effective 64 wide texture).

e.g.

Code: Select all

Texture SILVER2, 128, 256
{
   XScale 2.0
   YScale 2.0
   WorldPanning
   Patch SLVR2, 0, 0
}
And, yes, brightmaps should work on animated textures, once everything is set up properly: one brightmap definition for each of the textures within the animation.
ichxg0
Posts: 38
Joined: Mon Nov 18, 2024 3:08 pm

Re: How to tell GZDoom to scale a custom animated texture?

Post by ichxg0 »

OK, I think I see what's wrong here. You have actually only defined one texture, and put 9 patches inside it. They are all at the same coordinates, so they are just sitting on top of each other and hiding one another.

Your textures lump should be more like this (names are just suggestions, but make sense):
Okie dokie, this makes sense.. I tried this also since I posted, but it still didn't achieve the desired result.. And now the animation is 100 percent big, not even the first frame represented correctly. But I don't quite understand; maybe you can't replace a stock texture with an animated one? I thought if I defined all the pics in ANIMDEFS anytime a SILVER2 was mapped it would reference the texture lump, which would in turn point it to the "SLVR2" pics.. Right?

I'm confused that it somehow knows to map the whole animated texture to the right area, but it's somehow ignoring my TEXTURES entry? Because I tried again just to be sure and set up my definition exactly as yours, and I still get oversized textures...

But thanks about the World Panning thing, that was bound to confuse and frustrate me at some point down the line..
ichxg0
Posts: 38
Joined: Mon Nov 18, 2024 3:08 pm

Re: How to tell GZDoom to scale a custom animated texture?

Post by ichxg0 »

Woo! I got it. My problem was that I thought I had updated the ANIMDEFS.. But I hadnt. Good old operator error. Also got the bright maps working! Thanks so much for the help man! I really appreciate it, your presence online, you share a good deal of knowledge :)
User avatar
Enjay
 
 
Posts: 26689
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland

Re: How to tell GZDoom to scale a custom animated texture?

Post by Enjay »

I'm glad you got it working. :thumb:
User avatar
Enjay
 
 
Posts: 26689
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland

Re: How to tell GZDoom to scale a custom animated texture?

Post by Enjay »

I'm glad you got it working. :thumb:

Edit: Oh, another thing that may, or may not, be of interest, in case you haven't spotted it. Animated textures, by default, do not allow decals (to prevent bullet chips and plasma scorches appearing on the front of waterfalls etc). Your texture looks like one where I don't know if decals would be appropriate or not. If you do want decals on your animated texture, you can add allowdecals to your animation definition.

Code: Select all

TEXTURE silver2
	allowdecals
	Pic silver2 Tics 12
	Pic silver2a Tics 2
	Pic silver2b Tics 2
	...

Return to “Assets (and other stuff)”