Random Color Texture, per Element
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
Please post only in English in this subforum. For alternate language discussion please go here http://render.otoy.com/forum/viewforum.php?f=18
Is it possible to randomly tint an element and not the whole object? At the moment I have to detach all elements to tint it randomly.
PURE3D Visualisierungen
Sys: Intel Core i9-12900K, 128GB RAM, 2x 4090 RTX, Windows 11 Pro x64, 3ds Max 2024.2
Sys: Intel Core i9-12900K, 128GB RAM, 2x 4090 RTX, Windows 11 Pro x64, 3ds Max 2024.2
You can use "Material by element" modifier. But you need to make a multimaterial with lot of ID.
You can user a data channel modifier to assign a random vertex color for each element.
+1000 if otoy can make a random color by element !!!!!
You can user a data channel modifier to assign a random vertex color for each element.
+1000 if otoy can make a random color by element !!!!!

YOKO Studio | win 10 64 | i7 5930K GTX 3090 | 3dsmax 2022.3 |
Yes, because that's why I ask. 
I think Corona/Vray supports it. Sometimes the small things are the handy ones.

I think Corona/Vray supports it. Sometimes the small things are the handy ones.
PURE3D Visualisierungen
Sys: Intel Core i9-12900K, 128GB RAM, 2x 4090 RTX, Windows 11 Pro x64, 3ds Max 2024.2
Sys: Intel Core i9-12900K, 128GB RAM, 2x 4090 RTX, Windows 11 Pro x64, 3ds Max 2024.2
- paride4331
- Posts: 3804
- Joined: Fri Sep 18, 2015 7:19 am
Hi pavlov,
I'm not sure if you're referring to a multitextures workflow, but try taking a look here:
viewtopic.php?f=27&t=79565&p=411079&hil ... re#p411050
viewtopic.php?f=27&t=81391&p=422757&hil ... or#p422757
viewtopic.php?f=27&t=80663&p=417561&hil ... om#p417561
I'm not sure if you're referring to a multitextures workflow, but try taking a look here:
viewtopic.php?f=27&t=79565&p=411079&hil ... re#p411050
viewtopic.php?f=27&t=81391&p=422757&hil ... or#p422757
viewtopic.php?f=27&t=80663&p=417561&hil ... om#p417561
2 x Evga Titan X Hybrid / 3 x Evga RTX 2070 super Hybrid
Hi Paride,
hard to tell since these are MAX examples but i'll try to explain.
Imagine a city made of many boxes, all part of the same mesh. I want to assign a different texture to each box (different facades) without having to assign, say, 20 random IDs. In Corona and Vray, the Randomizer can work not only on instances (like Octane Randomizer does) but also on individual elements of a single mesh. This means I can randomize 20 textures on each element of that single mesh without assigning different IDs or creating multiple materials—it's just one object with one material using a "Randomizer by Element" that randomly applies one of 20 textures to each box.
This approach is also very useful in many other situations, such as with trees. For example, you can assign 5 different leaf textures to each leaf (element) using a single material on a single mesh.
Hopefully it's clear, let me know if i've to explain better.
Thanks
Paolo
hard to tell since these are MAX examples but i'll try to explain.
Imagine a city made of many boxes, all part of the same mesh. I want to assign a different texture to each box (different facades) without having to assign, say, 20 random IDs. In Corona and Vray, the Randomizer can work not only on instances (like Octane Randomizer does) but also on individual elements of a single mesh. This means I can randomize 20 textures on each element of that single mesh without assigning different IDs or creating multiple materials—it's just one object with one material using a "Randomizer by Element" that randomly applies one of 20 textures to each box.
This approach is also very useful in many other situations, such as with trees. For example, you can assign 5 different leaf textures to each leaf (element) using a single material on a single mesh.
Hopefully it's clear, let me know if i've to explain better.
Thanks
Paolo
I7 960 3.2 GHZ - 6GB ram - GTS 250 display only - Asus GTX 470
PS - some time ago i raised same topic - randomize by element - and someone posted a OSL that could do that.
I wanted to give it another run, but i cannot find it.
Can someone point me to the link ?
thanks
paolo
I wanted to give it another run, but i cannot find it.
Can someone point me to the link ?
thanks
paolo
I7 960 3.2 GHZ - 6GB ram - GTS 250 display only - Asus GTX 470
+10000
YOKO Studio | win 10 64 | i7 5930K GTX 3090 | 3dsmax 2022.3 |
- neonZorglub
- Posts: 1002
- Joined: Sun Jul 31, 2016 10:08 pm
Here is a new OSL texture that select random texture per element.
Generator: PolyConnect
Attribute: Float1
Attribute name: ElementId
The OSL texture rand10Tex_ByElem_obj_uid.osl need to have a Grayscale vertex attribute in the 'Grayscale tex' input.
The Grayscale vertex attribute need to use the same attribute Name as in the geometry modifier : ElementId
Set the Texture count between 1 to 10.
When using multiple instances or copies of the same object, the vertex attribute values will be the same, so the random pattern will also be the same for each instance.
To have random variation on those instances, enable the 'Use Object seed' and / or 'Use InstanceID seed'
'Use Object seed' add randomness from an internal unique ID per object, but those IDs could change as you add/remove objects in the scene.
'Use InstanceID seed' add randomness from the 'User instance ID' that can be set per object in the Octane Object properties dialog.
Those Instance IDs will not change, so the random pattern will be more stable.
Note that you can use the tools in the Octane Object properties dialog to set those User instance IDs for all selected objects. The second OSL (rand20Tex_ByElem_obj_uid.osl) is the same, but with up to 20 textures.
for 3dsMax 2018:
The objects need to have an Octane geometry modifier, with a Vertex Attributes Generator set as follow:Generator: PolyConnect
Attribute: Float1
Attribute name: ElementId
The OSL texture rand10Tex_ByElem_obj_uid.osl need to have a Grayscale vertex attribute in the 'Grayscale tex' input.
The Grayscale vertex attribute need to use the same attribute Name as in the geometry modifier : ElementId
Set the Texture count between 1 to 10.
When using multiple instances or copies of the same object, the vertex attribute values will be the same, so the random pattern will also be the same for each instance.
To have random variation on those instances, enable the 'Use Object seed' and / or 'Use InstanceID seed'
'Use Object seed' add randomness from an internal unique ID per object, but those IDs could change as you add/remove objects in the scene.
'Use InstanceID seed' add randomness from the 'User instance ID' that can be set per object in the Octane Object properties dialog.
Those Instance IDs will not change, so the random pattern will be more stable.
Note that you can use the tools in the Octane Object properties dialog to set those User instance IDs for all selected objects. The second OSL (rand20Tex_ByElem_obj_uid.osl) is the same, but with up to 20 textures.
for 3dsMax 2018: