Jump to content
GreenSock

Search In
  • More options...
Find results that contain...
Find results in...
JFP

Addressing a variable with TextPlugin

Recommended Posts

Alright well it needs tweaking, wouldnt recommend this on mobile right now cuz theres too much goin on for smoothness unless your phone is superpowerful I guess, but bam! Woohoo :)

https://www.jopl.de/underConstruction/4d.html

Some garbage collection issues maybe, or just too much going on for browsers runtime to handle when the text gets too long, probably tweak some 3d parameters or take them out completely, or just generally make it leaner it but it works! Chrome runs it smoothest on desktop.

 

 

Ohoho.. and it crashed my Chrome after about ten minutes. Those godray shaders and the fact that theres bevels on the text, I can give it less curvature and a lot of those little blue ball flying thingies and other stuff can still be reduced in complexity for smoother performance. Thanks a lot for your help!

p.s. I referr to you as "the dudes from greensock" this file doesnt mean anything and is intended purely to make itself happen. No other reason. This is just the first things that came into my head. If you find it uncool then I can change it. Whatever. I ...correct me if Im wrong but isnt it kind of a big deal that you guys can give three.js a timeline? Opens up whole other ways of using three in my mind. I don't think it had that capacity before. Least I never saw it, but Ive been totally out of the loop for a long time.

Link to comment
Share on other sites

Nice! It ran fine on my phone, doing around 110 fps until the text changed, then it would drop to around 60 fps.

 

I'm guessing re-creating the text geometry probably has something to do with it. This guy suggest SDF rendering.

https://discourse.threejs.org/t/what-is-the-performant-way-to-update-text-in-textgeometry/17437/3

 

2 hours ago, JFP said:

Whatever. I ...correct me if Im wrong but isnt it kind of a big deal that you guys can give three.js a timeline?

 

Of course! A lot of people think GSAP is for html, but it can used with pretty much any library out there. Check out our showcase page. There's lots of different sites that combine gsap with three.js.

 

https://greensock.com/showcase/

 

 

Link to comment
Share on other sites

Cool I'll check that out!

Question, could I technically write a function into any gsap timeline item, a function that manipulates the values of the godrays over time, nested in that timeline until the next timeline item gets called and I can manipulate them back to what they were before?

Like I dunno, animate a change of the colors of the sun and the godrays to different values and then back again?

Link to comment
Share on other sites

15 hours ago, JFP said:

Question, could I technically write a function into any gsap timeline item, a function that manipulates the values of the godrays over time, nested in that timeline until the next timeline item gets called and I can manipulate them back to what they were before?

 

Absolutely! Some things are easier to animate in three.js, and you don't even need a function really, like....

 

gsap.timeline()
  .to(mesh.position, {
    x: 100,
    y: 20,
    z: 10,
    duration: 1
  })

 

The text was obviously a little more involved as there is no easy to swap out the text value, and you had to call those create/refreshText functions.

 

 

  • Like 2
Link to comment
Share on other sites

Yeah that works great, thanks a ton. Here's what happened with that help. Probably not good on mobile - freezes my browser up there. But desktop is fine.

 

https://www.jopl.de/underConstruction/11b.html

 

Next I'll try to figure out how to make this kind of thing interactive so you can grab stuff and spin it. I should add whats slowing it down is most probably my clumsy use of three's post processing, not gsap.

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×