Hello. Is it possible to aplly a multi texture shader, in a linear order (1st, 2nd, 3rd, ...) to the objects of a linear cloner, just as the mograph shader does? Let's say, like pages in a magazine, one shader for multiple pages with the textures in the right pages in sequence, not randomly. I'm trying to do it with the Switch Shader nome but getting stuck in the index parameter. I've tryed the Range none attached to the index value of the Switch Shader, but no success.
Any help would be appreciated, thank you.
I don't think anything has changed. I made a quick test and seems to be working fine. Can you send me a scene which is not working? Did you try the same in older versions to confirm it's related to R21 and/or Arnold 6?
@Francisco Cunha - Can you get this to work with a simple cube (that has not been made editable)? My magazine pages are made of cubes and not planes, but somehow the shader doesn't work with cubes. Any other object seems to work fine!
Unfortunately this is a current technical limitation, trying to solve this in a future release, yet it's a bit complicated. I guess the only option at the moment is to make the cube editable (make a polygon object).
Or you can use a step effector and read the display color, which is not as straightforward because color transform is involved. See this thread where I posted an example, teste 1 v02.zip.
Clone indexes should be fixed for Cubes in the latest release, C4DtoA 3.0.1.2.
Hi @rachid Hadj Abderrahmane. I'll try your method but it' didn't work. I made all the steps. Any hint? thanks
Hi,
This method of using user_data_int with index as the attribute for assigning unique textures to each clone works perfectly. But as you mentioned there is a limit for 20 inputs in the switch_rgba node. @peter.horvath6V6K3 do you know if there is anyway I can change this or use different nodes to achieve the same result? I have 25 images to assign to 25 clones, how should I proceed to do this, besides creating individual objects from the cloner and manually applying the textures?
Thank you
You can chain switch shaders like this: connect multiple switch shaders to a main switch shader (in your case you need two since you have 25 textures). Divide your index input by 20 and connect it to the main switch shader. This will select which child switch is active. Then modulo your index by 20, and connect it to all child switch shaders. This will select the input of the active switch.
Hi,
Thanks a lot @peter_horvath. This works like an absolute charm. I did the same in the Shader Network and not in the default C4D node space.
There is a slight problem though, for some reason, clone number 23 and 24 register both as 23 and display the same texture - You can check the top-most row of keys on the keyboard in the attached render. One letter is repeated on 2 keys.
I have attached a Shader Network screenshot as well for reference. I'll try to figure out why this is happening but just wanted to let you know.
Thank you for the response again, this was very helpful.
The shader network looks correct. (I assume the textures are properly set in number 23 and 24). Maybe the index coming from the cloner is wrong. You can check if you export the scene to an ASS file and look at the index parameter on the polymesh nodes.
But how to get more than 20? Is that an absolute limit or is there a way to combine switch rgba nodes while still reading clone ID's?
This is thread is very helpful! But now I'm also facing two wrong texture assignments on clone ID 23 and 28. I actually just want to reverse the texture sequence after ID 20 (screenshot attached). any ideas?
It is a precision error in the modulo shader output (2.9999 instead of 3.0 and that results to 2 when converted to an integer). You can overcome that by adding 0.5 to the result.
You might have to de the same with the divide shader output, just in case.
Does this work with scatter objects, as well?
Like if I want to have slight variation in hue or brightness for tree leaves in a scatter?
This thread is about assigning different textures (or shaders) based on the clone index. The scatter object does not set the index. For slight variation I'd recommend using the color_jitter shader, that works with scatter instances too.
Can't find what you're looking for? Ask the community or share your knowledge.