So i have an equation to displace the y vertex, but the shader seems to ignore the VERTEX.y in the sin and just makes a normal sine wave. Can I not reference the same vertex more than once in an equation? Is there any workaround to this?
Boulevard If this is applied to a flat horizontal plane then the input value of VERTEX.y is always the same. You probably meant to use VERTEX.z there.
I'm trying to make this graph in the shader so VERTEX.z wouldn't work here. How could i make this shape in the shader ? or is it just not possible?
and yes its applied to a flat horizontal plane
Boulevard You can't use an implicit form of equation like this in a shader. You'll need to turn it into an explicit form where y is expressed in terms of x, in other words you need to solve for y. Unfortunately, the equation of type y=sin(x+y) belongs into category of transcendental equations and cannot be solved algebraically. You could probably solve it numerically if your math skills are up to a par. Maybe Mathematica or Wolfram Alpha can help you.
But why bother when you could patch one period of a similarly shaped curve from a couple of smoothstepped segments in the shader. Or simpler yet, take a regular sine and linearly skew it.
This is a great help thanks!
© 2022 - 2024 — McMap. All rights reserved.