Gradient material on Cylinder

Hi,

I’m trying to achieve this kind of color on a cylinder mesh:

But when I apply it, in the game world it has this colored top:

Any idea how to fix this?

Regards,

Hi !

I’m a bit rusty at the moment so I’m sorry if I’m not that helpful.
Have you tried making a cylinder in a 3d software and UV unwrapped it? You could use those UVs to make a texture to mask the top face off of you cylinder, or just add two different materials for the mesh, one for the bottom (however you want the bottom face to appear) and top faces and one for the rest of the model. Make the first material just a simple red color and whatever opacity you want on that and the second material just like you have on your original material. This way you won’t get the unwanted effect on your top face. I hope this was helpful!:slight_smile:

Hi EliasPa,

Thanks for the suggestion, I’ve been thinking myself to go in that direction but I have literally zero knowledge about 3d software so I though it should be somehow possible to do in UE4 as it seems pretty simple…
I find it strange that the preview is showing one behavior and in the real world something different.

Regards,

Yea no problem. It should be something really simple i think but as i said I’m not the best at this stuff so i can’t really think of any other solution, sorry. As to why the result is different in game, i think the preview mesh has really simple UVs and they differ with the actual starter content’s cylinder mesh’s UVs. The 3D modeling solution is really quite simple if you want to that with just a little bit of studying a 3D software. But i understand if you don’t want to do that, I’m sure someone else will provide you with a little bit more information on how to do it in the engine:)

If you want an solution independent of the Mesh UV’s you could try to go for a world/object based gradient. I recently needed similar on a candle/cylinder like object to fake the subsurface scattering of candle light. I’m not saying this is the best approach and it for sure can be optimised improved. But this will give you a gradient like you want independent of Mesh uv’s. You can adjust position of gradient, feathering etc with the scalar parameters. There are more ways to approach this than the one provided in the image. Thought the node set up below does exactly what you want.

2 Likes

What is the the component between the subtract and mask on the top chain?

One minus, or press O key and left mouse click. this inverses the gradient. I actually needed mine without One minus, where the gradient would be full on at the top. But in the original question the opposite was asked. Its good to remember the one minus its a very common and extremely useful mathematical node. In my case I needed it without the one minus.

1 Like