title: 3D texture sampling in OpenGL
body: <p>I am currently trying to learn ray casting on a 3D texture using something like <code>glTexImage3D</code>. I was following <a href="https://learnopengl.com/#!Advanced-Lighting/Deferred-Shading" rel="nofollow noreferrer">this tutorial</a> from the start. My ultimate goal is to produce a program which can work like this:</p>
  
  <p><a href="https://i.stack.imgur.com/SS2ZR.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/SS2ZR.jpg" alt="This one"></a></p>
  
  <p>My understanding is that this was rendered using a raycasting method and the model is imported as a 3d texture. The raycasting and texture sampling tasks were performed in the fragment shader. I hope I can replicate this program as a practice. Could you kindly answer my questions?</p>
  
  <ol>
  <li>What file format should be used to import the 3D texture?</li>
  <li>Which glsl functions should I use in detecting the distance between my ray and the texture?</li>
  <li>What are the differences of 3D texture sampling and volume rendering?</li>
  <li>Are there any available online tutorials for me to follow?</li>
  <li>How can I produce my own 3D texture? (Is it possible to make one using blender?)</li>
  </ol>