Jump to content
Sign in to follow this  
neokovago

Texture looping in vex

Recommended Posts

Hello magicians!

I'm doing a project where I have to loop textures on multiple goes. Basically a sprite randomization with textures, but I can not figure out a way how to loop the texture sequence like padzero does. I have to do it in VOP or vex, since the shader expects a specific filename as a map on the geo. 

Sadly, I can not upload a scene file, but hopefully my problem is understandable. Thanks for reading it. Cheers

Share this post


Link to post
Share on other sites

Probably have a look at the modulo and sprintf functions/vops

 

modulo is useful for looping time like: $F % 3 give you 1, 2, 3, 1, 2, 3, 1, 2, 3.... instead of the straight count.  So in vex just do @Frame%3 or in vop there is a modulo node.

sprintf allows for string formatting kind of C style: sprintf('%04d', @Frame) is like padzero(4, $F) expression.  In vop there's the print node that allows similar string formatting.

  • Like 2

Share this post


Link to post
Share on other sites
1 minute ago, jkunz07 said:

Probably have a look at the modulo and sprintf functions/vops

 

modulo is useful for looping time like: $F % 3 give you 1, 2, 3, 1, 2, 3, 1, 2, 3.... instead of the straight count.  So in vex just do @Frame%3 or in vop there is a modulo node.

sprintf allows for string formatting kind of C style: sprintf('%04d', @Frame) is like padzero(4, $F) expression.  In vop there's the print node that allows similar string formatting.

thank you! just what i needed. so simple (as always). thanks again!

Share this post


Link to post
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
Sign in to follow this  

×