FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
postprocessing/src/effects/DotScreenEffect.js at main · BillyD1/postprocessing · GitHub
BillyD1
/
postprocessing
Public
forked from
pmndrs/postprocessing
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
postprocessing
/
src
/
effects
/
DotScreenEffect.js
Copy path
More file actions
More file actions
Latest commit
History
History
History
51 lines (35 loc) · 1.12 KB
Breadcrumbs
postprocessing
/
src
/
effects
/
DotScreenEffect.js
Copy path
File metadata and controls
51 lines (35 loc) · 1.12 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
import
{
Uniform
,
Vector2
}
from
"three"
;
import
{
BlendFunction
}
from
"./blending/BlendFunction"
;
import
{
Effect
}
from
"./Effect"
;
import
fragmentShader
from
"./glsl/dot-screen/shader.frag"
;
/**
* A dot screen effect.
*/
export
class
DotScreenEffect
extends
Effect
{
/**
* Constructs a new dot screen effect.
*
*
@param
{
Object
} [options] - The options.
*
@param
{
BlendFunction
} [options.blendFunction=BlendFunction.NORMAL] - The blend function of this effect.
*
@param
{
Number
} [options.angle=1.57] - The angle of the dot pattern.
*
@param
{
Number
} [options.scale=1.0] - The scale of the dot pattern.
*/
constructor
(
{
blendFunction
=
BlendFunction
.
NORMAL
,
angle
=
Math
.
PI
*
0.5
,
scale
=
1.0
}
=
{
}
)
{
super
(
"DotScreenEffect"
,
fragmentShader
,
{
blendFunction
,
uniforms
:
new
Map
(
[
[
"angle"
,
new
Uniform
(
new
Vector2
(
)
)
]
,
[
"scale"
,
new
Uniform
(
scale
)
]
]
)
}
)
;
this
.
setAngle
(
angle
)
;
}
/**
* Sets the pattern angle.
*
*
@param
{
Number
} [angle] - The angle of the dot pattern.
*/
setAngle
(
angle
)
{
this
.
uniforms
.
get
(
"angle"
)
.
value
.
set
(
Math
.
sin
(
angle
)
,
Math
.
cos
(
angle
)
)
;
}
}
Back
|
FazBrowse Home
|
New Git URL