I wish to use it to show when an enemy is charging up a dash attack, by “growing” from the bottom of the enemy.
So I want to scale it from the middle horizontal line, so that it doesn’t deform the arrows and end. Is that possible to set up in material?
I suppose the decal actor should just be the max size to simplify things, and handle the size entirely in the material.
This seems like such a common graphical effect, so there’s probably established ways to do things like this.
Scaling it in general is easy, I just need to be able to scale it in one direction without deforming.
I still haven’t been able to reproduce a gap like that I’m afraid - the texture you shared didn’t have any transparency though so I added it in photoshop - perhaps that has something to do with it?
Messing with UVs almost always does ruin mipmaps because they are automatically generated by looking at the difference in UV space. These effects interfere with the shaders ability to rely on the standard calculation. You’ll need to explicitly derive the mips.
Change the texture samples mip mode to allow it to be manually derived. Use an unmodified Texture Coordinate and feed it into DDX and DDY nodes, and those into the DDX and DDY slot of the texture sample. This will force it to generate mips based on an unaltered coordinate instead of the modified UVs.
If I’m not mistaken, each dimension only needs to individually be a power of 2. Because both 128 and 512 are power of 2 numbers, the engine should be able to mip them even though the whole image itself is not perfectly square.
It’s not the grid I’m afraid, I get a 1 pixel gap wherever I define my “shearing point” to be.
Using preserve border exacerbates it.
In this particular instance I could get away with not using mips.
Perhaps a way to duplicate a line of pixels and moving the rest to make it longer, instead of making a cut to make it shorter would be an alternate method?
There is no need to disable mips or find and alternate way to achieve the effect. Just calculate the mips using an unaltered texture coordinate like I mentioned and it should work fine.
To be more precise, the shader guesses which mip it needs by comparing two adjacent coordinates in screen space. So if you skip a bunch of pixels in your UVs, it will look like the texture is really far away to the shader when it sees the coords change fast. This will cause it to choose the lowest quality mip for that spot, which creates a seam.
So you simply need a second texture coordinate that isn’t altered to calculate DDX and DDY from. DDX and DDY are a measure of rate of change in X and Y. If you want smooth mips, you need a smooth rate of change in your coordinates. It’s basically always necessary to do this extra step when messing with the UVs non linearly.
My game is at a rather large scale, maybe you could scale it up a lot and move away to make sure mipmapping is taking place. I ended up using the green channel instead of opacity, but the opacity map doesn’t seem to be related to the issue and it indeed being due to mips.
There is no need to disable mips or find and alternate way to achieve the effect. Just calculate the mips using an unaltered texture coordinate like I mentioned and it should work fine.
To be more precise, the shader guesses which mip it needs by comparing two adjacent coordinates in screen space. So if you skip a bunch of pixels in your UVs, it will look like the texture is really far away to the shader when it sees the coords change fast. This will cause it to choose the lowest quality mip for that spot, which creates a seam.
So you simply need a second texture coordinate that isn’t altered to calculate DDX and DDY from. DDX and DDY are a measure of rate of change in X and Y. If you want smooth mips, you need a smooth rate of change in your coordinates. It’s basically always necessary to do this extra step when messing with the UVs non linearly.
I think I get the idea, but it’s currently far past my skill level, but I’ll see what I can figure out with some google-fu ing about setting DDY and DDX
I went back to another place I’m doing something like this - I turn off mips (they’re small textures, they don’t need mips like you say) - just set it to no mips: