CSCI 441 - Computer Graphics

Fall 2019 - Assignment 6 - The Fireworks Show



Canvas | CS @ Mines | Mines | Piazza
|   Home |  Syllabus |  Assignments |  Leaderboard |  Schedule |  Resources   |
Blue Teapot2015: Asgard Green Teapot2016: Mount Olympus Red Teapot2017: Aaru Park Grey Teapot2018: Findias Speedway White Teapot2019: Hanan Pacha
E-chaski Yachachiq runa chay tariy Machu Picchu
This assignment is due by Friday, November 22, 2019 by 11:59pm.

The Park is nearing completion. Construction has finished on your ride and the main exhibit has just gone up. Planning has moved on to more entertainment features for the guests to enjoy. You have been doing a good job pleasing Sapa Inka - first the awarding of the Golden Ticket to Hanan Pacha and now the main focal point of the park. It can be seen from miles away like a beacon bringing people in.

Once again, you've been summoned to complete another task in getting the Park ready to reopen.


Part I - Welcome to the Grand Illusion


Every evening we will entertain our guests with a laser and fireworks show. We need you to create the timing and choreography for it. This show will appear at the main attraction every evening and the show must go on. Here, take this book on pyrotechnics and get started right away. We plan to open the park in a few days so there's not much time.
You open the book and see written on the first page:
For this assignment, you will write an OpenGL 3.3/GLFW application that simulates several uses of Particle Systems. You can use your Lab 10 submission as the starting point. To facilitate this task, you will need to create a Particle class that contains all the necessary information an individual Particle would need to keep track of (position, velocity, etc.). You will also need to create a ParticleSystem class that contains a list of Particles. We can then apply a set of rules to a ParticleSystem and every Particle in that System will follow those rules. One these rules must be gravity. Gravity should be a force that is acting on all Particles in the System.

There will be two different Particle System implementations that you can choose from to implement one. Or

Multicast: you could choose to implement both

The particle system must be placed into a Skybox using textures. Your Hero will be able to move around your world as well to see where and how the particle system is running. The two particle system options are: (1) Fountains (2) Rain.

System I - Fountains

The first Particle System will simulate a fountain effect. A fountain can be used to simulate many different components in a graphics application (water fountain, sparks/fireworks). A fountain works by having a source point and a cone bounding the initial direction particles can move. Your particles will all have an initial position equal to the System's source point (the emitter) and an initial velocity within the System's cone. Once a particle is spawned, it will continue along its current trajectory acting only under the force of gravity. The particle will continue to act under gravity for the lifespan of the particle. Once the particle's lifespan has elapsed, the particle will die, be deleted, and no longer be a part of the System.

For this Particle System, each Particle will be a textured transparent quad. Choose a suitable image to texture on each quad and supply an alpha-channel texture as well for transparency on the quad. The textured quads should also exhibit a Billboarding effect: no matter what direction the user views the particles from, the particles should be rotated to face the user. Remember, the particles must also be drawn back-to-front from the user's point-of-view to display the textured transparent quads correctly using blending.

The actual context of the particle system is up to you. It could be a water fountain, fireworks, sparks, etc. Ensure the context is clear and choose an appropriate texture for each particle.

The rules for the Particle System will be specified by a control file. A single line will represent a single Particle System. At a minimum, each line must specify the following information:
  1. Type of particle system (more below)
  2. Particle system source point
  3. Particle system max cone angle
  4. Particle system min & max initial velocity
  5. Particle system min & max lifespan
  6. Particle system spawn rate (# particles / second)
These parameters will create bounds for the initial values of a Particle. A new Particle should have a random value within these bounds. Since it is possible to have multiple types of particle systems (like in the next part), the first parameter on the line, the type of system, will dictate the expected input for the rest of the line. See example following the next description. Provide an example control file demonstrating the fountain particle system.

System II - Rain

To simulate rain, we must first create a source (emitter) for the rain to fall from. Create a cloud that will be the holder for the Particle System. Each drop of rain will be an individual Particle. Again, the Particle System will have an emitter and this point will be the center of the cloud. When a particle is spawned, it will have an initial position within the bounding box of the cloud. Once a rain drop is spawned, it will act with gravity as an outside force. The rain drop must also be a textured transparent billboarded quad.

Once a rain drop hits the ground plane, it could then create a splash. At this point, the rain drop particle will die and spawn a new particle system. This new Particle System should be very similar to the fountain from System I above. The splash system will move in a cone acting only under gravity and once the splash droplets hit the ground plane, they will die as well.

In addition to the rain drops falling under gravity, they could also be acting under wind. The wind should have a direction and a speed. This additional force will be acting on the rain drops. Give the wind a source point, a direction, and a bounding box. If rain enters this bounding box, then it will be blown accordingly. Think of a fan sitting in space, if rain falls in front of the fan then they will be blown. You must be able to have some sort of debug visual that can be toggled on and off to display where the wind volume is. Hint: this is a basic collision detection test.

Just as above, the Particle System specifications will be done via control file. A single line represents a single Particle System. The line should contain the necessary information for the rain Particle System (cloud position, cloud size, rain drops / second, wind speed, wind direction, wind position, etc). It can now be possible to have a single control file that specifies both a rain particle system and a fountain particle system in the same application. An example control file that specifies both particle systems is below:


# System Type, System Inputs
# Type = F, Fountain. System Inputs:
#    Emitter X, Y, Z, Cone Angle, Min Velocity, Max Velocity, Min Life, Max Life,
#    Spawn Rate
# Type = R, Rain. System Inputs:
#    Emitter X, Y, Z, Emitter Width, Depth, Min Velocity, Max Velocity, Spawn Rate
F, 0, 10, 0, 15, 2.5, 4, 4, 6, 10
R, 5, 25, 10, 4, 7, 0.2, 0.4, 15


This will place a fountain particle system at (0, 10, 0) which corresponds to the tip of a fountain object in our scene. There also is a rain cloud centered at (5, 25, 10) that is dropping rain in the distance. Provide an example control file demonstrating the rain particle system.

While you only need to create one particle system, you are encouraged to implement both particle systems. The description above and setup makes each particle system static, i.e. it has a fixed location and is always running. To truly impress the visitors at Hanan Pacha, also let your particle system be created at your current location on command (using some keyboard input). The particle system should then completely die after some time as the show is finished over.

For extra credit (Follow the Leader), create a third type of particle system that implements flocking. It is up to you to determine in what context flocking will take place. One possible scenario is a set of birds moving towards the lead bird (this case can be thought of in 2D). A second scenario is a school of fish swimming towards the lead fish (this case extends the bird scenario into 3D). Of course in whichever scenario you think of, particles must not overlap and should make an attempt to stay a minimum distance apart (two birds/fish cannot fly/swim in the same spot at the same time). Whichever context you decide on, the scene and surrounding environment should reflect the context (fish shouldn't swim in the sky and birds don't swim in the ocean for example). The type of flocking used should also be described in the README.txt file.

FINALLY (I know it seems like a lot, but there's only a few small pieces and many optional pieces), add a custom vertex and/or fragment shader to each particle in your system. You must pass a custom vertex attribute for each particle that corresponds to the particle's current age. Use this attribute to vary the particle's size, color, appearance, position, etc. Use the Fixed-Function Pipeline Shader from the Resources point as a starting point so you still have access to texturing and simple lighting.

A sample call to your program may look like:
./a6 controlFile.txt
And in your controlFile, you can specify the particle systems, the textures to use for the skybox, the shaders to use, any objects to load. Then with multiple control files, you can create new worlds without having to rebuild your entire program.
Once complete, you wait for darkness to fall to test out the show.


Part II - Website


Update the webpage that you submitted with A5 to include an entry for this assignment. As usual, include a screenshot (or two) and a brief description of the program, intended to showcase what your program does to people who are not familiar with the assignment.


Documentation


With this and all future assignments, you are expeced to appropriately document your code. This includes writing comments in your source code - remember that your comments should explain what a piece of code is supposed to do and why; don't just re-write what the code says in plain English. Comments serve the dual purpose of explaining your code to someone unfamiliar with it and assisting in debugging. If you know what a piece of code is supposed to be doing, you can figure out where it's going awry more easily.

Proper documentation also means including a README.txt file with your submission. In your submission folder, always include a file called README.txt that lists:
  • Your Name / email
  • Assignment Number / Project Title
  • A brief, high level description of what the program is / does
  • A usage section, explaining how to run the program, which keys perform which actions, etc.
  • Instructions on compiling your code
  • Notes about bugs, implementation details, etc. if necessary
  • How long did this assignment take you?
  • How much did the lab help you for this assignment? 1-10 (1 - did not help at all, 10 - this was exactly the same as the lab)
  • How fun was this assignment? 1-10 (1 - discontinue this assignment, 10 - I wish I had more time to make it even better)


Grading Rubric


Your submission will be graded according to the following rubric.

Percentage Requirement Description
20% Particle class correctly implemented with Particle.h file. At a minimum, there is a draw() and update() function. ParticleSystem class correctly implemented with ParticleSystem.h file. At a minimum, there is a draw() and update() method.
20% Particles exhibit appropraite movement under gravity. Particles die once their life has expired. Particles are properly textured billboarded quads and are sorted back to front.
15% Control file structure specified in README.txt and file is read in properly. Two distinctly different control files are included to demonstrate particle system generation.
30% Vertex, Geometry, and Fragment Shaders compile without errors. Vertex Attributes are passed to shader and used to vary some visual state of the particle.
5% World is placed in a Skybox and user can move around scene. Appropriate filters are applied to textures.
5% Appropriate texturing, lighting, & materials used.
5% Submission includes source code, Makefile, and README.txt.
Source code is well documented. Webpage named <heroName>.html submitted and updated with screenshot from latest assignment. Submission compiles and executes in the lab machine environment.


Experience Gained & Available Achievements


Assignment Attribute
Assignments +100 XP
Web Attribute
Web +100 XP
Multicast
Multicast
Follow the Leader
Follow the Leader
???
???


Submission


Please update your Makefile so it produces an executable with the name a6. When you are completed with the assignment, zip together your source code, shaders, object file, textures, Makefile, README.txt, and www/ folder. Name the zip file, HeroName_A6.zip. Upload this file to Canvas under A6.


This assignment is due by Friday, November 22, 2019 by 11:59pm.
Last Updated: 08/28/19 10:41


Valid HTML 4.01 Strict Valid CSS! Level Triple-A conformance, W3C WAI Web Content Accessibility Guidelines 2.0