Monday, April 20, 2015

Unity Shader & Material: Fade by Distance

Recently, I switched over from UDK (Unreal Engine 3) to Unity to help with some vfx on a project. My friend I am working with asked if I could make a fog effect that faded when the player gets closer to it, so that they never actually touch the fog walking through it. I had done a few things with object and world position in UDK before, but wasn't sure if Unity had the same capabilities. When I first opened unity I found that there was no material editor like UDK, but that shaders were the equivalent and created entirely with scripting. Having no scripting experience and no time to learn it, I sought out a different workflow. Someone suggested a 3rd party plugin called Shader Forge, which is a godsend that is a node based shader editor (and a godsend for code challenged people like myself). I highly recommend supporting the creator and downloading Shader Forge for Unity, especially if you are starting out in Unity, or coming from UDK/Unreal 4. You can find Shader Forge HERE, and it's website and node documentation HERE.

After messing around in the editor, researching nodes, and finally getting very decent fade-by-distance shader/material, someone asked me if I could post my setup and findings for documentation and reference. So here it is, my full setup that I'm testing, as well as the setup for just the fade by distance. First I will cover my node tree, then the player/object distance setup, followed by some useful tips I discovered while experimenting. I am by no means an expert in Shader Forge, Unity, or material/shader creation. The information that follows is what I have learned just from my experience creating this effect in Shader Forge.


My full node tree, which combines the value output by the distance between the viewer and the object (in this case, a particle system) with an alpha erosion setup. My setup uses the value output by player/object distance twice; once to drive the alpha erosion, and the second time multiplied with the erosion for an overall fade out. I included a slider to divide the distance output, as my team is still working out the unit scaling of the levels. This gives me or a level designer versatility to adjust the scale of the distance fade. After the scale fade, I have another slider subtracted to fine adjust the distance the material completely fades out. My final slider for the fade is a decimal value subtracted from the distance value and multiplied after the alpha erosion for control of when the material is to evenly fade out. A big thanks to Bill Kladis and his tutorial on alpha erosion!




For my player/object distance setup, I will be referencing UDK a few times, but will also include any information needed to understand this effect if Unity/Shader Forge is your first experience with this kind of thing. 
The main composition of my player/object fade is the 'View Pos.' node, the 'Object Pos.' node, and the 'Distance' node. The 'View Pos.' node refers to the viewer's XYZ position within the game space, and likewise the 'Object Pos.' node refers to the object's XYZ position that has the material applied to it. The 'Distance' node takes the X, Y, and Z values of the two inputs (in this case, the distance between the player and object) and outputs a single value. The closer the distance between the two, the smaller the number. My assumption is that the distance within the Unity editor is set, so the larger your assets, the larger the distance of the player's perspective, and hence the base value control. This gives the shader more life, as it can be tuned for both large or small scale games, and using a slider node gives the user the ability to test in real time rough inputs and get an idea on what value they will need. KEEP IN MIND: this shader will work as intended with individual assets, however when applied to particle systems, the shader takes the object position of the system node. Please read further for more information on use in particle systems. 


For UDK/Unreal material users, Unity's 'View Pos.' node (through functionality testing) seems to be the equivalent of Unreal's 'Camera World Position' node. This relation seems to hold true as well for both 'Object World Position' (UDK) and 'Object Pos.' (Unity). I DID try various combinations in Shader Forge of the 'Screen Position' and 'World Position' nodes with View and Object position, but was not getting results similar to my effect in UDK. It is quite possible, however, that one of these is actually a better choice than my current setup and I just needed to check a box or add something else to it.



Some things to keep in mind when using this player/object distance fade setup:

 Unlike UDK, who's player/object distance seems to work on a per-particle basis (distance applies to each particle), Unity's works between the particle system node and the viewer distance. This is roughly illustrated in the above image.

What does that mean for the effect? It means that you can't use just one particle system for a whole room or hallway as something like ambient mist or fog. Depending on the size of the effect and the player's distance from the system node, particles may not fade as the player passes the furthest particles, your particles on the far side of the node will fade the same as the ones in front of you, or all of the above. My only suggested workaround for this so far is to talk to your level designers or open up some levels and find out the unit sizes of your various rooms. Keep your particle emitter volumes small, place as many of the nodes as you need to get the desired effect, and then create a room prefab of the combined particle systems. That way, you or your level designers can place the pre-constructed fog volumes into the hallway or room without them having to constantly place multiple particle systems themselves.


 Some other cool stuff!

Something cool I found while messing around with the particle systems for my fog volumes (Unity) was changing the Sort Mode to: By Distance. When the player approaches a particle that is between the camera view and the particle system node, the particle will actually get pushed "out of the way" and around the camera! It gives a pretty cool effect when combined with a fade, and gives the feel of a curtain parting for the player.

 This, again, seems to work off the particle system node and not the particle systems itself when it comes to distance. I'm not sure what controls the distance the particle decides to move out of the way, and I am by no means an expert on this sort mode. This was just some cool info I found just messing around, and at this time I'm unsure of it's full function and limitations.

A demo of my player/object distance fade with placeholder fog/smoke textures. Shows both sorting modes.



Saturday, March 7, 2015

GDC Update and Website

Hi all. If you're reading this, then there is a good chance you received one of my business cards from GDC this past week; if not, Hi all the same! There was a slight error on my business card, directing you here, however I made a website after those were printed.

You can see my website, along with my demo reel at: https://sites.google.com/site/travishendersonvfxartist/ 

and my LinkedIn profile here

It was great meeting everyone at GDC this year!

Friday, August 22, 2014

Page Update!

Videos have been added to my Blog's WIP page! These go in order from most recent at the top, to least at the bottom, and are only my best wip effects.
Also I have added my updated resume to my Resume Page.
Go check it out.

------------->

------------->

Friday, April 25, 2014

493 Progress Update

I am currently working on smoke for my Darksiders horse. The particles will be based at his hoofs, neck, nose and rear legs. The soot/smoke will make up the horse's mane and tail, as well as around his feet, like Ruin and Despair, two other Darksiders horses. This work will be done in UDK3.

Here is my Cascade particles work for the smoke fx so far. I am still deciding between black smoke, or deep purple flames, as Strife's horse is considered the Black horse of the Apocalypse. (War's -> red horse, Death's -> pale horse)

My quick sketch concept for where the smoke particles will be located and how they will be utilized


These two images are from Darksiders 2, to give an idea on the style I am trying to accomplish with my effects work for this horse




Friday, April 11, 2014

493 progress update

Using some terrain courtesy of ImbueFX.com I have made my own lava flow dynamic material for an ambient scene to put my creature model into. Having the main lava stream done, I will add a few more smaller streams coming down the hill, and just apply the same material to those as well. After I have my creature model finished, I will import it into the scene and begin working on the effects for it.


 This is not the final camera position, just one to showcase the material.

Friday, March 7, 2014

493 Update Week 7; pt. 2

In addition to finishing my health packs this week, I also kit bashed and re-purposed one of my old effects. It's about half way where I want it to be right now, but it's better than starting from scratch. I hope to re-do the up rays, add a new blast ring around it, as well as some fire elements.


My effect so far...


An example of how I plan to re-purpose my effect.

I'd like some more contrasting up rays as well as that hot and solid "blast ring".

Wednesday, March 5, 2014

493 update Week 7


Have my three stage health pick up effect blocked out and mostly done. It could use some polish here and there, but as I'm happy with it as is, and am pressed for time I will call this "done" for now.


Friday, February 28, 2014

Wednesday, February 12, 2014

493 update #1 week 4

Started sketching out ideas for a large scale project, transferring a high detail simulation from 3ds Max into a game engine. For this project I will be attempting to import the destruction sim into UDK3. Over the weekend I have been learning up on Max as a program, since I will probably need most of the features to achieve my goal.

Started running through the 5+ hours of digital tutors' Max intro tutorials

I found a model from the game Devil May Cry 4 that would make a good statue to smash.

I put him in a pose and rendered a side view for demonstration and sketch purposes


A quick sketch of my idea for the scene and simulation

List of project needs:
  1. Model, UV'd
  2. Stone/Marble texture
  3. Pedestal 
  4. Blocked, lit environment
  5. Fracture plugin (Rayfire, MassFX, Thinking Particles)
  6. Object to smash statue (most likely Digital Tutor's project ship)
  7. Ground fracture effect


Friday, February 7, 2014

493 post week 3

VFX Updates

For 493 this semesters I will still be working on my vfx work for games. I'm starting off with sketching out ideas for two projects I have in mind. First will be just basic health pickups you would see in games. I have been playing around with ideas and sketching them out, shooting for ones I can add the most particle and material work to without overdoing it. Since I want to focus on health pickups with fancy but robust effects, things like: metal containers containing health fluid, med kits, and the "syringe" idea are out. 

I sketched them out with the direction of a "small, medium, full health" idea. Adding visual progression to each stage as best I could come up with, with a scale reference to an "average" sized character to whatever game it would be in.


The other effect I have been sketching out is more material based, with a focus on material transitions. For this I came up with the idea of a holographic projection gun. The idea of this is instead of swapping weapons directly from and inventory, a hand-held holo-constructor would construct and deconstruct the players weapons. This would happen in a sort of Tron style, bright light projection from the base. As of right now I have the concept for a pistol, assault rifle, sniper rifle and rocket launcher; the standard FPS weapons.




Monday, December 16, 2013

CDES 219 Blog Post +10

Reflections

Social media influences the day to day lives of every person who has a social media account. With it you can connect to all sorts of people and for various reasons. Whether it is a site like Linkedin, for professional connections, Facebook to keep connected and updated with friends, or Twitter to post random stuff for anyone to follow. They can effect everything from what you eat today, (maybe someone posted about pizza and now you want pizza, or see a picture of what someone had at a restaurant) to what you watch on TV. 

I think social media has made us less social, and has inflated people's egos, or gives others a false sense of our lives. I think things like "thumbs up," "favorite" and "retweet" stand in the way of people having actual conversations. However social media makes it much easier to organize events, with times, directions, invites and such that are much easier and faster to update than emails or phonecalls/texts.

The most promising aspect I see in social media, is getting only advertisements for products you want from things/companies you like. No more seeing commercials for Venus razors if you are a guy just trying to watch the game. 


Monday, December 9, 2013

CDES 219 Blog Post #9

The Future: Predictions

The future of social media holds many promises. And individual can share his or her ideas, news can be updated in a second, companies can crowd source input on a new product, stores can advertise... and all to a target audience for almost no cost. My focus was on the use of social media by companies for advertising and selling products. Although these companies cannot rely entirely on social media sites for their function, as they still need at least a website for consumers to by their product at, social media gives them a powerful form of advertising.

This advertising is not only cheap, but generally efficient, as individuals who are interested in the company's product will receive the updates. These followers, will likely share this information to others they know who would have interest in the products. Companies have feeds like Twitter and Instagram where they invite their customers to share pictures of themselves using their product. The users can tag and link the company in the post with its name or a specific hashtag. This offers a huge advertising resource, because each of those individuals is likely to have followers or friends view their pictures, see the product, and look into it themselves. Not only can these companies share their their product, but can receive feedback on their products and input on future products. Most of the companies that I've been following offer special offers and discounts specifically on their social media feeds.

I believe that companies in general, not just companies that offer a product, will begin to use social media more frequently. In an age where cable TV is slowly declining and shows and movies are watched over the web, social media will be used more as an advertising medium. With it, you no longer have to purchase air time, or a specific slot to run your add. No longer do you have to compete with others for the time or channel with the most exposure. If you think you aren't getting through because someone's news feed is clogged up with other posts? Promote your post and have it at the top of the feed for very little cost.

In an age of wanting things faster and faster with little delay, I foresee companies directly linking purchases through links in social media posts. An example would be an company is having a sale on a certain item, all you have to do is click/tap on the post and it will instantly take you to the company's site, in the check out with the item in your cart. This could possibly be taken even further by linking a credit card to social media sites, so that when you click on an offer it already has your information put in for the order. All you would have to do is click purchase and wait for it to be mailed.

My advice to others, make a profile on a large social media site, and like/follow all the companies that you buy things frequently from. You will get special offers, deals and information on those products, as well as possibly find a community you share an interest with. For me, the fitness and gym-going community generally revolves around the same sorts of sites with people of the same mind set as me.

Thursday, November 14, 2013

CDES 219 Blog Post #7

Social Media & Learning: How has social media changed learning?

I believe social media has allowed for the ease of sharing material with students, either from a teacher or peer to peer. Having something like a Facebook group for a class discussion section could be very beneficial. Social media's core design is the streamline and ease of sharing content among a large amount of people. With a platform of that design, there is a simplicity of sharing everything from articles to YouTube videos. With a teacher as an admin or group administrator, the group could be carefully monitored so that students don't post unrelated content or get off topic. Social media has the potential to replace traditional practices such as after school study groups. Students no longer would need to all be available at the same time to give input on a project, and the teacher also has the capacity to answer questions or clarify a piece of information in a group setting. This also helps to reduce the confusion of tons of emails to a teacher, all trying to keep track of each individual thread, in which they could all be related to a similar question or topic.
It also allows students to pool ideas and resources.

It is my personal opinion, however, that social media only be used as a tool at the teacher's disposal, to be used at their discretion. Much like a calculator or pencils, social media should simply be available as a tool and not a core component of traditional classroom teaching. This may not hold as true to all online classes/online schools.

Tuesday, November 12, 2013

CDES 219 Blog Post #6

Social Media and Business: Business

Businesses have a much wider spread of influence due to social media. A cheap and effective way to reach millions of people with their products or services, social media allows for businesses to market on a global scale, without the global budget. For this post I will use Infinite Labs, a fitness nutrition company whom I follow and who's products I use, as my example. The first image, img1, is Infinite Labs' website, where you can view, compare, and purchase all of their products. This ranges everything from their nutrition supplements offered to apparel with their logo on it, such as shirts, bags and tank tops. On the left hand side of their page, Infinite Labs has a set of icons that are now a staple for any business: links to their Twitter, Facebook, Pintrist, etc. In img2, a screenshot of their Twitter page, they display their Logo as well as their iconic Juggernaut decal. Here, people can give shout outs to the company, ask them questions or give them feedback on their products. They also use their social media to advertise deals on their products as well as give updates on any contests they are holding. All of these examples can be seen in img3. Infinite Labs also retweets any of the post of their sponsored athletes, as well as pictures people send in of their progress using their products. On their Facebook page, they advertise the same contests and deals that they do on Twitter, except that on Facebook people can comment on these posts, giving Infinite Labs an opportunity to collect valuable feedback on their activity. Before social media, this was much more difficult, and before the internet even harder, mostly relying on focus group responses on a small scale, which were also expensive and usually a privilege for larger companies with the budget for it. Now all this is easily accessible for any company or individual with the will to advertise, market and get their name out there.

img1

img2

img3

img4



CDES 219 Blog Post #5

Politics and Social Media: Influence in Social Medial

Politics, like many other things, has found successful ... in social media. Many interest groups, political parties and candidates have successfully connected with a large portion of their constituents and are able to update them on their policies, information regarding various movements, and even upcoming bills or legislation. Not only are they able to do this cheaply and efficiently, but also frequently; able to reach out to their followers on a daily basis. They can also include things like media or pictures. If a post or information content is too long a link will often be included directing to the source of the information, original article, or to the respective group's website.

*Disclaimer*
I do not support or am intentionally advertising these specific politically affiliated groups, they were simply the first that came to mind that could be used to visually represent my blog post








Sunday, October 6, 2013

CDES Blog Update #3 - Social Media and Relationships

Where do you see social media influencing relationships? Is it a good thing?

I see social media influencing most relationship aspects, from personal, friendship, and work/school related. Facebook in particular, where you can update your relationship status and it even includes a link to the other person's profile. Facebook originally had "Single" and "In a Relationship" as options, but it has since spread to include many other options. There is the option to include who your family members are on Facebook, and quite a few people (including myself) have included very close friends as family member such as "Brother" or "Sister". Social media allows you to keep up with your friends and possibly family as well. Is it a good thing? Yes and no. It can be good to help keep in touch with someone a long distance away, or who is very busy. It can help if you lose people's phone numbers or help you to reconnect with friends from a time before the use of social media.
It can also break down relationships as well. You may see a bunch of pictures posted from all of your friends at an event you weren't invited to, or someone you don't know may tag your significant other in a post about "Having a great time at dinner." You may receive pressure from a boyfriend/girlfriend to share your password so they have access to your account, or maybe to them you aren't tagging them or posting pictures of them enough, etc.

Social media, I believe, can be used effectively to build relationships as well. You can start an event on a social media site and invite people to it, or send out group invitations. You can join groups with other people who share like minded ideas or hobbies with you. Some social media sites can separate your friends into groups such as "High School Friends" so that you can more easily keep in contact or share certain information with a certain group of people. It can help to hold together long distance relationships, such as sharing pictures or videos with friends or loved ones in a different state, or even outside the country.

Participation in social media can help strengthen relationships in a chosen field or profession as well. Your company may have it's own social media sites. You could upload pictures you took at the company picnic to their site for other employees to share and view. With so many different groups on Facebook and Twitter, you could receive all sorts of updates and information regarding your profession. This gives companies providing a product almost free advertising, and directly to their target audience as well. I follow a company called Infinite Labs, who sells workout and fitness supplements as well as clothing and other fitness related items. With the use of social media, a company can strengthen the ties with its customer base, using it to announce a new product, use comments and posts on their page as feedback on a product, promote giveaways and discounts in a fashion that is easy to stay updated upon for an individual who does not visit the company's website on a frequent basis. Most social media sites have mobile apps as well, and these mobile apps most often have alerts you can set when a chosen person or page posts something. This provides an almost immediate update to a target audience, something impossible to do with tv, radio and print adds, and for almost no cost.

Friday, September 27, 2013

Anguish Update

Just a quick update on Anguish: blocked out the mask, but that was about it so far. Had started toying around with the spine armor/vents concept but didn't get anything I like so far.



Sunday, September 22, 2013

CDES 219

Expanding the Market

I know I'm not the only person who has "liked" a favorite company on Facebook or "follows" them on Twitter. Companies have ingeniously incorporated social media into their marketing and sales, reaching much larger audiences than they ever could ten years ago, and practically for free as well. Most of these companies use social media to advertise sales, give away free products or discounts and even have contests. Social media gives companies, both small and large, a huge potential to their sales and marketplaces that was never previously possible.