heyx3 / Bplus.jl

A modern OpenGL 4.6 rendering framework, written in Julia.
Other
70 stars 3 forks source link

More customizability for PerlinField #14

Open heyx3 opened 1 year ago

heyx3 commented 1 year ago

In the Bplus.Math.perlin() function, you can customize coordinate transformations (e.x. to make the noise wrap around), or supply a custom curve for the interpolants (defaults to smootherstep()).

In the Fields.PerlinField struct, this customization is missing. It would need to be supported from within the DSL, so the best route is to let the user specify the coordinate transform as an AbstractField{NIn, NIn, F}. And specify the interpolation curve as an AbstractField{1, 1, F}.

An analytical gradient for PerlinField (see #15 ) gets more difficult to work out after adding this feature, but should still be achievable since each of these sub-fields can already tell you their own derivative. If an analytical gradient is added to PerlinField before this issue is done, then this one should be re-labeled to SIZE:medium and remove the good first issue as well.