I rebuilt my Blueprint and did it exactly like in the video. Could you show me how you made the material?
I think so, but I’ll think about how to do it. This part is probably not so trivial.
Yes, I’m trying that too, but no success so far.
It’s possible to smooth it out by scaling the object, but it becomes much heavier in the world.
Well, I found a solution. The only downside is that the smoothing is done per section, not per length, so the gradient is non-linear across the entire length. If the last section is very short, the gradient will change quickly, like in the image below:
So the first section smoothly transitions from “1” (red) to “0.5”, and the second from “0.5” to “0”. Although ideally you might want something like “1” to “0.2” and “0.2” to “0” to make the transition more linear. Let me know if the “per section” solution meets your needs.
Could you show me how you did it so I can test it here?
The first step is to use a UV for the pipe, which allows you to easily separate 3 elements: the sides of the pipe, the top and bottom faces. None of them should overlap. I created a simple pipe model inside the Blender with the following UV map:
This is an example of a valid UV map. You can easily choose any of the 3 elements I’ve mentioned in the material.
This is an example of a UV map that will not be valid due to overlap. The top and bottom faces cannot be selected separately (in fact, for this UV map, nothing can be chosen individually at all).
So first of all, make sure you’re using a static mesh with the “correct” UVs for the solution I will show.
Perfect, i thing all that works, thank you guys
One more question
How would I add a parameter that I can control in my Level Sequence, to affect the opacity and make this tube gradually reveal itself?
Just put a parameter here
This sets the distance to the fade. Then make a material instance, and you can control that parameter from blueprint or sequencer
I thought the OP wanted a solution that fades linearly across the entire pipe shape, regardless of its shape. Your solution works fine for nearly straight pipes, but it won’t work if the pipes start to loop back to the origin of the object, like this:
It’s great if the solution is only required for simple pipe shapes, because the simplest solution is definitely better. My solution is not that simple, but it works for any shape. If your solution works for the OP, I’m not sure if it makes sense to publish my complex one.
“I really hadn’t tested it, but this way it wouldn’t work for me. Now I’m facing another problem — my BP isn’t rendering correctly; it’s rendering with only one color.”
Correct, but the OP outlined a plan above, and the pipe at most do a right angle, so this is enough
Admittedly, it’s not a general solution at all. I still think it must be possible to just change color simply based on distance along spline.
What do you mean? Do you mean my solution at the beginning or ClockworkOcean’s solution? What stopped working? Did you try what I said with UV in post 28 and it broke everything?
Sorry, I’ve already managed to solve it. What was happening is that, since my parameter setup was in the Construction Script, Unreal wasn’t reading it correctly during rendering. What I had to do was create some variables in the Construction Script, which were then called in the Begin Play. That way, I was able to create what I was aiming for. I’ll soon share a video or some images showing what I did.
Yeah, you kind of need to repeat some of the logic in BeginPlay.
Did you actually manage to get a full result showing a linear gradient across the spline without those divisions in my solution? If so, that’s awesome! I would be interested to see your solution and compare it with mine.
It’s still not 100% perfect, because it seems like the timeline has a speed limiter, but that’s okay — it looks good to me.
Hmm… I’m a little confused. The logic doesn’t seem to match what’s shown in the video, because I don’t understand why they appear one by one and not all at once. Are you using very short tubes? If so, how short are they? I think you see the tubes appearing gradually because the game is lagging a lot, creating a filling effect. Is this true? Can you tell me what your FPS is in the game during this filling?