1 / 5

Ray Tracing TP OpenGL

Ray Tracing TP OpenGL. PHAM Trong Tôn WANG Yuanhang. Scene management and display. > Scene display workflow .call Scene::draw() in viewer . Scene::draw() scans through QPtrList<Object> listObj_ .for each Object* obj in listObj_ .call obj->draw() , which is a virtual function

acacia
Download Presentation

Ray Tracing TP OpenGL

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. Ray TracingTP OpenGL PHAM Trong Tôn WANG Yuanhang

  2. Scene management and display > Scene display workflow .call Scene::draw() in viewer .Scene::draw() scans through QPtrList<Object> listObj_ .for each Object* obj in listObj_ .call obj->draw(), which is a virtual function .draw() of derived class of Object override obj->draw() > Scene loading workflow .load scene file by Scene::loadFromFile .call initFromDOMElement of respective Object .parse xml, set parameter value

  3. Ray casting >ray sphere intersection, algebraic approach .if there is intersection Call void Viewer::select(int x, int y) P = Ro + t*Rd Ro Rd .Po Pt t, the closest positive solution of quadratic function. (P- Po )∙(P- Po )-r^2=0 Store Pt, t, normal, material and calculated texture mapping in parameter hit .otherwise return background

  4. Ambient Color Light source Direct reflection q q Diffuse Color View point a Specular Color Lighting & Shadow • I = Ia ka • + Ipkdcosθ • + Ipks (cosα)n

  5. 1 (0,0) 1 (u,v) (x,y,z) Texture mapping & Anti-aliasing mapping u = 1.0 – θ/2πθ = atan2(x,y) v = 0.5 – α/πα = atan(z/sqrt(x2+y2)) * Sampling window (n=2)

More Related