Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  Change UV anchor runtime
#1
Is this possible?

I want to fake a rope paying extending like a endless conveyor belt. 
Alternatively I would use two cursors to add in one end and delete in the other, but i guess it would have higher performance to not simulate particles at all and just change the uv anchor, however doing "renderer.uvAnchor = renderer.uvAnchor - speed * Time.deltaTime" does not work at runtime or in executeineditormode.

(19-11-2019, 01:15 PM)TheMunk Wrote: Is this possible?

I want to fake a rope paying extending like a endless conveyor belt. 
Alternatively I would use two cursors to add in one end and delete in the other, but i guess it would have higher performance to not simulate particles at all and just change the uv anchor, however doing "renderer.uvAnchor = renderer.uvAnchor - speed * Time.deltaTime" does not work at runtime or in executeineditormode.

Seems like calling UpdateRenderer() with null paramters works fine. Is this inteded?

EDIT: It doesn't work when building to Oculus quest. I can't figure out why...
Reply
#2
(19-11-2019, 01:15 PM)TheMunk Wrote: Is this possible?

I want to fake a rope paying extending like a endless conveyor belt. 
Alternatively I would use two cursors to add in one end and delete in the other, but i guess it would have higher performance to not simulate particles at all and just change the uv anchor, however doing "renderer.uvAnchor = renderer.uvAnchor - speed * Time.deltaTime" does not work at runtime or in executeineditormode.


Seems like calling UpdateRenderer() with null paramters works fine. Is this inteded?

EDIT: It doesn't work when building to Oculus quest. I can't figure out why...

Hi,

Never tried building to Quest (I don't own one), so I can't say for sure. Tried in Rift and worked, but they're completely different platforms. Only Windows, macOS, iOS, Android and Linux are supported.

Regarding the uvAnchor: why not doing the same thing (uv offsetting) but in your shader? much simpler and a lot cheaper, since you don't need to rebuild the mesh only to change texture coordinates.
Reply
#3
(19-11-2019, 04:13 PM)josemendez Wrote: Regarding the uvAnchor: why not doing the same thing (uv offsetting) but in your shader? much simpler and a lot cheaper, since you don't need to rebuild the mesh only to change texture coordinates.

Damn what a brain fart - thank you!

What I meant regarding the Quest was just that the updateRenderer method did not work at runtime. Quest runs on Android so everything else seems to work fine.
Reply