My favorites
▼
|
Sign in
mrdoob
Mr.doob's open source stuff
Project Home
Downloads
Wiki
Issues
Source
Checkout
Browse
Changes
Source path:
svn
/
trunk
/
lab
/
effects
/
shaders
/
plasma
/
dev
/
assets
/
plasma.pbk
r236
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
<languageVersion : 1.0;>
kernel PlasmaEffect
< namespace : "com.mrdoob.shaders";
vendor : "Mr.doob";
version : 1;
description : "Good old plasma effect";
>
{
output pixel4 dst;
#if !AIF_FLASH_TARGET
parameter float2 size
<
minValue:float2(0,0);
maxValue:float2(1024,1024);
defaultValue:float2(1024, 512);
>;
#endif
parameter float2 center
<
minValue:float2(0,0);
maxValue:float2(1024,1024);
defaultValue:float2(512,256);
>;
parameter float distort
<
minValue:float(0);
maxValue:float(0.1);
defaultValue:float(0.0);
>;
parameter float2 offset
<
minValue:float2(-100,-100);
maxValue:float2(100,100);
defaultValue:float2(0,0);
>;
parameter float3 color_offset
<
minValue:float3(-5,-5,-5);
maxValue:float3(5,5,5);
defaultValue:float3(0,0,0);
>;
parameter float2 wave
<
minValue:float2(0,0);
maxValue:float2(0.1,0.1);
defaultValue:float2(0.05,0.05);
>;
#if !AIF_FLASH_TARGET
region generated()
{
return region(float4(0, 0, size.x, size.y));
}
#endif
void evaluatePixel()
{
float2 pos = outCoord();
float2 dist = pos - center;
float distance = sqrt((dist.x * dist.x) + (dist.y * dist.y)) * distort;
float color = cos((offset.x + pos.x) * wave.x) + sin((offset.y + pos.y) * wave.y) + sin(distance) + cos(distance);
dst = pixel4(color + color_offset.x, color + color_offset.y, color + color_offset.z, 1.0);
}
}
Show details
Hide details
Change log
r170
by i...@mrdoob.com on Apr 18, 2009
Diff
@lab added shader effects
Go to:
/trunk/lab
/trunk/lab/effects
/trunk/lab/effects/shaders
...fects/shaders/plane_deformations
...haders/plane_deformations/deploy
...e_deformations/deploy/Hypno.html
...ne_deformations/deploy/Hypno.swf
..._deformations/deploy/Planes.html
...e_deformations/deploy/Planes.swf
...ne_deformations/deploy/Rays.html
...ane_deformations/deploy/Rays.swf
...e_deformations/deploy/Rays2.html
...ne_deformations/deploy/Rays2.swf
..._deformations/deploy/Sphere.html
...e_deformations/deploy/Sphere.swf
...ne_deformations/deploy/Star.html
...ane_deformations/deploy/Star.swf
..._deformations/deploy/Tunnel.html
...e_deformations/deploy/Tunnel.swf
...deformations/deploy/Tunnel2.html
..._deformations/deploy/Tunnel2.swf
...deformations/deploy/Tunnel3.html
..._deformations/deploy/Tunnel3.swf
...deformations/deploy/Tunnel4.html
..._deformations/deploy/Tunnel4.swf
..._deformations/deploy/Vortex.html
...e_deformations/deploy/Vortex.swf
...ne_deformations/deploy/Wave.html
...ane_deformations/deploy/Wave.swf
...lane_deformations/deploy/shaders
...mations/deploy/shaders/hypno.pbj
...mations/deploy/shaders/hypno.pbk
...ations/deploy/shaders/planes.pbj
...ations/deploy/shaders/planes.pbk
...rmations/deploy/shaders/rays.pbj
...rmations/deploy/shaders/rays.pbk
...mations/deploy/shaders/rays2.pbj
...mations/deploy/shaders/rays2.pbk
...ations/deploy/shaders/sphere.pbj
...ations/deploy/shaders/sphere.pbk
...rmations/deploy/shaders/star.pbj
...rmations/deploy/shaders/star.pbk
...ations/deploy/shaders/tunnel.pbj
...ations/deploy/shaders/tunnel.pbk
...tions/deploy/shaders/tunnel2.pbj
...tions/deploy/shaders/tunnel2.pbk
...tions/deploy/shaders/tunnel3.pbj
...tions/deploy/shaders/tunnel3.pbk
...tions/deploy/shaders/tunnel4.pbj
...tions/deploy/shaders/tunnel4.pbk
Project members,
sign in
to write a code review
Older revisions
All revisions of this file
File info
Size: 1765 bytes, 78 lines
View raw file
Powered by
Google Project Hosting