Random color texture change during time

3D Studio Max Plugin (Export Script Plugins developed by [gk] and KilaD; Integrated Plugin developed by Karba)
Forum rules
Please post only in English in this subforum. For alternate language discussion please go here http://render.otoy.com/forum/viewforum.php?f=18
Post Reply
HHbomb
Licensed Customer
Posts: 1377
Joined: Wed Jun 30, 2010 8:45 pm
Contact:

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.
Attachments
pb.zip
(111.43 KiB) Downloaded 54 times
YOKO Studio | win 10 64 | i7 5930K GTX 3090 | 3dsmax 2022.3 |
neonZorglub
OctaneRender Team
Posts: 1017
Joined: Sun Jul 31, 2016 10:08 pm

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 1708 times
RandomFromInstanceID2.png
RandomFromInstanceID2.png (7.57 KiB) Viewed 1708 times
Here is your updated sample, with the osl file InstanceIDAsRandom01.osl
pb2.zip
(115.6 KiB) Downloaded 59 times
I hope that helps, and will work with your scene.
Thanks
HHbomb
Licensed Customer
Posts: 1377
Joined: Wed Jun 30, 2010 8:45 pm
Contact:

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:
YOKO Studio | win 10 64 | i7 5930K GTX 3090 | 3dsmax 2022.3 |
neonZorglub
OctaneRender Team
Posts: 1017
Joined: Sun Jul 31, 2016 10:08 pm

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
HHbomb
Licensed Customer
Posts: 1377
Joined: Wed Jun 30, 2010 8:45 pm
Contact:

Hi NZ ! Thanks for all these clarifications ! :-)
YOKO Studio | win 10 64 | i7 5930K GTX 3090 | 3dsmax 2022.3 |
Post Reply

Return to “Autodesk 3Ds Max”