lynch
Uploaded by
17 SLIDES
313 VUES
170LIKES

Simple Ray Tracing Framework

DESCRIPTION

This comprehensive guide covers the development of a simple ray tracing framework using C# and WinForms for interactive image previews. The framework includes features such as environment lighting, geometry definitions (spheres, polygons), and a customizable camera system described via an XML file. Learn to implement major components like scene resources, textures, and materials while utilizing advanced functionalities like multi-threading support. This resource is designed for those aiming to grasp essential concepts in real-time ray tracing while building a visually appealing GUI for 3D scene representation.

1 / 17

Download Presentation
Télécharger la présentation

Simple Ray Tracing Framework

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. Simple Ray Tracing Framework Interactive Control Interactive Preview Depth or Mask Image Ray Trace Image

  2. Technologies • C# • Just another programming language • WinForm: • GUI Application Development • not covered in this class • Interactive Viewing: • XNA (can be OGL or D3D) • To be covered in second half

  3. The Scene • Describe by XML (text) file! • Four major components • Image Spec (Film in a camera) • The Camera • Environment (Lighting condition) • The Objects • Geometry: spheres and polygons • Material properties

  4. XML Scene Description • Similar to Maya’s .ma file • Extremely simpler version!! • Example Command File Camera: eye Camera: lookat

  5. Source Code Structure • Two Projects: • 3DPreviewer: Shell container • RayTracer: Our source code • Parser (translate XML into data structure) • RTCore: Shading, Image representation: • DoNotChange: RT thrade support (later) • NeedToUse: Shading, Utilities • RTSupport • Geometry • RaySupport: • Ray and IntersectionRecord • SceneResourceSupport • Texture, Light, Materials • 2 libraries: • GUI, Graphics, 2 MVC Support

  6. Representation SceneDatabase ImageSpec Geometry RTCamera IntersectionRecord Ray • Link to StarterProject

  7. RTWindow.cs: App Container • App Window Shell • In WindowsForm

  8. Parser.cs: XML Parser • Translates Command File into data structures • In RayTracer: Parser/CommandFileParser.cs

  9. RTCore: Folder • DoNotChange Folder: • No need to even examine the source • Thread support (to cover later in the quarter) • NeedToUse Folder • Need to understand the code • No need to change • Three files: Compute, ImageFrameSupport, and Init • Essential to understand • Necessary for 3D Viewing and Camera implementation

  10. Geometry and RaySupport • Geometry • geometries in the scene • For now only: Rectangles and Spheres • No need to worry until much later • Ray • Ray: Origin + Direction • Ray constructor: TAKES 2 positions!! • IntersectionRecord

  11. Transformation • The <xform> tag • The implementaiton in • RTGeometry_ParseXForm.cs • Rectangle::Parsing at the end:

  12. Geometry and RaySupport Ray Sphere Rectangle IntersectionRecord

  13. RTCamera: mEye mAt

  14. ImageSpec: Resolution Must Compute Each Pixel Location!!

  15. SceneDataBase • Contains all the scene resources • Geometries, Textures, Materials, Lights • Simple index tables for each resource

  16. Calling Sequence • RTWindow::BeginRT() /* from BeginRT Button • Create and Init: image, mask, depth buffers • RTCore::BeginRTThread • In RTCore/DoNotChange/RTCore_Thread.cs • one/more separate thread(s) call to • RTCore::ComputeImage • In RTCore/RTCore_Compute.cs • Loop through all pixels, for each pixel • Compute visibility, coverage, depth

  17. Important Functions • RTCore::ComputeVisibility() • In RTCore/RTCore_Visibility.cs • Use -1 for exceptGeomIndex for now • RTCore::ComputeShading() • In RTCore/RTCore_Shade.cs • Use 0 for generation for now

More Related
SlideServe
Audio
Live Player
Audio Wave
Play slide audio to activate visualizer