fury-gl / fury

FURY - Free Unified Rendering in pYthon.
https://fury.gl
Other
245 stars 182 forks source link

Support superquadrics in sdf actor #320

Open Garyfallidis opened 4 years ago

Garyfallidis commented 4 years ago

SDF stands for signed distance functions. Currently, our sdf actor manages sphere, torus, and ellipsoid.

We would like to add the support of the superquadrics. Check fury.actor.sdf for more info.

haran2001 commented 3 years ago

Hi @Garyfallidis, I would like to work on this issue.

haran2001 commented 3 years ago

Hi @Garyfallidis , I'm trying to add an sdf for superellipsoids (SE) under sdf_dec.frag So far I've added an appropriate sdf for locating points, but only patches of the actor are being rendered on screen. I suspect that some points inside the SE are producing a positive value by the sdf so it appears like the surrounding itself.

The sdf I'm using assumes the origin as center, but it's possible that fury applies a transformation to the co-ordinate system at some point and changes that, because of which the sdf produces wrong values, however I am not sure about this.

haran2001 commented 3 years ago

I am expecting the following result shadertoy

haran2001 commented 3 years ago

But it's rendering this viz_sdfactor

haran2001 commented 3 years ago

Any help or guidance regarding this issue will be much appreciated :)

P.S : This SE is the result of taking, epsilon1 = epsilon2 = 0.1 (square form of SE)