1 / 29

Térfogatvizualizáció

Térfogatvizualizáció. Szirmay-Kalos László. Térfogati modellek. hőmérséklet sűrűség légnyomás potenciál anyagfeszültség. v(x,y,z). v(x,y,z). tárolás: 3D tömb. Térfogati modell megjelenítése. Megjelenítés átlátszó anyagként (belsejébe belelátunk)

meriel
Télécharger la présentation

Térfogatvizualizáció

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Térfogatvizualizáció Szirmay-Kalos László

  2. Térfogati modellek hőmérséklet sűrűség légnyomás potenciál anyagfeszültség ... v(x,y,z) v(x,y,z) tárolás: 3D tömb

  3. Térfogati modell megjelenítése • Megjelenítés átlátszó anyagként (belsejébe belelátunk) • Adott szintfelület kiemelése (külsôt lehámozzuk)

  4. Átlátszó anyagok L(s + ds) L(s) dL(s)/ds = - kt · L(s) + ka · Le + f(‘,) Li(‘)d‘ L(s + s) L(s) L(s + s) = L(s) - kt s · L(s) + Li(s) s (s) C(s)

  5. Fényemittáló, fényelnyelő anyag

  6. Számítás fénysugárkövetéssel L(s + s) = (1- (s)) · L(s) + C(s) L(s) s=0 L = 0 for(s = 0; s < T; s += s) { L = (1- (s)) · L + C(s) }

  7. Számítás láthatóság sugárkövetéssel L*(s) (s) L*(s-s)=L*(s)+(1- (s)) · C(s) (s-s)=((s)) · ((s)) L* =  0 for( s = T; s >0 ; s -= s ) { L* += (1- ) · C(s) (1- ) · ((s)) if (break }

  8. Térfogat vetítés L(s) L(s + s) = (1- (s)) · L(s) + C(s) OpenGL blending

  9. Voxel szín és opacitás: Transfer functions: (C,)=T(v függv) • Röntgen: (C,)=T(v(x,y,z)) • opacitás = v(x,y,z) • C(0) = 1, egyébként 0 • Klasszikus árnyalási modellek • opacitás: v osztályozása • C = árnyalási modell (diffúz + Phong) • normál = grad v • opacitás *= | grad v | • Magasabb rendű derivált (görbület) • Transzlucens anyagok (subsurface scattering)

  10. (C,) = T(v(x,y,z))

  11. Maximum intenzitás vetítés

  12. Phong

  13. Illusztratív vizualizáció

  14. Illusztratív vizualizáció

  15. Transzlucens megjelenítés Felező vektor

  16. Transzlucens megjelenítés

  17. Szintvonal

  18. Szintfelület

  19. Marching cubes v(x,y,z) > szint v(x,y,z) < szint

  20. Masírozó kockák Szintérték = 110 Szintérték = 60

  21. Isosurface ray casting normal = grad v v(x,y,z) > isovalue

  22. GPU ray-casting right up lookat eye p q entry p = lookat + right + up , are in [-1,1] exit Unit cube with 3D texture

  23. Isosurface ray-casting Full screen quad For each pixel Find pixel center p raydir = normalize(p – eye); Find exit and entry for(t = entry; t < exit; t+=dt) { q = eye + raydir * t; if (volume[q] > isovalue) break; } normal vector estimation; illumination } Interpolation from the corners Clipping central differences

  24. GPU Isosurface ray-casting volume eye, isolevel, material/light properties Ray casting Pixel shader CPU program Vertex shader Rasterization Interpolation Vertices of the window quad ray/window hpos=fullscreen textcoords Volume

  25. CPU program - OpenGL display void Display( ) { // PASS: non uniform parameters glBegin( GL_QUADS ); Vector p = lookat - Right + Up; glTexCoord3f(p.x, p.y. p.z); glVertex3f(-1, 1, 0); p = lookat - Right - Up; glTexCoord3f(p.x, p.y. p.z); glVertex3f(-1, -1, 0); p = lookat + Right - Up; glTexCoord3f(p.x, p.y. p.z); glVertex3f(1, -1, 0); p = lookat + Right + Up; glTexCoord3f(p.x, p.y. p.z); glVertex3f(1, 1, 0); glEnd(); }

  26. Ray casting: vertexshader voidVertexShader( in float4 hPosIn : POSITION, in float3 wPosIn : TEXCOORD0, out float4 hPosOut : POSITION, out float3 wPosOut : TEXCOORD0 ) { hPosOut =hPosIn; wPosOut = wPosIn; }

  27. Ray casting: fragment shader void FragmentShader( in float3 p : TEXCOORD0, uniform float3 eye, uniform sampler3D volume, uniform float isolevel, uniform float3 lightdir, lightint, kd  out float3color : COLOR ) { float3 raydir = normalize(p – eye); float2 inUnitCube = Intersect(eye, raydir); float entry = inUnitCube.x, exit = inUnitCube.y; float dt = (exit – entry) / STEPS; bool found = false; float3 q; for(t= entry; t < exit; t += dt) { if ( !found ) { q = eye + raydir * t; if (tex3D(volume, q).r > isolevel) found = true; } }

  28. Ray castingfragment shader cont’d color = float3(0, 0, 0); // background color if ( found ) { float3 normal; normal.x = tex3d(volume, q + float3(1/RES,0,0)) – tex3d(volume, q - float3(1/RES,0,0)); normal.y = tex3d(volume, q + float3(0,1/RES,0)) – tex3d(volume, q - float3(0,1/RES,0)); normal.z = tex3d(volume, q + float3(0,0,1/RES)) – tex3d(volume, q - float3(0,0,1/RES)); normal = normalize( normal ); color = lightint * kd * saturate(dot(lightdir, normal)); } }

  29. Video

More Related