3
$\begingroup$

I'm trying to create a realistic nebula scene with procedurally generated structures. I want to use the SDF data from generated volume in shader editor to combine with other mask and textures. I managed to get the positive and negative SDF values but only in geometry form. I need them to be an attribute (like density) so they can be used in shading.

Procedural nebuala (base structure)

enter image description hereThe positive SDF in geometry context. I need this data in attribute context as density to be used in shader to combine with masks and textures

The density value generating the original procedural nebuala structure is also useless since it can't be manipulated beyond a certain limit.

I tried creating sdf's using geometry proximity more but it outputs a value of 0-1 inside and outside the mesh which is not what I need (shown below)

enter image description hereHere black line represents the boundary and gradient going inside and outside the mesh with no way to isolate the two gradients


Edit:

If you fill Your volume with enough random points you should be able to isolate the "two gradients"

Thanks. This seem to be generating the desired results and can be imported in shader tab. However there seems to be another problem, perhaps I should have mentioned it before. The data generated needs to be used in a cube volumetric object to control haze "around" structure. The current method doesn't allow usage of this data in a cubic geometry since it is different from the source generating the SDF, a transfer attribute or "sample at index" also won't work here. Essentially the destination for this data is a volume box, with various textures controlling haze including this positive distance data to control haze around the object. (Examples attached below)

enter image description here enter image description here A research paper describing the method under practice

enter image description here The desired result. Using the sdf data (indicated by blue attribute node) in combination with a height mask and a voronoi pattern in a box shaped object

As you can see I'm trying to import the positive distance from the mesh into the shader of a cube to be used with other textures and patterns to make a final "haze effect" around the object.

enter image description here enter image description here

$\endgroup$
0

1 Answer 1

1
$\begingroup$

Using Raycast May be working for you?

enter image description here

Edit:

If the result you expect is something like this:

enter image description here

PS : Attributes don't work with volume shader...

$\endgroup$
1
  • $\begingroup$ Amazing thank you $\endgroup$
    – 3pointedit
    Commented Dec 29, 2023 at 2:17

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .