►
Description
Presented by Mario Carrillo, Creative Coder, Independent
A demonstration of how to use Three.js to create kinetic typography effects along 3D shapes.
For more from GitHub Universe 2020, visit https://githubuniverse.com
As always, feel free to leave us a comment below and don't forget to subscribe: http://bit.ly/subgithub
Thanks!
Connect with us.
Facebook: http://fb.com/github
Twitter: http://twitter.com/github
LinkedIn: http://linkedin.com/company/github
About GitHub
GitHub is the best place to share code with friends, co-workers, classmates, and complete strangers. Millions of people use GitHub to build amazing things together. For more info, go to http://github.com
A
A
A
There
are
also
several
ways
to
do
it,
but
I
found
the
most
simple
one
just
to
use
a
texture.
In
this
case
it
has
the
word
universe
and
well
sample
it
in
the
on
the
texture.
So
for
that
first,
we'll
need
to
load.
The
texture
here.
Accounts
texture
equals
new.
We
that
texture
loader,
that
load
image
and
in
this
case
I'm
going
to
pass
a
callback
function
just
to
fix
some
weird
line.
Artifact
that
happens
in
this.
In
this
case,
it
says
texture
that
mint.
A
Filter,
okay,
and
instead
of
using
a
mesh
normal
material,
we
have
to
use
a
shader
material
to
move
things
to
it,
yeah
to
modify
the
shape
of
the
torus
geometry.
Did
I
mention
that
this
is
a
torch
geometry
or
a
donut,
and
and
also
change
its
colors.
So
for
that
we
use
a
shader
material
and
pass
the
vertex
shader,
a
fragment,
shader
and
some
uniforms
where
we'll
define
time.
A
Your
texture,
all
right,
also,
let's
enable
the
transparent
flag
because
we're
using
a
png.
Now
we
want
to
make
things
transparent
and
yeah
for
now,
let's
use
three
dot
double
side,
so
it
also
renders
the
inside
of
the
donut
before
jumping
to
the
shaders.
Let's
update
the
time
uniform
perform
that,
u
time
the
value
equals,
the
boiling
point
already
has
a
clock
variable,
so
we
can
get
the
time.
A
A
So
a
shader
is
a
program
that
runs
in
the
gpu
like
blazingly
fast,
and
we
have
two
types
of
shader
we're
interested
for
this.
We
have
a
vertex
shader
that
runs
for
every
vertex
of
a
object
and
and
a
fragment
shader
that
runs
for
every
pixel.
First,
let's
jump
to
the
fragment
shader.
So
we
can
sample
the
texture
on
the
surface.
A
So
for
that
we
do
back.
Four
color
equals
texture
to
the
these
are
built-in
functions
from
glsl
architecture
and
we'll
use
the
texture
coordinates
called
vuv
that
tell
where
to
put
the
image
pixels
on
the
3d
object,
so,
okay,
so
we
do
color
and
yeah.
A
We
can
see
it
right
now
that
it
says
universe
a
bit
weird,
but
we
can
make
it
more
interesting
and
for
that,
let's
repeat
the
texture
with
the
uvs,
so
let's
define
uv
equals
it's
equal
to
the
varying
of
uv
and
uv
here,
and
it's
the
same
for
now,
but
it
starts
to
get
more
interesting
when
we
use
the
function
called
frac,
which
takes
the
fractional
part
of
a
value,
and
it's
perfect
for
repeating
things
through
uv
times
two
for
now
to
see
what
happens:
yeah,
it's
repeating
both
in
the
x
and
the
y
axis.
A
Let's
use
a
variable
instead
call
back
two
repeat:
that's
vector
two
and
let's
do
something
crazy,
like
six:
six
on
the
y,
I'm
sorry
x-axis
and
12
from
the
y-axis
so
heat,
and
we
should
see
a
lot
of
text.
Oh
yeah,
it's
time
to
get
better
now!
Oh
nice!
Now,
let's
add
time
to
it,
and
for
that
we
do
back
to.
I
think
it'll
it'll
look
better
if
we
move
it
like
like
this,
and
for
that
like
this,
and
for
that
we
need
to
pass
time
to
the
y
component
path.
A
Yeah
looking
good,
we
can
accelerate
the
speed
yeah
and
even
make
it
more
interesting
before
jumping
to
the
birthday
shader
to
move
the
shape
that
see
we
can
like
bend
the
text,
and
for
that
I
think
we
should
do.
Maybe
that
x
plus
equals
sine
of
the
y
component,
and
this
looks
yeah.
This
looks
twisted.
A
A
A
So,
let's
jump
to
the
vertex
shader,
like
I
said
earlier,
the
vertex
shader
runs
per
vertex
and
I'm
not
sure
if
it
means
too
much
right
now,
but
imagine
it
like
it
from
each
point
that
makes
the
geometry
whatever
you
pass
here
will
affect
that
point,
and
I
was
thinking
of
maybe
bending
like
some
sort
of
band
or,
like
all
tire
like
it's
too
soft.
A
So
for
that,
let's
do
this.
Let's
call
this
variable
transformed
that
is
equal
to
the
position
and,
let's
use
transform
here,
which
should
affect
nothing
for
now,
but
when
we
do
this
transform
plus
equals
sine
of
position
that
well
transform
this
z
component
is
plus
equals
the
x
for
now
plus
time
what
you
time
yeah!
A
Oh
nice
yeah,
I'm
sorry
to
like
the
result,
so
you
can
imagine
you
can
tweak
whatever
you
want
here
and
we're
just
using
trigonometry
trigonometric
functions
for
now,
but
you
can
see
the
possibilities
if
you
use
like
noise
functions
and
other
crazy
math
stuff
by
itself.
Let's
see
if
we
can
add.
Also,
the
x
component.
A
A
Yeah,
I
think
yeah
it's
looking
good
now
in
my
opinion,
so
so
yeah.
I
think
this
is
it
for
now.
You
can
imagine
that
you
you
can
even
just
using
one
texture,
can
get
you
like
pretty
far
in
terms
of
visual
or
aesthetics.
Imagine
if
you
could
like
replicate
this
instead
of
using
a
taurus,
you
could
use
a
sphere
geometry,
a
cone
box
geometry
and
and
having
like
thousands
of
box
of
geometries
or
instancing
them
could
get
you
like
a
pretty
interesting
result
and
well.
This
is
just
like
a
overview.
A
I
I
have
another
tutorial
rock,
where
I
explain
a
bit
how
you
can
use
instead
of
just
a
fixed
texture
using
render
targets
which
lets
you,
like
dynamically
change
text.
Imagine
it
as
if
you
have
a
scene
where
you
have
text
and
that
text
you
pasted
on
the
geometry,
but
that's
another
kind
of
soup.
A
So
that's
it!
I
hope
you
like
it.
If
you
have
any
questions,
let
me
know
and
see
you
guys
in
the
next
one
bye.