GPU based Volume Ray Casting

GPU based Volume Ray Casting - 2008-10-09 Walkthrough with...

Info iconThis 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
Background image of page 1

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

View Full DocumentRight 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
Background 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 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)
Background image of page 3

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

View Full DocumentRight 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 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 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)
Background 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
Background image of page 5

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

View Full DocumentRight 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)
Background image of page 6
Image of page 7
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 04/29/2010 for the course CSE 4190.410 taught by Professor Shinyeonggil during the Spring '09 term at Seoul National.

Page1 / 21

GPU based Volume Ray Casting - 2008-10-09 Walkthrough with...

This preview shows document pages 1 - 7. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online