Sprite Texture Tile

Remember, just because you request it, that doesn't mean you'll get it.

Moderator: GZDoom Developers

Sprite Texture Tile

Postby Steve5563 » Fri Oct 30, 2020 9:20 am

hi there,
is it possible to define an actor that has a flat sprite flag to tile it's texture over a desired amount in the X / Y axis when defining and actor.
EG. if you have a seamless texture designed for the actor to use at a resolution of 128 X 128, and set the parameters to
TileTextureX: 3.0
TileTextureY: 3.0
gzdoom would tile / repeat the texture texture by 3 more times in the X and Y axis to give us a visible total texture size in game of 512 X 512
this would be real handy when combining the actor with the "Render Radius" set to a large value.
this feature when using a flat sprite can be very beneficial for creating good visuals and hopefully benefiting towards better performance for the gpu vram savings you would gain and also possibly also for the cpu as you would need less actors to do the same effect if it is a repeating effect in the level area less such as,
building fake 3d floors,walls,ceilings,handrails,overhead pipes, hanging electrical cables that the player wont interact with or use in the level, this effect is towards map decoration and visuals.
large coverage area's for fake volumetric blades of grass / fog using a texture stacking technique apparently called "fur shading" (flat sprite stacking with low value height offset's) EG. go to the 23:20 mark in this video and watch between 23:20 and 23:46 mark: https://www.youtube.com/watch?v=ybQv1nfAEr0
you can make sky box's that use seamless multi layer cloud textures without having to use 3d floors.
tiled textures such as neon lights along large buildings stacked multiple times vertically to create skyscraper visuals that are a pain to do with lines and mid textures that add unwanted extra map lines which add extra vertices and polygons to the level.
large fake volumetric rain particle effects. water running off of rooftops, large scale volumetric rain drops that only uses a few falling actors compared to traditional individual actors, animated rain drop ripple effect tiled over a large surfaces over multiple texture variations.
etc etc i could go on for ages.
if this is possible it will be a very powerful feature for map designer's that want's to fill a level with large scale visuals which wont tax the gpu v-ram and hopefully benefit the towards less cpu overhead when used correctly as you wont need to use as many actors to fill a level with visual content.
if your able to set this feature up so you can also change the X / Y tile amount by using scripting that's added to the actor states, you could create some really cool looking visual effects.
for example you can have an actor running their own script to visually create a random vertically bouncing graphic equalizer bar by constantly changing "Tile Y " amount and with multiple actors side by side with different timing's can visually create a big bouncing stereo graphic equalizer effect along the side of a building in a blade runner themed map the most important thing here is while using this tillable texture feature the texture wont be stretched like what texture scaling does.
this can be a very powerful feature to the right person that wants to bring next gen visuals to doom, i really hope this can be added.
thanks for your time.
Last edited by Steve5563 on Wed Nov 11, 2020 3:55 am, edited 6 times in total.
User avatar
Steve5563
 
Joined: 28 Jan 2019
Location: Australia

Re: Sprite Texture Tile

Postby Steve5563 » Fri Oct 30, 2020 9:26 pm

To add on to the first description with regards the X / Y axis texture tiling could it be possible to tell gzdoom which direction to tile the texture by using positive or negative number values.
so if you have the tile texture values set to,
TileTexture X: -3
TileTexture Y: 3
this value will tell gzdoom to tile / repeat this texture 3 more times to the left horizontally and 3 more times up vertically.
for another example if you have the tile texture values set to,
TileTexture X:-3
TileTexture Y: 0
the texture will only tile / repeat itself to the left 3 more times from the original texture.
would it also be possible to add a " Tile Mirror " flag to tell gzdoom when tiling the texture by the users definitions to mirror the amount of tiling to be done on the opposite side on the same axis,
so now rather then just having the texture tiling to the left 3 more times, gzdoom will also tile the texture to the right 3 more times as well.
this flag combined with some looped scripting to change the texture tiling amount overtime would give the option for the user to create some really cool looking animation effects.

Last edited by Steve5563 on Sun Nov 01, 2020 8:14 am, edited 2 times in total.
User avatar
Steve5563
 
Joined: 28 Jan 2019
Location: Australia

Re: Sprite Texture Tile

Postby Steve5563 » Sun Nov 01, 2020 6:39 am

They say images are worth 1000 words so i hope this helps.
currently with doom when you create an actor you can assign a "flat sprite" flag to it.

i would like to have the option to tell gzdoom that with this particular actor and the texture assigned to it, that i want to be able to repeat / tile this texture in a certain direction,
using a + or - number value.
this is so i can tell gzdoom how many times i want the texture to be repeated / tiled, based on a X and Y axis setup with the original texture being at the center of this X / Y axis layout.

it would also be greatly appreciated if we are able to change these number values in the actor states as an example, in the actor spawn state this can have a looping script that can constantly change the tiling values.
(eg. could be used with a neon tube light texture with the texture set to full bright for a growing effect without having to stretch the image like scaling does to a texture if scaled in one direction only )

here is a picture with the actor's radius box highlighted in the green outline, the actor itself is directly facing us, and the texture assigned to it is representing some hanging power lines.
(the white background would be transparent if used in a map)
Spoiler:

now if i had a "Texture Tile" flag, i could tell gzdoom that this actor can tile the texture in a certain direction using number values for an X and Y axis layout,
these numbers have positive and negative values.

If i want the texture to only tile / repeat itself to the left of the original texture i would have to use ( - ) number value on the X axis parameter and a ( 0 ) number value for the Y axis parameter.
so the parameters you would assign to this actor would look something like this.
+ FLATSPRITE
+TEXTURETILE
TileTextureX:-3 //// this is a + or - number value: negative values makes the texture repeat / tile to the left and positive values make the texture repeat / tile to the right from the original texture.
TileTextureY: 0 //// this is a + or - number value: negative values makes the texture repeat / tile down and positive values make the texture repeat / tile up from the original texture.

// if 0 is to be used here no texture repeating / tiling amont is to be done on this axis.

here is a picture of what i would expect to see in game / gzdoom builder when setting these parameters to this actor.
Spoiler:

now if we have another flag called "Tile Mirror" the texture tiling amount can be duplicated in the opposite direction on the same axis.
so the actor would now have the following flags.
+ FLATSPRITE
+TEXTURETILE
+TILEMIRROR
TileTextureX:-3
TileTextureY: 0
Spoiler:

as you can see this one single actor placed in a level can do a lot of work for decorating a level while only using 1 texture which is fantastic for vram savings,
and also, as this effect is only using one single actor that the cpu needs to keep track of vs 7 of them to get the same result, so hopefully this can be a performance benefit for the cpu and hopefully pass off more work to the gpu, to keep that cpu core blazing fast.
the benefit of having this vs having to draw lines and have to make them cross over each other in all directions in a map, and use these lines for their mid textures to create the same result which increases vertices and polygon count quite quickly to a levels geometry, and as a map designer it's far better to keep these to a minimal amount for improved performance.

here is another example
+ FLATSPRITE
+TEXTURETILE
+TILEMIRROR
TileTextureX:-3
TileTextureY: 3
Spoiler:

now with this mirror effect you can see that this can run into a visual issue depending what the user is trying to do the with this effect, if the user is trying to make this effect to appear as a growing checkerboard effect you can see a visual issue with this.
you could potentially solve this issue by adding another flag called "Tile Offset" this can tell gzdoom to grab the original texture dimension's and use these numbers as the offset values when applying the mirror effect to correct the look.
this "Tile Offset" flag would also need to add an extra texture ( possibly duplicate the number "0" texture) and apply this duplicate to the mirrored side to make up for empty slot where the original texture "0" was as this will be missing to create an even mirrored look.

here is an example of what the parameter's would look like for this actor.
+ FLATSPRITE
+TEXTURETILE
+TILEMIRROR
+TILEOFFSET
TileTextureX:-3
TileTextureY: 3
Spoiler:

as you can see now the effect looks like a true checker board effect with the new offsets and with the duplicated number "0" texture outlined in blue applied to the mirrored side.

if you put all of this together you would have these flags assigned to the actor with a looping script to change the checkerboard tiling effect to appear as is if it's growing in size and then starting over again.
+ FLATSPRITE
+TEXTURETILE
+TILEMIRROR
+TILEOFFSET
TileTextureX:-3
TileTextureY: 3
States
{
spawn:
PWRL A 5 A_TextureTile ( -1, 1) // A_TextureTile ( X axis, Y axis)
PWRL A 5 A_TextureTile ( -2, 2) // A_TextureTile ( X axis, Y axis)
PWRL A 5 A_TextureTile ( -3, 3) // A_TextureTile ( X axis, Y axis)
PWRL A 5 A_TextureTile ( -4, 4) // A_TextureTile ( X axis, Y axis)
Loop
}
if you also add to the scripting to tell the flat sprite to roll in a 360 rotation you could create some really cool looking in game effects and all of this can be done from using a simple tillable texture.
i hope this clears up some confusion to what i am asking for here, this would be a very powerful tool for creative map developers to use which are trying to obtain next gen doom visuals to their levels,
and hopefully if used correctly we can also obtain better performance then what we are getting now when using current methods.
cheers
Last edited by Steve5563 on Mon Nov 09, 2020 7:04 am, edited 1 time in total.
User avatar
Steve5563
 
Joined: 28 Jan 2019
Location: Australia

Re: Sprite Texture Tile

Postby Steve5563 » Sun Nov 01, 2020 8:54 pm

An issue that i have just realized would be how the dynamic lights interact with this type of tiled texture that is bounded to this single actor.
currently as far as i am aware in doom a sprites texture will only have it's color and brightness effected from a dynamic light when the actor's box radius itself is interacting with the dynamic light.
my gut feeling is telling me, to make the tiled texture itself interact with dynamic lights and not from the single actor would be a big complex job on its own.
so i am thinking to realistically fix this issue, since this effect would be mainly used for map decoration anyways,

would be to have a flag applied to this actor to tell gzdoom that this actor will not interact with any dynamic lights.
as currently i can not see a flag on the zdoom wiki page to make an actor dismiss any interaction with dynamic lights.

this flag would resolve the issue of having the single actor interacting with a passing dynamic light ( eg. plasma ball ) and having the actor adjust the tiled texture brightness and color that could be covering a very large area in the map.
it would look very out of place compared to the map sector brightness and color that this actor is placed in.
im guessing you could name this actor flag something like ( +LIGHTDISMISS = This actor will not interact with any dynamic lights. )
User avatar
Steve5563
 
Joined: 28 Jan 2019
Location: Australia


Return to Feature Suggestions

Who is online

Users browsing this forum: No registered users and 1 guest