Wednesday 29 April 2015

Progress Updates

I've made some progress on my project and this update should cover all the latest additions.

I've now linked in opacity attributes into the master slider. These were initially unable to be keyed to the variable but I have used a workaround for this. These particular attributes control opacity settings on the opacity ramps which do not have a corresponding attribute to be keyed. However you are able to set the attribute in the script so these are updated in the storm script directly.

I've also added in the secondary cloud layer which resides just above ground level. This one of my favourite additions to the scene as it really creates some immersive effects. I've made this reasonably fast paced and both its texture time and opacity are linked in to the main storm controller.

Unfortunately I have ran out of time to explore the dynamic behaviour of the dust particles in the air. This would be linked in to a turbulence field which I shall discuss below. I'm not too concerned about this as I would've needed to explore more shading options to get the right effect I was looking for.

I've scripted in an air turbulence regulator which goes alongside the gust of wind event. It generates random numbers which over the course of 100 frames ramps a variable up and down. My plan was to link this in to the turbulence or use it to change the direction of wind over time. The script does provide a working set of numbers to work with (still needs a little tweaking) but I just don't have the time to finish that.

I have been unable to sort out the rendering issue and have tried other computers to see if it was just mine. I've also ran into countless other Maya errors, most of which are harmless but are considerably annoying to deal with. I've logged these in a text file which I'll include with the final project files.

As this was my last module hand-in for this semester, I was unable to foresee these rendering issues and with other modules taking up a lot of my time in recent weeks I was unable to solve the issue. I will have to use the Maya software renderer which does the job but doesn't look as good.

Thursday 23 April 2015

Rendering Errors

Unfortunately I've been experiencing a lot of rendering errors which I have so far been unable to solve. This is particularly distressing considering hand-ins are approaching.

This blog post documents the errors and steps taken to try and solve a workaround.

The main error I've encountered is "Error: *Fatal* (mental ray) : mental ray encountered a fatal error. The system may have become unstable. Please save the scene and exit Maya."

Unfortunately Maya does not give any more additional information about this error and looking up troubleshooting gives multiple possible causes and solutions. As always with Maya errors, a number of people online also claim to run into this problem but rarely are there any mentions of how or if the problem was solved.

Maya's Support Article claims the issue is related to textures being only 1 pixel however this does not seem to be the issue I'm having. The scene has been previously able to render but it is perhaps an additional object in the scene which is preventing the render. I will attempt to identify what object may be causing this.

Maya Software and Hardware rendering still works but the quality is far less superior and greatly increases the visibility of particles in the scene which doesn't particularly look very good. It does still show the storm script in operation which is good and may have to be used

Tuesday 21 April 2015

Creating Clouds

I've mentioned a few times before that I'd tested out dynamic clouds but haven't yet shown my work with them.
Originally following this tutorial I combined the clouds with the atmospheric fluid containers and the results were a good start.



By increasing the "Texture Time" each frame the clouds would shift, un-form and reform which looked pretty cool. I tried this out as an expression then later included it in my final environment.

I've now got clouds set up in my scene and it is controllable via the interface and storm script. By using the master storm slider the height of the clouds is decreased, I also alter an opacity setting that increases the thickness of the clouds.


The intensity of the storm also affects how active the clouds are, you can just see this in the playblast I've included although sometimes hard to see.

I hope to alter the colour and lightness as well and most importantly I'm going to add in a secondary layer of clouds only visible during the storm that are closer to the ground.


Monday 20 April 2015

Connecting Wind to Script

I've now got a working "wind gust" in the storm controller. I now want to control this attribute to a wind field within the scene. This will then affect the vents of gas that are coming from the planet's surface.

Similar to my tests with particle emitters, I created a Volume Axis field and positioned it over the gas vents. I had a bit of trouble initially getting the smoke particles to interact with the air fields. I solved this by using the 'Dynamic Relationships Editor' to link the air field to the three nParticle shapes.


The result was working wind, the above video shows the current implementation but I've yet to properly set the attributes. Here the wind speed is exaggerated just for demonstration. I want to address the issue that the boundary of the air field is quite sudden, adding a drop-off in intensity should solve this.

Next was to set a "wind constant" which would be the wind speed while the "Master" storm control slider was set at 100%. 

Now that I've got a working wind gust mechanic, the next step is to link that into the controller interface. To do this I will take the wind speed and acceleration values at each frame and pass them through an multiplier which determines what the actual wind speed should be depending on the setting of the master controller.

This will allow for the user to view the change in wind speed in real time, however wind gusts may not react smoothly until this code is implemented and tested. 

Interface - Connecting Attributes 2

I decided to make the gas vent's height and strength controllable via the interface tool. The reason for this being that not only is the storm a hostile part of the planet, but that the gas vents can also play a part in the narrative of the environment.

As the user may want to control these elements, I added sliders for height and strength. The particle emitters themselves don't have these attributes so I played around with the attributes they do have in order to find something to connect my controllers to.

The vent height attribute is keyed to the gravity of the particle nucleus. This at first does sound wrong but it does achieve the desired effect I wanted. By reducing the gravity the particles rise further which is the desired effect. It does however alter the nature of the particles such as thinning them out but I am happy with the result for now.
The vent strength attribute should combat this as this attribute controls the spawn speed of the particles (which therefore thickens the stream out again). It also controls the radius of the particles.

On a side note, the maya command "connectControl" can only control one attribute at a time. So in order to control the same attribute on 3 objects, 1 attribute has to be set-up and connected to the 3 variables via set driven key.

Saturday 18 April 2015

Storm Script - Wind Gusts

Something I wanted to include in the storm script are events like random gusts of wind, or gradual increases of turbulence and moving fog.

I began with implementing a random gust of wind. With the storm slider activated (anything over 0) I knew there would be a constant wind speed. I wanted the wind at a certain point to accelerate quickly then peak off and return to the constant speed.

To activate the event, a random number is generated at every frame and if that number is higher than a set number, then the event activates. I picked random numbers and played through the simulation a few times until I got a frequency I was initially happy with.


I knew the result I wanted and I was confident I'd be able to code it out but was initially stumped on how to implement it.

I discussed this with Computer Games Technology student Michael Daltrey who helped me to take my idea and apply a logical coder's approach to each step needed. I drew out a speed curve over time to suggest ways I could attempt to add the wind. Michael drew an acceleration curve as this variable would be the main change which would affect the speed at each frame. We decided the first curve type (out of the three drawn) was the easiest to approach and we worked out the pseudocode.

From here, I tackled this in Python, initially getting a triangular peak (as shown on the bottom right of the image) as I was using a constant acceleration and deceleration. After changing the rate at which the acceleration changes (to match the acceleration curve) and after contending with a few Maya freakouts I was getting promising results.


This is a screenshot from the script editor which prints out variable data each frame. This gust of wind was activated on frame 114. Note at frame 124 the acceleration is displayed as a very small number. This should be 0 but Maya doesn't quite agree, this was one of the freakouts I mentioned earlier, I had 2 lines of code which helped to work with that number.

Now I just need to link this variable to a wind field within the scene. That will then affect the particles of dust and smoke within the scene.

Thursday 16 April 2015

Interface - Connecting Attributes

As my assisting tool was using sliders, I wanted those sliders to have meaningful number scales. I chose 0 - 100 as the default as its a good whole number, understandable and often associated with a percentage which works well for most of the sliders I've used. For example the storm master slider, goes from 0 - 100 where 0 is turned off and 100 is 100% storm intensity.

From the start, I wanted things like "Time" to be a little easier to understand so 0 - 24 seemed more appropriate. Yes I could have made this anything, it is an alien planet after all and days could be longer, but for the sake of usability: 7 is morning, 12 is midday, 8 is evening, etc.

Originally I used the maya command:
maya.cmds.connectControl(scene_time, "grp_light_control.rotateX") where the group held a light whose pivot rotated around the scene. For testing purposes I had to set the slider from 0 - 360 to work.
To get a better slider scale to work I was first a little stumped. I thought I'd have to add new attributes to objects with a scale I wanted, then use the hypershade editor to connect them to the existing attributes that needed to be controlled. Although I did need new attributes, set driven key was the solution.

Simply, I had to create a new attribute on the object I was controlling, so for the light control I added a variable named scene_time which had a minimum of 0 and maximum of 24. I then used set driven key to key the object's rotation (where 0 was 0 and 24 was 360). And now I have sliders that are appropriately scaled, hooray.

Saturday 11 April 2015

Building the Environment - Renders

I've started to put together my environment. Similar to my test renders earlier, I've created a terrain mesh and included a texture. There is obvious repeating texture tiles but I'm not too concerned about this as any attempts to create a high quality texture complete with normal maps, etc. would take up too much of my time. It is not my area of expertise after all.


Using colour ramps its easy to add visible layers to the atmosphere. In the image above it doesn't look too great but in the image below I used it to create a haze of dust that sits above the surface. I also try to sort out a light which can be used to achieve different times of day depending on its position.






I'm quite happy with the final image, with a higher quality settings turned on the lighting looks a little better and the sky is a nicer colour. I added in clouds I'd created in an earlier test.

I will now attempt to alter the colours to match my earlier concept drawings.

Building the Environment - Concepts

In response to the learning contract I wanted to further specify what type of environment I wanted to build. I want to convey an alien planet, with inspiration from the planet of Mars and Saturn's moon Titan.

I didn't want to concentrate too much on the terrain and modelling aspect as this project is mostly about the air, the atmosphere and the dust particles that make up the rest of the scene. However I did want to consider the colours and composition of the scene.

I put together an environment in Photoshop that I tweaked the colours of to see what would work. They aren't meant to be works of art but they are a good representation of the direction I'm aiming for.

I wanted to make a clear difference between the planet in its calm state and when the big toxic dust storm came into the scene. For the planet's calm state I think the colours that work best are the second two which are slightly more blue.



The yellow is too close to the orange-brown dust so it gives the impression things are already hostile, whereas the blue is a complimentary colour to the ground. The blue is also more representative of our own atmosphere which we already come to recognise as safe. I liked using the blue to hopefully make people associate the blue with "breathable" air.

This idea is also used in Total Recall (1990) but they use a very dark red to identify the hostile environment and the blue with the breathable environment.


The below concept is an attempt at showing the planet enduring a toxic dust storm. My environmental art skill isn't fantastic but it gives an idea of what type of additions I want to include that invade the calm environment.

Tuesday 7 April 2015

Tool Interface

As I want the environment to be controllable by the user, a small scripted tool will accompany the scene. It will be used as a simpler way to interact with the variables in the scene and allow the user to set-up the environment to suit their needs.

I have created the interface in Maya and although not functional yet, it serves as a good outline for what options I want to have.


I've used frames in order to split up the various sliders. The environment controls will handle things like the time of day, and the properties of dynamics already in place in the scene (such as the vents of gas on the surface).

The storm controls alter the variables which will be used in the storm expression. The storm expression will be coded separately and will use the user set variables to control the attributes of objects in the scene.

Last semester I used a form layout to position objects on the interface. This time I have used frames which allows me to split up the sliders, as well as allow easy addition of new sliders into the window without the need for manually inputting form positions.

Most of the sliders will go from 0 - 100 for ease, the "Time" slider will probably go from 0 - 24 to represent hours of the day. I may change this to a simple day/night slider or restrict this to certain hours as I am not yet sure how I would move the light source around to achieve a day/night cycle.
The "Master" slider would remain at 0 by default, setting this to 100 is essentially turning the storm on and choosing its intensity.

Sunday 5 April 2015

Tool Interface Ideas

Part of the requirements for the brief is that some sort of scripting must be included. I've been thinking into how I would include this in my environment dynamics scene,

I have drawn up an idea of how I'd like to set-up my environment. I'd also like to allow the user to be able to activate the storm on and off via a separate window.


The interface could include sliders for things such as the time of day, intensity of the clouds and dust, or the turbulence and nature of any wind in the scene.

I am thinking about creating a storm script which would run off an expression. This expression would use the slider settings and generate the storm scene. The storm itself would likely be ramping up and down air turbulence, adding in sudden wind gusts and varying the degree of dust in the scene.

The tool and scene together would create a helpful tool for the user to set-up different scenes. For example if this was a CGI scene in a movie, the layout artist could quickly set-up how the weather is on that planet.
Unfortunately I don't think the tool could be used to dynamically change the weather in a scene. I would need to be able to bring in the weather from off-screen and more work would be required to get this advancing weather front to look natural. I will focus on purely allowing the sliders to set-up the scene beforehand where it looks good constantly playing. The storm script itself will vary the intensity based on settings.

Wednesday 1 April 2015

Scene Composition

In response to the learning contract feedback, I needed a better plan of what sort of environment I'd be making and what would be included in it.

I came up with this quick sketch which identifies the different dynamic components that make up the scene.


In addition, I also considered how I may want to include the use of expressions and scripting in my project. An accompanying scripted tool that has control over certain aspects of the environment or attributes within the "storm" expression may help to give me a chance to script and also enhance the usability of the scene.

Tuesday 24 March 2015

Particle Emitters

I've been playing around with particle emitters in the hopes that I can use them to add dynamics and visual interest to my scene. On my alien planet I'd like to have volcanic vents that rise up from the ground to give the scene some atmosphere. It would also interact with the air and forces can be applies during the activation of the storm.


In this particular instance the particles increase size over time. A 'Radius Scale' ramp is used to control this which helps to achieve the effect that the smoke is dissipating over time. This scale is also randomised to a small extent to reduce repetition.

I've also applied a "Volume Axis" field which applies turbulence to the particles as they enter the field. I'm not entirely sure what the difference between a volume axis field and an air or turbulence field is but it seems to do the job.

I will use something like this field that can be tweaked along with the storm controls.

Sunday 22 March 2015

Learning Contract - Feedback

I've received feedback for my learning contract submission.

The project aim and breakdown I want to achieve are within reason and the project seems to be relevant and complex enough to progress in. The project so far is a good start and I will definitely have a good amount of material to explore. Of course there are also a few things I missed out:
Further conceptual consideration should be addressed, for example, I will need to consider what kind of environment I want to make.
There is also an issue of my scope not being entirely defined, as in what I will be handing in at the end of the semester.

The feedback also states my project could benefit further from the "discussion between scientific data and creative license" and "whether there is a tension between realism and creativity being explored" or is it "utilising facts and data to inspire new (personal) creative approaches". I believe I have made a start in considering this, my blog posts so far definitely look into the science behind my creative approach but I would've benefited from further exploring this in my learning contract. I think I am on the right track here but can continue to look at the relationship between the realism and imagination.

From the feedback I've come up with a few points I will attempt to address:

  • Scope - I'd like to aim for 2 rendered scenes. These 2 scenes will actually be from the same environment but with different weather situations.
  • Video Report - My video report will include these renders as well as a walk through behind the scenes, and showing various other implementations and experimentations.
  • Environment - I need to focus on what type of environment I'd like to create. In short, I'd like to create an alien planet that seems relatively calm but endures frequent dust/smog storms. I will create a blog post in the future to properly define what environment I will build.

Test Scenes

These are a couple of test scenes I've created which compiles the tests I've done on generating a volume of "atmosphere" and also the tests on creating clouds.

I created a simply terrain mesh and added a light, positioned a camera inside and it looks pretty good.



This is the same scene but at different times of day. I also tweaked the colour of the atmosphere and changed the position of clouds to make it look like time had progressed.

Monday 16 March 2015

Generating Atmospheres

One of the things that initially drew me to this project idea was the ability to create interesting coloured atmospheres. Gradients are always fun to play with but I think its more interesting seeing these gradients in real life on both real planets and conceptual planets in movies, games and artist's impressions.

Using Maya's dynamic fluid system I created 3D fluid containers which contain a large number of particles.



There are a number of attributes available to edit. To create these gradient effects I've mainly used the Color, Incandescence and Opacity ramps under Shading settings.


There are a number of other settings that affect the nature of the particles and how they react with the environment. I may or may not mess around with these as I don't particularly need my atmosphere moving, I just need it to exist. That being said, I will probably want to edit the opacity and colour ramps at ground level to increase the air density.

Thursday 12 March 2015

Researching Atmospheres

I want to take a closer look at planetary atmospheres, how they are built up, how they appear and the possibility for exploring different ways to make them in Maya dynamics. I want to be able to have enough options to explore and to give my project enough complexity.

NASA's Cassini spacecraft is currently orbiting Saturn, its been there for over a decade studying the planet and its moons. Huygens was a piggyback lander and was sent to Saturn's Moon Titan just over 10 years ago (Jan 15, 2005). It was the first lander to land on Titan and one of the best opportunities we've had and seeing what is underneath Titan's thick atmosphere.

It capture many photos which were compiled into this video which emulates the view as it approached its landing site.




The moon Titan has always been very interesting to me. It is the only moon in the Solar System with a thick atmosphere and although smaller than Earth, its atmosphere is denser and air pressure is higher.
The atmosphere is made up primarily of nitrogen but is also abundant in methane and hydrogen.



I find the following image to be quite interesting as it shows the layers of Titan's atmosphere.

The image below shows polar clouds on Titan (left) compared with polar clouds on Earth (right). I particularly liked the colours in these clouds, it looks very alien for something we see on our planet everyday.


That should hopefully be the last science-based post and I'd now like to look at how alien and hostile environments are created in movies to tell a narrative or convey the danger of the environment.

Monday 2 March 2015

Learning Contract

As part of the coursework submissions I have built a more detailed plan for what I'd like to create this semester.

I have chosen to focus on environmental dynamic effects, in particular atmospheric effects, clouds and dust. I'll be looking into the way fluids and particles can be used to create these effects and how they can be used to inform the viewer the narrative of the environment.

Research has already been posted to this blog but I'd like to also look into films as an example. I referenced Prometheus and Riddick as examples of alien planets that have a hostile feel to them.



I've set myself the following aims:

  1. To explore and understand the use of dynamic fluids and particles in the creation of atmospheres, clouds and dust.
  2. Explore how atmospheric and environmental VFX can be used to enhance the narrative in film or animation.
  3. Create a series of renders that reflect the research and testing.
The tasks I've set myself for the project include creating iterations of simulations with maya fluids and particles, research into VFX environments in films, and finally putting what I've learned together into a final scene or scenes.

As a lot of this is new to me I've not entirely defined the scope as to what I'll be able to cover but I will definitely have a final rendered shot as well as progress and iterations playblasts.

The full learning contract document can be viewed on Dropbox.