{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

GPU based Volume Ray Casting

GPU based Volume Ray Casting - Walkthrough with Direct3D 10...

Info icon This preview shows pages 1–7. Sign up to view the full content.

View Full Document Right Arrow Icon
2008-10-09 1 Walkthrough with Direct3D 10 Implementation Basic knowledge on Graphics pipeline Direct volume rendering algorithm C/C++ or C# programming language Graphics API with shader language D3D+HLSL OpenGL+GLSL
Image of page 1

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
2008-10-09 2 Windows platform C++ with Direct3D 10 & HLSL 4 D3D10-supported hardware Nvidia GeForce 8 series and later ATI Radeon HD2X00 series and later Compositing Shading Classification Sampling Ray setup Ray propagation Volume data loading
Image of page 2
2008-10-09 3 Compositing Shading Classification Sampling Ray setup Ray propagation Volume data loading Load volume data into main memory Volume Data Main memory Array Compositing Shading Classification Sampling Ray setup Ray propagation Volume data loading Load volume data into main Volume Data Main memory Array std::ifstream ifs(szFileName, std::ios_base::in | std::ios_base::binary); m_pBuffer=new BYTE[nWidth*nHeight*nDepth*sizeof(BYTE)]; ifs.read((char*)m_pBuffer, nWidth*nHeight*nDepth*sizeof(BYTE)); ifs.close(); Loading (CPU side)
Image of page 3

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
2008-10-09 4 Compositing Shading Classification Sampling Ray setup Ray propagation Volume data loading Allocate GPU memory Creating a 3D texture Copy loaded volume data into the GPU When creating the texture Mapping/Unmapping Volume Data Main memory Array Compositing Classification Ray propagation Volume data loading 3D10_TEXTURE3D_DESC desc; desc.Width=m_nWidth; desc.Height=m_nHeight; desc.Depth=m_nDepth; desc.MipLevels=1; desc.Format=DXGI_FORMAT_R8_UNORM; desc.Usage=D3D10_USAGE_IMMUTABLE; desc.BindFlags=D3D10_BIND_SHADER_RESOURCE; desc.CPUAccessFlags=0; desc.MiscFlags=0; D3D10_SUBRESOURCE_DATA initData; initData.pSysMem=m_pBuffer; initData.SysMemPitch=m_nWidth*sizeof(BYTE); initData.SysMemSlicePitch=m_nWidth*m_nHeight*sizeof(BYTE); if(FAILED(m_pD3DDevice->CreateTexture3D (&desc, &initData, &m_pVolumeTexture))) /* handle ERROR */ if(FAILED(m_pD3DDevice->CreateShaderResourceView (m_pVolumeTexture, NULL, &m_pVolumeTextureRV))) /* handle ERROR */ Loading (into GPU)
Image of page 4
2008-10-09 5 Compositing Shading Classification Sampling Ray setup Ray propagation Volume data loading Prepare for ray propagation Need start position and direction Calculate for each pixel of image plane Ray start position Ray direction Image plane Compositing Shading Classification Sampling Ray setup Ray propagation Volume data loading Prepare for ray propagation Need start position and direction Instead of calculation, texture lookup So, we generate the start position texture and the direction texture before lookup 2D Texture that store ray starting position 2D Texture that store ray direction Image plane
Image of page 5

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
2008-10-09 6 Compositing Shading Classification Sampling Ray setup Ray propagation Volume data loading Generation of the start position texture Using front face of Bounding volume Front face The start position texture cube Polygon (0,0,0) (1,1,0) (1,1,1) (0,1,0) (1,0,0) (0,0,1) (1,0,1) ( 0,1,1) Generation of the start position texture Using front face of Bounding volume position texture cube Polygon RasterizerState rsBackCull { CullMode = BACK; }; BlendState bsNoBlend {
Image of page 6
Image of page 7
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern