Xray Material
By Neil Blevins
Created On: Dec 9th 2005
Updated On: Dec 4th 2024
Software: Blender or 3dsmax (vray) or 3dsmax (scanline)

Here's a tutorial on how to create a basic xray material.

Reference

Here's the material we are trying to emulate in CG. This photograph of a real xray comes from a friend of mine who broke her collar bone recently (thanks Sandy, get better soon!).

Reference 1

Software Agnostic Material

The basic ingredients are as follows:

Ways to make it more realistic:
Here's the geometry I'll be using for the material tests:

Example 1

Blender Example

Here's the shader for Blender...


Under Emission in the Principaled BSDF node I set the Strength to 1 and the color to slightly bluish, this causes the self illumination.

The Base Color in the Principaled BSDF node is set to a slightly bluish color (although any color is good, notice my reference was yellow colored).

The Alpha (the Opacity of the shader) is a bit more complicated. First off I used a Layer Weight node, which causes the middle of the object is see-through and the edges are opaque. I then hook this into a Color Ramp node, which lets me adjust the amount of opacity using a Gradient. It's good, but the bones seem a little bit smooth, whereas the reference had some noise to it. So lets add some noise with the Noise Texture Node. I hook up a Texture Coordinate Node which applies object 3d space so that the resulting noise is applied in 3d space (instead of say using UVs). I then modify the noise with another Color Ramp node which lets me adjust the contrast of my noise. I then take the Noise and the Facing value and multiply them together, which applies the noise to just the opaque part of the Layer Weight node. Then this resulting value I apply to the Alpha of my material.

Here's the resulting render.



Here's the blend file, Blender 4.2: xray_blender.zip

3dsmax (vray) Example

Here's the shader for 3dsmax for the vray renderer renderer.



I start with a VrayMtl. I made the Diffuse color close to white with a slight bluish tint (although any color is good, notice my reference was yellow colored). I then set the Self Illumination Color to the same as my diffuse color.

Then I placed a falloff map in the Opacity slot, set to perpendicular / parallel. I then played with its mix curve to change how much we could see through our material.

Figure 1

This gives me this result...

Example 2

It's good, but the bones seem a little bit smooth, whereas the reference had some noise to it. So lets add some noise and mix it with my falloff map. Feel free to use a more complex procedural other than the default noise.

Figure 3

Then I mix the noise and the falloff together using an RGB Multiply map. And hook that into Opacity.

Here's the resulting render.



Here's the max file, 3dsmax 2022: xray_3dsmax_vray.zip

3dsmax (scanline) Example

Here's the shader for 3dsmax for the scanline renderer.



I made the Diffuse Color close to white with a slight bluish tint (although any color is good, notice my reference was yellow colored). I then set the material to be 100% self illuminated (values between 80%-90% are good to if you still want some directionality to the lighting). Then under extended parameters I changed the Advanced Transparency Type to be additive.

Then I placed a falloff map in the Opacity slot, set to perpendicular / parallel. I then played with its mix curve to change how much we could see through our material.

Figure 1

This gives me this result...

Example 2

It's good, but the bones seem a little bit smooth, whereas the reference had some noise to it. So lets add some noise and mix it with my falloff map. Feel free to use a more complex procedural other than the default noise.

Figure 3

Then I mix the noise and the falloff together using an RGB Multiply map. And hook that into Opacity.

Here's the resulting render.

Example 5

Here's the max file, 3dsmax 2022: xray_3dsmax_scanline.zip


This site is ©2024 by Neil Blevins, All rights are reserved.
NeilBlevins.com TwitterMastodonBlueskyInstagramCaraBloggerFacebookLinkedInArtStationKickstarterGumroadYouTubeIMDB