A shader that looks at the texture, and based on the image, subdivides itself to create depth diverences in the used mesh. The shader looks at the brightness of the image and bases the depth on the level of light tints used in the image. This could be used to bake depthmaps fast and flexible making it a fast way to create depth contrast in your floors or ground. The shader can be changed with a slider to change the level of subdiving the shader is able to do. The more the slider is moved to the right, the more subdivision you allow the shader to make. This comes in handy when you don’t want to have too much polygons. The topology isn’t that clean though, this is something I want to come back to on a later time. The animation at the top of this text is captured real time in Unity.
Semi Flat Shader + Models:
A shader that combines flat shading with the light in the scene. I always like flat shaded games or scenes, but most of the time these scenes lack good readability for the lack of effect the lighting has in the scene. This is why I created a shader that combines the flat shading technique with the lighting in the scene. This way a semi flat look is created that is usable for low poly scenes. The shader calculates the light intensity per polygon and looks at the color of the light that is effecting the polygon. Based on these calculations the shader blends the vertex colors or texture with a soft version of the light that is hitting the object.
Ground Color Gradient Shader:
This shader is created to make the transition between the ground and the foilage on the ground smoother. Before I made this shader, Survive & Thrive had a clear edge dividing the ground and foilage models from eachother. This was bothering me because it destroyed a big part of the immersion.
The shader observes the (world) position of every polygon. If the polygon is closer to a 0 in the Y coordination it will blend more with the chosen “ground color” color. This way a small transition between ground and the model is created on the bottom of the mesh, creating a smoother transition. The distance from which a mesh starts to blend with the chosen “ground color” color is editable with the use of a slider.
Distance Alpha Shader:
The trees were in front of the player during playtest of Survive & Thrive. This was really disorientating for the player and needed to be fixed. Especially when the player was walking through thick jungle landscapes. I designed a solution in form of a shader that would make objects like trees and other plants become more transparant if they came to close to the camera. This needed to happen in a transition. We didn’t want any popping to be seen on the screen.
The shader hugely increased the readability of the game and as a bonus created an intriguing effect.
The shader observes the (world) position of every polygon and the (world) position of the camera. It than calculates the distance between the camera’s (world) position and every polygons (world) position. When the distance reaches a certain “variable” of distance the object start transitioning to a transparant object (by using the alpha channel). The shader looks at the given “variable” of thickness (how fast the object needs to become transparant when it comes closer by the camera) and accordingly changes the transparancy. This happens on a polygonal level, creating a disolving effect from top to bottom of the mesh. Making the transition between solid and transparant smoother.
Sun Rays Particle:
A particle effect instead of a shader. This particle effect is created to make more “feel” in the game. We couldn’t use the sun shadts effect in Survive & Thrive because the perspective was turned down, towards the player. We wanted to make the light more present, especially when you walked through thick jungle landscapes where sun shafts are common. I faked the sun shafts by creating a particle effect that spawn planes which pivot point are placed on the top. These planes are rotated, this way they rotate around the particle emitter with the top op the sun shaft (plane) still on the emitters position and the bottom on a random position. Creating an illusion of light shining through a pack of leaves.