Page 1 of 1

Random color texture change during time

Posted: Sat May 04, 2024 1:40 pm
by HHbomb
Hi,
I wanted to make some variations of my cars color with Random color texture and a gradient texture set to constant, but when the cars move, their color change during animation.... ( I use tyflow to animate the cars )
Any idea ?

I joined a sample file. I can see the instances get their color from a grid.

Re: Random color texture change during time

Posted: Tue May 07, 2024 10:31 am
by neonZorglub
HHbomb wrote:Hi,
I wanted to make some variations of my cars color with Random color texture and a gradient texture set to constant, but when the cars move, their color change during animation.... ( I use tyflow to animate the cars )
Any idea ?

I joined a sample file. I can see the instances get their color from a grid.
Hi HHbomb,

The Random color texture is based on the index and number of instances of group of instances. When the first particle disappear, that re-organize the group, and change some or all of the indexes ..
So that's not very usable in your case.

TyFlow particles can have a Birth ID, that won't change during the animation.
We can use those as Octane Instance ID, from the Render setup / Support / TyFlow :
Set TyFlow particle IDs as Birth Unique ID.
tyFlow_BirthID.png
Then, instead of the Random color texture, you need to use an OSL texture that will use the Octane Instance ID as a random generator
RandomFromInstanceID.png
RandomFromInstanceID.png (7.58 KiB) Viewed 1716 times
RandomFromInstanceID2.png
RandomFromInstanceID2.png (7.57 KiB) Viewed 1716 times
Here is your updated sample, with the osl file InstanceIDAsRandom01.osl
pb2.zip
(115.6 KiB) Downloaded 60 times
I hope that helps, and will work with your scene.
Thanks

Re: Random color texture change during time

Posted: Tue May 07, 2024 1:02 pm
by HHbomb
Hi NZ !
Thank you very much to take time to make such an answer ! I think it'll be helpfull for a lot of people !
OSL is really powerfull but it is an another language.... :cry:

Another question :
We can change Tyflow particle IDs option for all tyflows of the scene ?
Could it be possible to make this option per tyflow object basis ?
So we can drive particle Ids differently by tyflow objects.

Thanks again ! :mrgreen:

Re: Random color texture change during time

Posted: Wed May 08, 2024 11:10 pm
by neonZorglub
HHbomb wrote:Hi NZ !
Thank you very much to take time to make such an answer ! I think it'll be helpfull for a lot of people !
OSL is really powerfull but it is an another language.... :cry:

Another question :
We can change Tyflow particle IDs option for all tyflows of the scene ?
Could it be possible to make this option per tyflow object basis ?
So we can drive particle Ids differently by tyflow objects.

Thanks again ! :mrgreen:
Ho right, I should have mentioned this : this can be set per tyflow object:
Just add a Octane Geometry Properties modifier, and there are the same options in the TyFlow rollup..
This will override the global settings from Render settings / Support / tyFlow ..

I picked up the OSL from a previous case, I think from the Texture Selector ;) .. I'll try to add several such useful OSL in a preset list..

Thanks

Re: Random color texture change during time

Posted: Fri May 10, 2024 3:24 pm
by HHbomb
Hi NZ ! Thanks for all these clarifications ! :-)