5
$\begingroup$

Hey for an upcoming project I need to simulate ultrasound test effect in Blender. Does anyone have any good ideas on how to get into creating this effect? I was trying some stuff but it all looks bad.

Image for reference: enter image description here

New contributor
Shron Rikvon is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.
$\endgroup$
3
  • 1
    $\begingroup$ Haha, I spent ages implementing this at a company in the past. Unfortunately it'll all be under NDA $\endgroup$
    – sdfgeoff
    yesterday
  • $\begingroup$ Video clip for those interested: youtube.com/watch?v=5HJZc2qXzEo This was done in the Blender Game Engine (hah, remember that!) with lots of magic being done by shader wizard Martinsh $\endgroup$
    – sdfgeoff
    yesterday
  • 1
    $\begingroup$ One thing I will say is that ultrasound is very similar to light. The ultrasonic transducer "emits" ultrasound, pockets of air absorb/reflect the ultrasound and cast shadows, areas of hard material (eg bone) transmit and lens the ultrasound. So any implementation of an ultrasound "material" risks implementing a full 2d-renderer inside a shader $\endgroup$
    – sdfgeoff
    yesterday
10
$\begingroup$

From my limited knowledge ultrasound based imaging basically creates a "section" of the subject at a defined depth, controlled by the power output set by the operator.

You can achieve a similar effect by using a shader that adjusts transparency based on some depth parameter. Results wont be the best, but it will be quick and dirty approximation. Some post processing or additional "roughing" may be required to produce a grainier output similar to a real ultrasound.

enter image description here

For this to work properly it will require a relatively detailed model with many "depth layers", that is a dense, almost volumetric, representation of several layers of tissue surfaces found inside an organism, like organs, muscles, bone, blood vessels, among others; that properly illustrates the shader effect. The quality of the result will partially depend on the density of the model.

In the illustrated example several discrete objects are used so there's a need to convert Object texture coordinates into World space, with a Texture Transform Node so all objects share the same continuous texture coordinate space mapping, regardless or scale or position in the scene. If you use a single object this step is unnecessary.

After that feed your coordinates into a linear Gradient texture and run it through a black and white Color Ramp node, feeding it to the Transparency socket of your shader.

enter image description here

You can feed another black and white Color Ramp with reversed colors (in relation to the transparency one) run through the same Gradient texture to the emission and diffuse color of the same shader.

Adjust the depth of the ultrasound by modifying the texture coordinates fed to the Gradient texture. If using EEVEE, make sure to change the Blending Mode under the material transparency options to either Alpha Blend or Alpha Hashed.

enter image description here

$\endgroup$
2
  • 4
    $\begingroup$ I'm loving this approach, it produces such aesthetic results! I'm struggling to make mine more economical. I know in my bones I can chuck half my nodes away before posting :) $\endgroup$ 2 days ago
  • $\begingroup$ Thanks, I also experimented with a radial gradient which looked great, despite not being a "realistic" approach $\endgroup$ 2 days ago
1
$\begingroup$

The first part of this one is a shameless rip-off from LateAsUsual 's way of making noise anisotropic, following the contours of a gradient.

A 'Scanning Plane' is prepared with this Geometry Nodes group, to encode the proximity of collection of target objects in a vertex-color channel..

enter image description here

... similarly to this answer, which generates ripples. Below, we can see the scanning-plane passing through the target objects, and the resulting vertex-color. On the right, the final result of the shader.

enter image description here

The shader combines a manipulation of this encoding of proximity, with an arc-of-circle scan region.

enter image description here

(Above)

  • The cluster labelled Distance Gradient genertates the mask on the left
  • The cluster labelled Contour Noise generates the image in the middle..
  • They are multiplied to give the image on the right

(Below)

  • Arc Polar coordinates sets up the coordinates for another Noise texture, and a mask to cut a sector out of the plane. Those are multiplied to make a mask for the contoured image:

enter image description here

As you can see... too many nodes.. (I'm sure the node:quality ratio could be improved :D )

enter image description here

The scan-noise can be driven by #frame, to jitter it:

enter image description here

(Blender 3.0b)

$\endgroup$

Your Answer

Shron Rikvon is a new contributor. Be nice, and check out our Code of Conduct.

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.