MA5615: The starting project is a simple OpenGL application, window creation, and user interaction are implemented with GLUT: GPU Programming with CUDA Assignment, TCD, Ireland
University | Trinity College Dublin (TCD) |
Subject | MA5615: GPU Programming with CUDA |
The starting project is a simple OpenGL application, window creation, and user interaction are implemented with GLUT. It loads and renders 3D volumetric data with different techniques. The techniques and their parameters may be changed interactively by pressing the corresponding keys. The virtual camera can be moved interactively using the mouse and keyboard: hold down any of the mouse buttons to rotate with the mouse and use the W, A, S, D, E, Q keys for moving. The rendering mode may be selected with the 1,2,3 key. Note that the application requires the freeglut.dll to run, make sure it is located next to the executable or in any of the directories included in the path.
The main function is located in the MonteCarloSim.CPP file, the rest of the C++ source files contain helper classes and functions, such as a 3D camera, simple vector and matrix classes, or saving data to an image file.
For the assignment, you need to modify only the MonteCarloSim.CPP and the kernel files, and programs. cl and visualization. cl.
The structure of the OpenGL application in MonteCarloSim.CPP is the following, note that most of the functions do not need to be modified for the assignment:
● The main function initializes GLUT creates the OpenGL window, connects the different rendering, user interaction, etc. callbacks, calls the init function
to create and initialize OpenCL related objects, and then enters the GLUT main loop. The main loop of GLUT is effectively an infinite loop that periodically calls the display and idle callback, and the interaction callbacks if there was any user input.
● The reshape function runs when the window is resized.
● The mouseClick and mouseMove functions are the callbacks for interaction with the mouse.
● The keyUp and keyDown functions are the callbacks for keyboard input. The
rendering mode and the algorithm parameters are modified in the keyDown function, have a look to see the key mapping for parameter changes, also feel free to modify this function if you need extra parameters, change the key mapping or the rate at which certain parameters change. Note that some keys set the iteration variable to zero which resets the scattering simulation.
● The animate function is called from time to time by GLUT and implements animation-related logic.
● The display function is responsible for rendering, it is called GLUT when a
redraw event is required and by the animate function periodically which makes sure that the view refreshes several dozen times a second. The display function calls the various rendering techniques, according to the current rendering mode.
The first mode is the isosurface direct volume rendering and the second is the alpha-blended direct volume rendering, both render the volumetric data that is loaded from the head.vox binary data file. The third rendering mode is a Monte Carlo scattering simulation, the scene is a composition of simple 3D geometries and is defined procedurally in the programs.cl kernel (see intensity).
The Monte Carlo simulation is distributed between rendered frames: new Monte Carlo samples are generated in each frame and their contribution is added to the current result thus you should see that the rendering result slowly converges towards the true solution and thus the noise of the theM simulation is decreasing gradually and continuously as more and more samples are added.
Get Solution of this Assessment. Hire Experts to solve this assignment for you Before Deadline.
If you are worried about MA5615: GPU Programming with CUDA assignment then take buy assignment online service at Ireland Assignments. Our Dublin assignment experts have gained years of expertise in flawless assignment answers on many subjects. Besides this, We have many skill demonstration assignment examples, Childcare assignment samples, SNA level 6 assignment samples, and learner record samples, on our official Irish website.