1 / 35

Advanced Computer Graphics Global Illumination - OptiX

Advanced Computer Graphics Global Illumination - OptiX. Ming-Te Chi Department of Computer Science,  National Chengchi University. Outline. CUDA OptiX. CPU vs GPU. Kernels and Thread. NVCC . cu: c language with extension

carl
Download Presentation

Advanced Computer Graphics Global Illumination - OptiX

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. Advanced Computer Graphics Global Illumination - OptiX • Ming-Te Chi • Department of Computer Science,  • National Chengchi University

  2. Outline • CUDA • OptiX

  3. CPU vs GPU

  4. Kernels and Thread

  5. NVCC • cu: c language with extension • PTX: binary in CUDA instruction set architecture. (virtual assemble language) • nvcc: nVidiaCuda Compiler: • Compile cu into PTX

  6. CPU to GPU

  7. OptiX

  8. Document • OptiX • a scalable framework for ray-tracing based application. • OptiX Programming Guide • Host-based API • CUDA c-based system that produce ray, intersection, … • OptiXQuickstart Guide • how to implement several basic ray tracing effects, from trivially simple to moderately complex.

  9. Object model • Context • Program • Variable • Buffer • Texture sampler • Geometry Instance • Geometry • Material • Group • Geometry Group • Transform • Selector • Acceleration

  10. Host - Context

  11. Host – entry points

  12. Programs - Ray Type

  13. Radiance

  14. Shadow ray

  15. Geometry Instance • Geometry Instance • Geometry • IntersectionProgram • BoundingBoxProgram • Material • ClosestHitProgram • AnyHitProgram

  16. Programs • Ray Generation • camera • Closest Hit • shading • Any Hit • Shadow ray • Miss • Background/enviroment • Exception • Bad pixel / Print error • Intersection • ray-primitive • Bounding Box • Ray-bounding box • Visit

  17. Programs – Ray Generation(1)

  18. Programs – Ray Generation(2)

  19. Programs – bounding box

  20. Programs – Intersection

  21. Programs – Closest Hit

  22. Programs – Miss

  23. Supported OptiX call

  24. sample • Sample 1~8 • Whitted, Cook,glass, Tutorial

  25. Host - SampleScene.h class SampleScene { // Create the optix scene and return initial viewing parameters virtual void initScene( InitialCameraData& camera_data )=0; // Update camera shader with new viewing params and then trace virtual void trace( constRayGenCameraData& camera_data )=0; // Return the output buffer to be displayed virtual optix::Buffer getOutputBuffer()=0; // Optional virtual interface virtual void cleanUp(); virtual void resize(unsigned int width, unsigned int height); virtual boolkeyPressed(unsigned char key, int x, int y) }

  26. void Tutorial::trace( constRayGenCameraData& camera_data ) { m_context["eye"]->setFloat( camera_data.eye ); m_context["U"]->setFloat( camera_data.U ); m_context["V"]->setFloat( camera_data.V ); m_context["W"]->setFloat( camera_data.W ); Buffer buffer = m_context["output_buffer"]->getBuffer(); RTsizebuffer_width, buffer_height; buffer->getSize( buffer_width, buffer_height ); m_context->launch( 0, static_cast<unsigned int>(buffer_width), static_cast<unsigned int>(buffer_height) ); }

  27. Tutorial 0 – Normal shader Intersection() rtTrace()

  28. Tutorial 1 – Diffuse shader

  29. Light ffnormal Ray.origin L hit_point

  30. Tutorial 2 – Phong Highlight • Half vector Light ffnormal Ray.origin L hit_point

  31. Tutorial 3 - Shadows

  32. Light ffnormal Ray.origin L hit_point

More Related