Saturday, January 9, 2021

Dynamic Environment (WIP)

As a Tech Artist, I want to be able to enhance concept art, so for my 2020 Tech Art final, I began creating a dynamic environment in Unity.  This project is still a work in progress as I learn to enhance and refine my work.
Currently I have a Day/Night Cycle in place, using a directional light for the sun and a point light for the moon.  

The position of the moon is calculated using the 2D rotational formula which utilizes sine and cosine to rotate a “point” around unit circle. *hit play* This is then modified by a scalar value (customizable by the user) to set the distance of the moon from the scene’s origin.  
The sun is simply rotated about the x-axis. Currently the duration of the day is a 24-hour/24-second day, making the rotation angle 15 degrees (360 / 24).


The dot product is used to increment the light intensity of the moon and sun as they head towards their apex, then decrementing them as they reach the horizon. It is also used to set the sun’s color gradient (to simulate sunrise/sunset).

I also wanted the sprites to cast and receive shadows, so through research I discovered that this could be accomplished by 1) turning on the ability of the sprites to cast and receive two-sided shadows via a small script, and 2) writing a shader that allows shadows to be cast and received.  I also added the ability to take normal map information to make the 2D art respond to the light. 

<video here>

I also have a particle effect in place to simulate rain in the environment.  I plan to make the rain volumetric instead of 2D and add in effects such as clouds and lightning to improve the feel of the storm.

<video here>

This is just a static test scene, and while I’d like to build it up more (though I certainly enjoyed making an homage to the classic Disney cartoon The Gummi Bears), what I would really like to do is be able to take these tools and implement them in an animated 2D scrolling scene.

This image is from a scene I made and animated in Photoshop and Premier and posted previously in this blog. The interior is currently static, while different assets pass by in the background. I would like to take this to unity, implement parallax scrolling, and figure out how to utilize the lighting and effects I’ve created as seen through a train window.



The shader used to create my normal maps and 2D shadows was inspired from shaders created by anlev on github and WrongTarget on the Unity forums. 


Thursday, January 7, 2021

Doggy Vision Shaders

During one of our two-week Rapid Prototype Rounds with the theme of "storytelling", the team I was part of created the game, Campward Bound: The Incredible Journey, the story of a lost dog trying to find their owner.
Since we were playing as the lost dog, I proposed we try and make it feel like the player is looking through the eyes of the dog.  This would not only add to the storytelling element, but also made the core mechanic a bit more challenging since you are seeing things like a dog would.
Below is a before and after of a test scene in Unity that I set up while building my effects:


Since dogs are nearsighted, I altered the depth of field, and the "smell-o-vision" is represented by a particle effect that is untouched by the post-processing shaders. The Depth of Field effect is also customizable in the inspector.
As dogs also have limited color vision, I wanted to find a way to mimic this effect with another post-processing shader placed on the camera that tinged all the values in the scene with a greenish hue.
Below you see the same test scene, with all the "Doggy Vision" shaders in action:


Shader inspiration comes from Catlike Coding.

Search This Blog