0
\$\begingroup\$

My problem seems so simple, that before asking the question here I did a search on google and this site:

But nothing seemed to be related to my problem.

I imported this image.png:

enter image description here

I created a material and added the image to it:

enter image description here

But I did not get the expected result in the game (I wish this yellow line were under that pink arrow that I drew):

enter image description here

Innocently I thought the solution was obvious, so I added another image.png and added it to the material:

enter image description here

To my surprise, the result was worse, the yellow line did not even appear:

enter image description here

I realized this happens because the floor of my game is a "stretched" cube, so the image I added is appearing correctly on one of its faces, not just the one I want.

I'd like to know how to make it look the same on all faces, or some value that I can change so that it appears correctly on the face I want.


EDIT 1 (attempt using rotator)

I put the input time to see if any value would be compatible with what I want, but none is.

I tried with both texture images, but both presented the same behavior:

enter image description here

See that spinning looks like the shaft rotates around the top left of the floor.

For some moments the yellow line will disappear.

\$\endgroup\$
  • 1
    \$\begingroup\$ Did you consider just rotating your cube? \$\endgroup\$ – DMGregory Jul 9 at 0:44
  • \$\begingroup\$ @DMGregory Yes, but I happen to have 2 Render Targets attached to the floor, it got bugged (the sprites). \$\endgroup\$ – Boneco Sinforoso Jul 9 at 13:15
1
\$\begingroup\$

You might want to play around with texture coordinate (UVs) scaling and flipping.

Right now, the face pointing upwards is just showing a part of the unfolded cube texture. If you adjust the scale you should be able to show the image on every face of the cube.

TextureCoordinate Expressions shows that UTiling and VTiling can be used for scaling the texture. Use Un Mirror U and/or Un Mirror V for flipping the texture.

Maybe you will need some texture offset as well, which can be achieved with the Panner Expression. Note, the order when combining both expressions makes a difference.

\$\endgroup\$
  • \$\begingroup\$ Using the rotator I could for a moment visualize the texture of the correct mode, but I can not catch it at the point (set the rotation). \$\endgroup\$ – Boneco Sinforoso Jul 9 at 13:27
  • \$\begingroup\$ I connected a Scalar Parameter to the time and I was able to set a value, but the same thing happened as when I added an inverted image. \$\endgroup\$ – Boneco Sinforoso Jul 9 at 13:37
0
\$\begingroup\$

your coordinates are incorrect, the texture might be to big or too small, to verify that make a checker pattern texture apply it as an overlay to the original texture.

In game re import the image and apply it to the mesh again, after that create a texture coordinates in the material and two number input parameter (x, y), multiply the two, than connect the result into the texture sample input parameter.

This way once compiled the material you can create an instance and modify only the x and y parameters till the tiling is good

UPDATE

Checker textures are any type of texture that allows you to verify your tiling/uv scales, the most standards comes in two flavors, gradient pattern with indexes or black and white.

Gradient texture Black and white

When applied to your mesh you can use them to see how big or small the boxes are or how many cells appears. After that you can use your UV tiling property in the Material to adjust till the image is displayed properly or within the wanted range.

enter image description here

If now the values are matching your preferences, you can keep the UV tiling values but replace back the texture with the original one you wanted to display and if all is ok the image should display properly.

You can still fix the parameters afterwards, now you just have a baseline to start from

P.S.

Uneal Engine also has the Z axes usually rotated by 90 degrees when importing meshes from Maya(not sure other packages like blender), if still not the right direction, rotate the mesh by -90 in the z axes and should help

\$\endgroup\$
  • \$\begingroup\$ I'm not good with textures. So I didn't understand exactly what you suggested to do. I tried to use the CheckerPattern, but the texture is gone. \$\endgroup\$ – Boneco Sinforoso Sep 18 at 22:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.