New Instance Randomizer Shader Plugin

2»

Comments

  • PhilWPhilW Posts: 5,145
    edited May 2014

    laurenwbr said:
    PhilW said:

    On Silene's original issue, which I think was allocating different skin colours to different Instances, you could use the Mixer operator with a different skin texture in each "side" of the mixer and use the Instance Randomizer as the control. You would need to use "frozen" figures as above, but that will give you skin variations between the two sets of skins.

    No need to stop at two! If you need a lot of such variations (with skin or anything else), you can create a tree structure - use a top level Mixer channel to mix between two sides, each of which contain its own Mixer channel, with three Instance Randomizers controlling each of the mix amounts. So if you have four skin textures - call them A, B, C and D - then you have two lower level Mixers, one between A and B, and one between C and D, and then the top level mixer controls the mix between A/B and C/D. Using Instance Randomizers set to Value mode will give you smooth tonal blends, a different one randomly selected on each instance, or set to Boolean will select one OR the other.

    As I said - a very flexible tool!

    I have a bit of breathing space now on this newer book cover, so will look into it.

    Phil, do you cover this in your IS tuts? Can you point me to the chapter/disc/number so I can dive in there quicker?

    Thanks for the help and good on you and Sparrowhawke for continuing to develop new tools for Carrarians, newbies and advanced pros alike! More please!

    xx :) Silene

    Hmmm, I covered some basic use of operators in "Shader Texture Types" within Chapter 7 of the Learning Carrara set, but didn't go into great detail about nesting them (although it is mentioned). There is more on using shaders in more complex ways in the Advanced Carrara set, section 0502 "Using Operators for Complex Shaders" is probably the most relevant.

    I have included a screen shot of nested Mixers using the Instance Randomizer as the Blender control in each case. So one Mixer will pick shades from between Red and Blue, the other between Yellow and Green, and then the top level will mix between these two. It will be important to set the seed in each to a different value (any value, as long as they are different). If they are the same then you will not get the range of results that you would expect as each will be producing the same sequence for each element.

    I hope that makes it clear - do feel free to experiment!

    Nested_Mixers.jpg
    1213 x 491 - 143K
    Post edited by PhilW on
  • wetcircuitwetcircuit Posts: 0
    edited December 1969

    PhilW said:
    In the meantime, it is possible to use by "freezing" the figure, that is turning it into a static object rather than a figure (so make sure you are finished posing!). The way I would do that is to Export to OBJ, making sure you select Export with Morphs and Skinning to preserve the morphs and pose you have set up, and then re-Import that. You can now apply the Instance Randomizer to that.

    I think you would need to use a figure with a single UV map, Like the original Posettte or Mike/Vicky2, otherwise you would have head and body mismatch due to 2 (or more) instances of the shader?

    I'm also curious what happens to the shader in an animation.... And what happens when more instances of the shader are introduced to the scene - does the value change every frame? or calculate once?

  • SileneUKSileneUK Posts: 1,975
    edited December 1969

    PhilW said:

    Hmmm, I covered some basic use of operators in "Shader Texture Types" within Chapter 7 of the Learning Carrara set, but didn't go into great detail about nesting them (although it is mentioned). There is more on using shaders in more complex ways in the Advanced Carrara set, section 0502 "Using Operators for Complex Shaders" is probably the most relevant.

    I have included a screen shot of nested Mixers using the Instance Randomizer as the Blender control in each case. So one Mixer will pick shades from between Red and Blue, the other between Yellow and Green, and then the top level will mix between these two. It will be important to set the seed in each to a different value (any value, as long as they are different). If they are the same then you will not get the range of results that you would expect as each will be producing the same sequence for each element.

    I hope that makes it clear - do feel free to experiment!

    I will...thanks very much for the screenshot! xx :) Silene

  • PhilWPhilW Posts: 5,145
    edited December 1969

    Just to add an image that shows the results of the above color Mixing, you can see that each sphere has a random mix of the different starting colors. But you don't need to be limited to plain colors, you can have patterns, texture maps, whatever...

    Nested_Mixers_Result.jpg
    640 x 480 - 20K
  • PhilWPhilW Posts: 5,145
    edited December 1969

    PhilW said:
    In the meantime, it is possible to use by "freezing" the figure, that is turning it into a static object rather than a figure (so make sure you are finished posing!). The way I would do that is to Export to OBJ, making sure you select Export with Morphs and Skinning to preserve the morphs and pose you have set up, and then re-Import that. You can now apply the Instance Randomizer to that.

    I think you would need to use a figure with a single UV map, Like the original Posettte or Mike/Vicky2, otherwise you would have head and body mismatch due to 2 (or more) instances of the shader?

    I'm also curious what happens to the shader in an animation.... And what happens when more instances of the shader are introduced to the scene - does the value change every frame? or calculate once?

    You don't need to have a single UV map, just set the Seed in the Instance Randomizer for each shader domain to the same value, and you will get the same sequence, so face, torso and limbs skin could all match on the same figure, but be different between each figure.

    The shader is attached to the object instance which does not change through the animation, so you won't get weird effects of the shader changing on each frame if that is what you worried about.

  • Design AcrobatDesign Acrobat Posts: 459
    edited December 1969

    Fantastic plug-in that needs more experimentation.

    appears to work with grouping and texture. Shader balls and a plaid texture here using a mixer to get variations.

    Materials, carpet, mixed vegetation come to mind - will have to experiment more

    But the dentist has a drill waiting for me - laters :(

    plaid_texture.jpg
    640 x 480 - 40K
  • wetcircuitwetcircuit Posts: 0
    edited December 1969

    PhilW said:
    PhilW said:
    In the meantime, it is possible to use by "freezing" the figure, that is turning it into a static object rather than a figure (so make sure you are finished posing!). The way I would do that is to Export to OBJ, making sure you select Export with Morphs and Skinning to preserve the morphs and pose you have set up, and then re-Import that. You can now apply the Instance Randomizer to that.

    I think you would need to use a figure with a single UV map, Like the original Posettte or Mike/Vicky2, otherwise you would have head and body mismatch due to 2 (or more) instances of the shader?

    The shader is attached to the object instance which does not change through the animation, so you won't get weird effects of the shader changing on each frame if that is what you worried about.
    So if the shader is used twice on the same object (with the same seed) both shaders will return the same value? And if I deliberately want to use the shader twice on the same object (to get variations on trim or whatever) I need to reset the seed because it's based on the object order...? That's pretty cool.

  • PhilWPhilW Posts: 5,145
    edited December 1969

    That's pretty cool.

    I think so!

  • DartanbeckDartanbeck Posts: 21,543
    edited December 1969

    If that doesn't work as expected... I get a feeling that it won't... here is one solution to such things:

    Instead of using a texture map for skin areas, use either the face or torso shader from Indigone's V4 Skin Shader and Lights Kit, which is a procedural shader, anywhere you have skin. In this way, you would be using the same exact shader for the face as the hands, etc., without the need of adhering to UVs.

  • DartanbeckDartanbeck Posts: 21,543
    edited December 1969

    For that matter, any procedural skin shader would work. I mention Indigone's Kit above, just in case you want a good practice example of how to make really nice procedural skin.

  • PhilWPhilW Posts: 5,145
    edited December 1969

    This is a preview of a product I have been working on which uses the Instance Randomizer. The product will include this scene and everything in it.

    Promo1.jpg
    975 x 750 - 202K
  • That Other PersonaThat Other Persona Posts: 381
    edited December 1969

    Just got around to trying this today and it is great! Made a nice forest in no time at all.


    One hiccup: when I set a scene to render over a node, the result was a flickering movie. Has anybody gotten the randomizer to work well on a render node?

  • evilproducerevilproducer Posts: 9,050
    edited December 1969

    Just got around to trying this today and it is great! Made a nice forest in no time at all.


    One hiccup: when I set a scene to render over a node, the result was a flickering movie. Has anybody gotten the randomizer to work well on a render node?

    I don't know about this one, but there are other Carrara shader functions that don't work as expected with nodes.

  • That Other PersonaThat Other Persona Posts: 381
    edited December 1969

    I don't know about this one, but there are other Carrara shader functions that don't work as expected with nodes.

    OK. I haven't run into any until now.

  • evilproducerevilproducer Posts: 9,050
    edited December 1969

    I don't know about this one, but there are other Carrara shader functions that don't work as expected with nodes.

    OK. I haven't run into any until now.


    The ones I had problems with were the Squares shader that I used to generate randomly lit windows. Here are two examples. The first is rendered using network rendering, and the second is rendered with no network rendering as a test to confirm it was a network node bug.

    I used C7.2 Pro for both renders.
    Notice the flickering. It's actually the buckets or tiles rendered by different machines in the frames.
    http://www.youtube.com/watch?v=6cFfLocjHQU

    Notice in this version, there is no flickering at all.
    http://www.youtube.com/watch?v=Ggy0DCYlDEg

  • Sparrowhawke3DSparrowhawke3D Posts: 102
    edited December 1969

    All plugins need to be installed into the Carrara\Extensions\ folder on any render nodes as well as your host or main PC. When a plugin is not present on the node it will return a black value.

  • evilproducerevilproducer Posts: 9,050
    edited December 1969

    All plugins need to be installed into the Carrara\Extensions\ folder on any render nodes as well as your host or main PC. When a plugin is not present on the node it will return a black value.

    Oh, smack! That hadn't occurred to me that that was the underlying issue. I got too hung up on the randomization bug I had run into, to see the real issue. Good call Sparrowhawke!

    P.S. Nice to see you post by the way. I know you're a busy guy, but when you get the time, it would be great to see more of you here. The feel of the place is much improved from the way it used to be.

  • That Other PersonaThat Other Persona Posts: 381
    edited December 1969

    All plugins need to be installed into the Carrara\Extensions\ folder on any render nodes as well as your host or main PC. When a plugin is not present on the node it will return a black value.


    Thanks! Do the two machines need to have similar paths for the plugins? I have several of your plugins on my main machine, but only installed the randomizer on the node to test it. So one machine has a folder and the other just has the plugin drop in with everything else.

  • Sparrowhawke3DSparrowhawke3D Posts: 102
    edited December 1969

    It won't matter which folder you put the plugin into so long as Carrara can find it. Carrara will look in the ..\Extensions\.. folder and then into any sub-folders for plugins.

    I'd advise to put my plugins into their own sub-folder and also to make sure there is only one copy of the three plugin files (for each different plugin) under your \Extensions\.. folder hierarchy, in case you need to update them.

Sign In or Register to comment.