Show part of a texture

So I’ve been trying to figure out a way to do this without having to create a bajillion new textures and materials. Basically, I’m trying to pan across a material with the panner, but only across a certain part of the texture.

42923-texturecoordinate.png

The problem I’m having is this. Using the UV coordinates (and a texture coordinate node), I can sort of manipulate which part of the material is showing. The problem is, it always has the same “starting” point. Like, I can show the coordinates from 0 to 0.5 but I can’t get it to show 0.5 to 1.

Put another way, I can pan across 1 and 2 by setting the UTiling and VTiling to 0.5, but I can’t figure out a way to pan across 3 and 4. Much less diagonally.

Essentially, using the UV coordinates, I can shift up and left, but not down and right. I have yet to figure out a way to show panel 4 by itself. Using a number greater than 1 just starts repeating the texture (which makes sense).

This might just be a limit of how textures work in Unreal. It doesn’t look like I can define a ‘start’ and ‘end’ coordinate, just the ‘end’ coordinate and the start is stuck at 0. If I have to, I guess I’ll cut up all of my textures but that is an incredible undertaking of time I’m not ready to commit to unless I have no choice.

Just some background info, the reason is because I want some texture “zoomed in” on the background wall showing only a section of the material the player is choosing. The player can see a smaller version of a the whole material in front of the screen. I only have 4 panels for the example for simplicity’s sake, but I’d like to be able to pan across any part of the material.

For that matter, is there any way to map something like InputAxis (from like WASD) to the coordinates of a texture? So if the player presses “up” it scrolls up, “right” it scrolls right, etc.

42924-texturecoordinate2.png

Say I start at panel 5, would it be possible to pan across the texture towards any of the other panels based on user input (joystick, mouse, whatever)

1 Like

You need to just change the way you are adjusting your textures in your material. You can adjust WHERE a texture is in UV space by adding to your UVs, and adjust the textures tiling by multiplying UVs.

This image will help you get started, at that point, just mess with values to understand how it works! This is extremely useful, so get used to using it. :slight_smile:

Thanks

2 Likes

Also, you’ll want to be sure to set your texture to clamp, if you don’t want it going past 1. Just be aware that once you do get past one, it’ll just repeat its edge pixel.

Ooooohhhhhhh. I get it now. Thanks a bunch! This is exactly what I needed. I hadn’t thought to split my image into tiles first by multiplying. Now I just need to map this correctly to user input, but this give me what I need to move around.

Tuxedost, thanks for the answer. On a related note, I want to loop only a few frames from a sprite sheet. Here is an example of my sprite sheet with checkered, numbered frames for reference. Say for example I want to loop frames 5, 6 and 7 (not 8)… I get that “shift V” would move me down to the second row, but how would I loop 5, 6 and 7 without displaying 8?

To help you understand what I am doing, lets say 1-4 is running, 5-7 is jumping, 8-11 is melee, etc…

alt text

How to do the same, but with texture Pixels? not 0.0 - 1.0 floats?

hello chineseducks. i know this is a bit dead but have you found a solution? i would appreciate any help. thanks :slight_smile:

I ended up just splitting them up into several sprite sheets instead of doing one master sheet of every animation. Just set the texture options to “Never Stream” in unreal and its working fine.

I know its sort of a necro thread but I cannot find how to make the Tile U tile V params on the left, how do you create those? have the names been changed to make it harder?

Hi there. There are two ways. You can either hold S(I believe, muscle memory and all that…) and click, which creates a Scalar parameter. You can also just hold 1 and click, which will make a single scalar value, and then right click it and convert to parameter.

Some info for you: