How do you "lock" Random to a object in Shader Mixer?

Oom FooyatOom Fooyat Posts: 0
edited July 2012 in Daz Studio Discussion

I was playing around with a cell shader when I got the bright(?) idea to add Pen's Fur Shader, I found that by inserting a Compare/Less Than- or Bianry Operation/Smooth Step-brick after the Random-brick I can control the density of the fur. Problem is that the fur will look denser the closer it is to the camera. The two figures below has identical shaders.
I can't figure out how to "lock" the output of the Random-brick to the object so that the fur always has the same density.
Any suggestions welcome?
Cheers! Oom

fur2.jpg
810 x 682 - 73K
Fur1.jpg
600 x 600 - 249K
Post edited by Oom Fooyat on

Comments

  • Richard HaseltineRichard Haseltine Posts: 100,804
    edited December 1969

    How about using a Ray Depth (or was it an option in the Variable brick?) to get the distance to P and then using that to modulate the density?

  • Oom FooyatOom Fooyat Posts: 0
    edited December 1969

    How about using a Ray Depth (or was it an option in the Variable brick?) to get the distance to P and then using that to modulate the density?

    That sounds a lot like the Depth-brick. On the left side the shader has a Depth component added and it is a clear improvement.
    If I can make a usable control out of it is another question. I had to tweak the depth value a bit to get it to work.
    I'm not even sure what I'm doing, The documentation is a bit short on the details, like what kind of unit the depth is given in.

    This is a good start but I still have not "locked" the random value to the object it is now only less dependent on space.

    Cheers! Oom

    fur3.jpg
    600 x 400 - 204K
  • Richard HaseltineRichard Haseltine Posts: 100,804
    edited December 1969

    DS units are generally cm, though that doesn't guarantee 3Delight units are.

  • Oom FooyatOom Fooyat Posts: 0
    edited July 2012

    Why do Random behave that way anyhow?


    Random

    Brickyard : Functions > Textures

    Supplies a random value of the selected type for each individual element (depending on the shader network) rendered.




    "element" indicates that Random is called on by the camera, don't it? A simple test to confirm that: Two identical spheres at different distance from the camera with Random generated surfase. The surface will not change with the perspective. One render with Shading Rate 2.0 the other with 0.1


    Looks like it will be impossible to do what I want with Random as a noise source. Other possible bricks for noise like Clouds, Granite and Fractal Sum tends to make clusters, not pure white noise. Hmmm.....


    Cheers! Oom
    r3.jpg
    400 x 400 - 67K
    r2.jpg
    400 x 400 - 78K
    Post edited by Oom Fooyat on
  • Richard HaseltineRichard Haseltine Posts: 100,804
    edited December 1969

    I think Random gives a new value for each sample - so a more distant item will have fewer samples, in proportion to its visual size. That's why upping the shading rate increases the density of the "fur".

  • Oom FooyatOom Fooyat Posts: 0
    edited December 1969

    I agree and I think I found a better way to illustrate it.
    This is six renders of a plane at 60 degrees angle to the camera. I have plugged six bricks from the Texture group directly into the Surface brick. I rotated the camera between the renders Can you tell what side or corner is closest to the camera in the renders?
    The bricks are Fractal Sum, Spots, Checked, Granite, Clouds and Random.
    The Cloud render might a bit hard to tell but on the Random I give you 1-in-8 to get it right.

    So the Random brick is not really a "texture" as it is projected on the camera not the surface.

    Time for a visit to the Mantis and make a request I think.

    Cheers! Oom

    r4.jpg
    600 x 900 - 330K
  • Oom FooyatOom Fooyat Posts: 0
    edited December 1969

    Said and done!

    Stand Up For True Randomness In Your Renders!
    PLEASE SUPPORT THIS REQUEST (#47395) !
    Do It Today For Better Fur In The Future!

    :cheese: Oom

  • edited July 2012

    I think what you are looking for can be accomplished with the noise brick.

    Add a noise brick, set the dimensions to 3d, Noise type to float.

    Connect a transform brick to the point input on the noise brick.
    Set the transform to be From current and To object space.

    Let me know if this accomplishes what you are looking to do.

    Post edited by paul.a.dalfonso_521836279b on
  • Oom FooyatOom Fooyat Posts: 0
    edited July 2012

    Thank you!
    First test, the angled plane. worked out pretty good.
    Second one, the fur shader, not so much.
    I need to find a way to scale the noise. I tried to add a Tiler to the Transform brick with limited success.
    How ever, it is a big step in the right direction.

    Cheers Oom

    Edit Wrong order on the renders, sorry

    RN3.jpg
    500 x 500 - 229K
    RN2.jpg
    500 x 500 - 241K
    RN.jpg
    300 x 300 - 80K
    Post edited by Oom Fooyat on
  • Oom FooyatOom Fooyat Posts: 0
    edited December 1969

    I think I figured out a way to scale the Noise.
    It looks like the fur gets less dens with distance again. I don't know if that comes from the scaling method or a resolution issue.

    RNa.jpg
    800 x 519 - 74K
    NRb.jpg
    500 x 500 - 125K
Sign In or Register to comment.