Material - draw a line between two coordinates?

Thanks for the feedback.

Good point about the SinX thing not being literal since we change the period. In practice I use those formulas as identities though and end up using only the second part of the formula, since it can tell you which sides of a triangle you need to divide but you don’t always need to perform the sine operation (unless you are doing the inverse sine which is expensive). Or for example lets say you are dealing with a dot product which by definition returns the cosine of the angle. In that case, the dot product literally is just A/H so there is no ambiguity and this can help you remember that.

There may just be a bug with the standard PlotFunction node. I will take a look.

And yes it is a bit annoying to plug some functions twice. At the time I didn’t really understand how to leverage ddx or ddy so I could probably redo that without requiring the second input. Will have to experiment with it.

You guys are awesome,
@RyanB In your post #15 the technique that you used for small rock, What you think if use this technique for a top down (Strategic) shadow ? Is it good for mobile performance ?
And also where i can find a tutorial about that ?

Regards

This looks really good and comprehensible but how do you use it for multiple segments? Say you want to draw a parametric circle using this of say 20 segments. In a less complex engine you would just do a begin draw, call draw on the mesh with the applied material a number of times while changing the input arguments to the material and then end draw when you are done, but in UE4 i guess theres not really a traditional draw loop where you can render persistently like that so i guess every segment would need to be its own instance? Would you be able to describe how to approach this or even if you have a simple example that would really be gold worth!

Hi guys,

I’m chiming in on this as I was experimenting and had some fun with the UE material functions and coordinate system transforms.

For this example I wanted to use the DrawLine-2D Material Function for drawing a circle in Polar coordinates. Since a line in Cartesian coordinates represents a circle in Polar coordinates.

And lo and behold. It worked directly out of the box.

Below is the material function “CartesianToPolarCoordinate2”:


I thought it was quite intersting, so I wanted to share this.

Br,

Roger