shader integers
This commit is contained in:
parent
03e407c1eb
commit
039d6b2540
13 changed files with 17 additions and 18 deletions
|
@ -4,7 +4,7 @@
|
|||
{
|
||||
[NoScaleOffset]
|
||||
_LastFrame ("Render texture", 2D) = "white" {}
|
||||
_Rule("Rule", Int) = 110
|
||||
_Rule("Rule", Integer) = 110
|
||||
}
|
||||
SubShader
|
||||
{
|
||||
|
@ -48,7 +48,7 @@
|
|||
{
|
||||
const uint x = (p.x + dx) % WIDTH;
|
||||
const uint y = (p.y + dy) % WIDTH;
|
||||
return _LastFrame[uint2(x, y)].b > 0;
|
||||
return _LastFrame[uint2(x, y)].b > 0.1;
|
||||
}
|
||||
|
||||
float3 frag (v2f i) : SV_Target
|
||||
|
@ -60,13 +60,12 @@
|
|||
return state(p, 0, 0);
|
||||
}
|
||||
int permutation =
|
||||
(state(p, -1, 1)<<2) |
|
||||
(state(p, 0, 1)<<1) |
|
||||
state(p, 1, 1);
|
||||
(state(p, -1, 1) << 2) |
|
||||
(state(p, 0, 1) << 1) |
|
||||
state(p, 1, 1);
|
||||
|
||||
float next = (_Rule >> permutation) & 1;
|
||||
return float3(i.uv * next, next * (_SinTime.y * 0.4 + 0.6));
|
||||
// return next;
|
||||
}
|
||||
ENDCG
|
||||
}
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
{
|
||||
_LastFrame ("Texture", 2D) = "white" {}
|
||||
[Toggle]
|
||||
_Running ("Running", Int) = 0
|
||||
_Running ("Running", Integer) = 0
|
||||
}
|
||||
SubShader
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue