yum-archive/SoggyShaders

Old Unity shaders.

git clone https://git.yummers.dev/yum-archive/SoggyShaders

yumUpdate READMEcc99295

master
2.6 KiB81 linesraw

Soggy Shaders

A collection of shaders by yum_food.

MIT licensed: feel free to modify, redistribute, and sell!

To use, clone this repo somewhere inside your Unity assets folder. Then assign the shader you want (like yum_food/parallax) to a material.

Please ask setup questions on the discord.

Grass (yum_food/grass)

Grass demo

A simple geometry shader that repeats a tile of grass 16 times and uses a noise texture to apply a wind effect on the geometry.

Right now only the noise texture is configurable.

Measured @ ~3.0 ms per frame at 4k

TODO: add a mask to enable controlling where grass spawns.

See Shaders/grass/grass_10m_tile.prefab.

Parallax (yum_food/parallax)

Parallax demo

A simple parallax shader with three parallax planes. Each plane can be textured with PBR textures: base color, normal, metallic, and roughness. The size, depth, and emission strength of each plane is configurable.

In these demos, I have the shader on a quad.

Full demo video here.

Displacement (yum_food/displacement)

Displacement demo

A simple displacement shader.

  • Displacement height is specified with a texture.
  • Height texture can be translated at configurable X/Y speeds, giving a flowy effect.
  • Height can be masked to concentrate height mapping into specific areas.
  • A built-in center-out effect is available.
  • Basic physically-based shading is implemented (albedo with alpha, normal, roughness, metallic, cubemap).

In these demos, I have the shader on a 100x100 plane.

Full demo video here.

Avatar cloning (yum_food/avatar_clone)

Avatar cloning demo

A cloning system using a geometry shader.

  • Same features as the displacement shader.
  • Spawn up to 4 clones at controllable x/y/z offsets (in meters).
  • Clones spawn on the left or right side, in alternating order.

To use it in game:

  • Assign the shader to all material slots you want to clone.
  • Assign textures.
  • Create 4 animations:
    • Set number of clones to 0.
    • Set number of clones to 4.
    • Set clone X offset to 0.
    • Set clone X offset to 1.
  • Create 2 float params:
    • Clone_Count: controls number of clones.
    • Clone_dx: controls each clone's X axis offset.
  • Create 2 layers in your FX layer:
    • One uses Clone_Count to blend between 0 and 4 clones.
    • One uses Clone_dx to blend between 0 and 1 x offset.
  • Create two radial puppet controls, one for Clone_Count, and one for Clone_dx.
1# Soggy Shaders
2
3A collection of shaders by yum\_food.
4
5MIT licensed: feel free to modify, redistribute, and sell!
6
7To use, clone this repo somewhere inside your Unity assets folder.
8Then assign the shader you want (like yum\_food/parallax) to a material.
9
10Please ask setup questions [on the discord](https://discord.gg/YWmCvbCRyn).
11
12## Grass (`yum_food/grass`)
13
14![Grass demo](Demos/grass_demo.PNG)
15
16A simple geometry shader that repeats a tile of grass 16 times and uses a noise texture to apply a wind effect on the geometry.
17
18Right now only the noise texture is configurable.
19
20Measured @ ~3.0 ms per frame at 4k
21
22TODO: add a mask to enable controlling where grass spawns.
23
24See `Shaders/grass/grass_10m_tile.prefab`.
25
26## Parallax (`yum_food/parallax`)
27
28![Parallax demo](Demos/parallax_demo.gif)
29
30A simple parallax shader with three parallax planes. Each plane can be textured with PBR textures: base color, normal, metallic, and roughness. The size, depth,
31and emission strength of each plane is configurable.
32
33In these demos, I have the shader on a quad.
34
35Full demo video [here](https://youtu.be/WvPdqxmrZzI).
36
37## Displacement (`yum_food/displacement`)
38
39![Displacement demo](Demos/displacement_demo.gif)
40
41A simple displacement shader.
42
43* Displacement height is specified with a texture.
44* Height texture can be translated at configurable X/Y speeds, giving a
45  flowy effect.
46* Height can be masked to concentrate height mapping into specific areas.
47* A built-in center-out effect is available.
48* Basic physically-based shading is implemented (albedo with alpha, normal,
49  roughness, metallic, cubemap).
50
51In these demos, I have the shader on a 100x100 plane.
52
53Full demo video [here](https://youtu.be/Giui4aCjtI0).
54
55## Avatar cloning (`yum_food/avatar_clone`)
56
57![Avatar cloning demo](Demos/av_clone_demo.gif)
58
59A cloning system using a geometry shader.
60
61* Same features as the displacement shader.
62* Spawn up to 4 clones at controllable x/y/z offsets (in meters).
63* Clones spawn on the left or right side, in alternating order.
64
65To use it in game:
66* Assign the shader to all material slots you want to clone.
67* Assign textures.
68* Create 4 animations:
69  * Set number of clones to 0.
70  * Set number of clones to 4.
71  * Set clone X offset to 0.
72  * Set clone X offset to 1.
73* Create 2 float params:
74  * `Clone_Count`: controls number of clones.
75  * `Clone_dx`: controls each clone's X axis offset.
76* Create 2 layers in your FX layer:
77  * One uses `Clone_Count` to blend between 0 and 4 clones.
78  * One uses `Clone_dx` to blend between 0 and 1 x offset.
79* Create two radial puppet controls, one for `Clone_Count`, and one for
80  `Clone_dx`.
81