• Register

The enigmatic journey of Sky, an explorative artificial intelligent made by Professor Toro Hudo who lives in Goa, the world below. Sky was created to help Professor Toro Hudo in constructing kinetic system for his foster daughter, Ocean Hudo, a forsaken limbless child who fell from the clouds when she was an infant. Observe the mystical Goa, experience its astonishing adventure with formidable jigsaw, swiveling plot, and bizarre habitat.

Post news Report RSS Irritating Implementation of Platforming Predicament, Part IV: Shader

For today’s special, we serve shaders. What is a shader, you ask? Wikipedia says “a program that tells a computer how to draw something in a specific and unique way”. Shader is used for special (and not-so-special) effects, like these.

Posted by on

Oh hello there, guys! Here already? Come on in! There are pictures to feast on and stories to savor, so pick a comfortable place to sit and eat well.

Haven’t I introduced myself yet? Well, if you follow this blog from the beginning, you surely must know that I am Chalcedony, one of the programmers of Ascender. Well you know what – now I’m not an intern anymore in devlogging – I am a full-fledged one!

Here we go, the appetizer: sneak peeks! The never-ever-seen-before scenes are ready for your eyes only! [*Plays awesome sound effect*]

Firstly, we have the tendrils. Sky can jump on and off it. Note how they react accordingly to sky's movement.

sulur

Do the villagers climb on them too?


This kind of trampoline is also fun for some boing-boing. Hold the jump button for more air time.

trampoline

Trampoline image just for placeholder.


How defying gravity sounds? You can climb wall and even fall into the horizon.

skyWalk

The house is still in repair, no worries.


For today’s special, we serve shaders. What is a shader, you ask? Wikipedia says “a program that tells a computer how to draw something in a specific and unique way”. Shader is used for special (and not-so-special) effects, like these.

Remember this big robot? His laser effect was my first shader creation (not counting failures, of course)!

bro

The rune stays intact, so why sky is not?


The layer where sky is standing is affected by the light from the lamp, whereas the background and the foreground are not. Just shader.

light

Villagers have nothing to do, so they spend the whole day standing there.


Even simple menus need shader to clip the items so they are not rendered off-window.

menu

Why so many tasks for so little robot?


Look closely, the water distorts the scenery behind it. How to do it? Shader.

water

It distorts my sanity too.


Contrast to C# in terms of language, one should use Cg/HLSL language when creating shader in Unity. The scripts below both are for B.RO, the left one is written in C# for controlling the movement, and the right one is in Cg for you know, shading.

scriptCompareThese are among the first scripts for this game! Bad, bad scripts.


Those two look alike, but in truth are quite huge in difference! Debugging is especially a hell in shading. You will often end up with this kind of result...

badWater1

Error in shader equals magenta for you. My favorite color!


Of course without you knowing what’s wrong. For some cases, Unity will be a good guy and tell you (approximately) which line caused the shader into haywire. Granted, I am by no means a master in shading, but still, when you went to fix the line, then it goes boom...

badWater2

Very menacing water.


Gah! Dealing with these stuffs always drives me to my boiling point!

Anyway, that’s all for today’s meal! Did you enjoyed it? What now, you need dessert too? If you are still craving for more, be sure to play our public preview now, and let us know what’s on your mind!

Wow, it’s been ages since my last post, but now we must apart once more. Fret not, we will prepare more special dishes for you to relish, so stay tuned, and eat well. Bye!

Post a comment

Your comment will be anonymous unless you join the community. Or sign in with your social account: