Skip to content

Latest commit

 

History

History
81 lines (74 loc) · 5.93 KB

learn_by_example.md

File metadata and controls

81 lines (74 loc) · 5.93 KB

Learn by example

Note

This page is still very much in development. There's already a fair amount of content, but nowhere as much as I'd like. The accessibility and immediacy also need to be severely improved. Please have some leniency.

This is a list of Kage shaders that you may use as references or in order to learn specific techniques. It's recommended that you have some basic knowledge about shaders and / or Kage before diving into this, but we have no bouncer at the door.

The shaders are roughly sorted from simple to complex, and they include tags that indicate what topics they touch on. Here's the full list of tags, which you may use to ctrl + f if you are looking for anything in particular:

geometry, 3D, lighting, triangles, deformation, projection, masking, animation, UI, FX, screen, sprite, image, color, artistic.

We have also created a page for community contributed examples. Check those out too and feel free to contribute your own!

Tip

Run the examples directly from the terminal!

go run github.com/tinne26/kage-desk/examples/learn/{example-folder-name}@latest
go run github.com/tinne26/kage-desk/examples/learn/filled-circle@latest

Here we go!

At this point, I feel it's important to highlight that many fancy effects can also be achieved without shaders. Keep this in mind and avoid shader tunnel vision!

  • Hit effect: compress the sprite with regular GeoM transformations.
  • Morphing: saturate both images to white with ColorM transformations, and then scale the first down and the second up at the same center position. You can create "pokemon evolution" effects or other kinds of morphs between two sprites.
  • Skews and transitions: you can use GeoM to skew images, combine color blending operators, masks and other tricks to create screen transitions and all kinds of animated effects.
  • Alter states: it's easy to create flashes of different colors on characters to represent alter states, like poison, paralysis and others. Often you can add custom small animations to make these effects even much better.
  • Manual effects with game art: outlines, glows, glitches and others can be done directly with art and animations. If you need a cool effect only in one specific situation, sometimes making the art for it might be easier than coding the shader.