Shader mixer displacement blicks P and N quesiton

kitakoredazkitakoredaz Posts: 1,973
edited December 1969 in Daz Studio Discussion

I now studying tutorial,, then have some quesiton.

when I Import blicks from duz default shader,
there are already, bump and displacement blicks.

then I understand,, displacement effect actuall Displaced point (P), positon.

bump effect Displaced Normal (N) (facing direction, so that light make, dark and blight difference?)

but, when I check how blicks are connected,

both of P and N , in default Displacement first blick , connect to second blick (bump blick) < in put> .
then,, still more, P of default Displacement first blick connect to filnal blick which may determin about displacement.
(picture 1)

but about bump blick,, the P never effect to final displacement surface blick ,, I think.
actually, bump (p) output not connect,, to final blick (input)
so that,, the connection,, P of Displacement blick to Bump blick has meaning?

then,, if I disconnect , P of Displacement blick to final brick ,
after that, connect P of Bump (output) to final blick (input) there is difference? like my picture2,,,

input P over write the value , so the Bump blick set the input value, and copy the value to final blick,,I think,,
it is something worng and diffrerence?
hope,, someone teach me ^^;

displacement2.JPG
943 x 755 - 95K
displace1.JPG
879 x 806 - 80K

Comments

  • BejaymacBejaymac Posts: 1,043
    edited December 1969

    The DS Default Displacement brick (the ones you've labeled Bump & Displacement) has to connect directly to the Displacement root brick for either Bump or Displacement to work, in your second picture the Bump brick is asking DS for Displacement as both N & P are connected, but you've gone and given DS a headache by connecting the other brick only through the Bump brick.

    The big problem is you can only have the one Displacement root brick (the one on the right in your pictures) in a shader and three separate displacement functions need access to it, so you need to have connection lines running around the place to get them all to work with one root brick.

  • kitakoredazkitakoredaz Posts: 1,973
    edited December 1969

    thank you bejay,, I understand,, (not all,, but feeling^^; so first I think ,,I need to each defautl displacement N and P
    to last root displacement blick ,, it is reosonable,,
    Bump need N, displacement need P ,, so coneect two blicks to last root dsiplacement blick.

    so that I must need connect each dispacement out put (P) and bump out put (N) to last root displacement blick.

    then,,, one more question,,,

    why first defualt Displacement out put (P) and (N) need to connect second defualt Displacement
    (bump,,I changed labell to clear understand for me ^^;) P and N too?
    the second difualt Displacement blick may work as Bump ,, only N. not move vertices,,,

    and the N direction value are decided bump image which I connect the image blick already,,

    why apply first diffult Displacement blicks P and N value to Bump (diffault Dsiplade ment blicks) again?

    if I disconnect first Displacement blicks and Second Displacement blicks, P and N, it can not work?
    or effect may change?

    it means,,, when I apply displacement texture, it change vertices postion and face direction at same time,,
    then tell the value to bump blicks,, if there is the bump texture,,
    bumptexture change faces direction again, then tell the value to final blicks ?:roll:

  • 3dcheapskate3dcheapskate Posts: 760
    edited February 2013

    If you use bump AND displacement on a surface at the same time, then displacement is applied first and bump is applied after that. Hopefully the attached picture makes it a bit clearer. If you apply displacement AND bump, then the surface normals are already altered by the displacement before you add the bump.

    The other important point is this:
    - Displacement alters both P and N, so you need to use both P and N outputs
    - Bump only affects N, so you only use the N output .

    (P.S. This is how I think it works - I may be wrong!)

    bump.png.png
    640 x 221 - 31K
    Post edited by 3dcheapskate on
  • kitakoredazkitakoredaz Posts: 1,973
    edited December 1969

    thank you!! 3dcheapskate

    your pic make me more easy to understand,,, directly I can image,, how these map work^^:lol:

    I confused first,, displadement and bump difference, (displacement really change postion,, upward or down,,
    but bump not change actually,, etc,,^^;)

    but tweaking shader mixer,, now I get clear image,,,how work each blick,, in daz studio,,
    ,, thank you much ^^ yours!! it seems solved for me now.

    (and I think yours clear guide may help other new user too ^^)

  • 3dcheapskate3dcheapskate Posts: 760
    edited February 2013

    どういたしまして :-)

    (do itashi mashte = "you're welcome", with a bit of help from Google translate to get the hiragana... double-checked with several places to make sure!)

    I hope I got the right language?

    Post edited by 3dcheapskate on
  • 3dcheapskate3dcheapskate Posts: 760
    edited December 1969

    Edit: here's an updated version of the picture - I've tidied it up a bit and I think it's a bit more accurate.

    P+N.png
    640 x 400 - 33K
  • kitakoredazkitakoredaz Posts: 1,973
    edited December 1969

    Thank you !! I check later,, I hoped to say thank you again ,,
    (I think,,,good chance ^^b)

    and yes ,,

    your are welcome = dou itashi mashite ^^; (I learned so,,,)

  • kitakoredazkitakoredaz Posts: 1,973
    edited December 1969

    Now I want to ask more,, about shader mixer blicks here,,,

    I can not clearly understand "opacity" (color) of root>surface blcik ,
    and opasity strongness (daz default shader properties)

    1 I create cube1, cube2
    2 I make new shader in shader mixer, only load "root>surface blick"
    3 I apply the shader to the cube1 surfaces
    4 There is opacity properies , I set "Opacity" as black. then change "Color" as blue

    I thought,, the object become transparet. but not.
    it can remove shadow, but the cube1 keep color (as if ambient the blue color) when I render.

    next I import daz default shader of cube2, to shader mixer,

    DS default materials blick are connected surface blick,
    I Disconnect Material color and color of surface blcik,

    then DS default materials blick proprety (input >opacity> Color Strength)
    connect to output> Matterial opacity to the Surface opacity .

    I set color "opacity >color Strength" in DS default blcik, turn black.
    then apply the shader to cube 2 surface.

    when ds 3d view,, cube 2 become transparent, when I render it, it can not change the cube transparent

    MY qusesion is, where is different,, Opacity(color) in surface blick and
    Opacity strongness of daz default shader blick?

    and,, I know daz default shader have Opacity Strength as "value" (0 to 100 % or, 0 to 1) in surface tab,
    when I set the value zero, it must change the surface transparent.

    but in shader mixer it turn as Color (RGB) propertie,,,

    so If I want to make a opacity strength as value,
    and want to make shader which can transparent, How can I do it in shader mixer?
    is there blicks for setting opacity strongness as value?

    I thought,,,opacity black = opacity strenght "zero" and white ="1 or 100%" grey scale,, but no?

    hope someone guide me, please

    opacity2.JPG
    1108 x 668 - 126K
    opacity1.JPG
    1109 x 658 - 110K
  • RarethRareth Posts: 1,457
    edited December 1969

    Now I want to ask more,, about shader mixer blicks here,,,

    I can not clearly understand "opacity" (color) of root>surface blcik ,
    and opasity strongness (daz default shader properties)

    1 I create cube1, cube2
    2 I make new shader in shader mixer, only load "root>surface blick"
    3 I apply the shader to the cube1 surfaces
    4 There is opacity properies , I set "Opacity" as black. then change "Color" as blue

    I thought,, the object become transparet. but not.
    it can remove shadow, but the cube1 keep color (as if ambient the blue color) when I render.

    next I import daz default shader of cube2, to shader mixer,

    DS default materials blick are connected surface blick,
    I Disconnect Material color and color of surface blcik,

    then DS default materials blick proprety (input >opacity> Color Strength)
    connect to output> Matterial opacity to the Surface opacity .

    I set color "opacity >color Strength" in DS default blcik, turn black.
    then apply the shader to cube 2 surface.

    when ds 3d view,, cube 2 become transparent, when I render it, it can not change the cube transparent

    MY qusesion is, where is different,, Opacity(color) in surface blick and
    Opacity strongness of daz default shader blick?

    and,, I know daz default shader have Opacity Strength as "value" (0 to 100 % or, 0 to 1) in surface tab,
    when I set the value zero, it must change the surface transparent.

    but in shader mixer it turn as Color (RGB) propertie,,,

    so If I want to make a opacity strength as value,
    and want to make shader which can transparent, How can I do it in shader mixer?
    is there blicks for setting opacity strongness as value?

    I thought,,,opacity black = opacity strenght "zero" and white ="1 or 100%" grey scale,, but no?

    hope someone guide me, please

    The slider for Opacity strength is a DAZ studio convention

    3DLight the render engine uses color to control how transparent something is in the Opacity channel.

    what we are probably not seeing in the shader mixer is the render-time script that does some magic to make it work.

  • kitakoredazkitakoredaz Posts: 1,973
    edited February 2013

    mm,, thank you,,
    I can understand the color strongness is shown as float (or percentage) value on ds surface tab.
    and it may be changed by DAZ script etc ^^; (but not hope to understand more detail,,)

    then,, I simply feel strange, why the simple shader made by shader mixer,root blicks,
    and import from daz default shader,, can not make cube transparent @@;?

    even though I set opacity color as black,,

    then I try and find, when I set "color" black with "opacity" black, too,
    it can make the cube transparet.

    so,, the "color" is what? not only diffuse color?

    and simply hope to know what "opacity" (color which need to set for opacity property)
    property of root surface shader? how it work?

    I know,, in ds surface tab,, I can set opacity map texture,, on this case, black area turn transparetn
    and another area can be shown, and if I set grey texture,, may half transparetn
    (So I thought, the color is grey scale value,, ,,,)

    opacity3.JPG
    1148 x 842 - 147K
    Post edited by kitakoredaz on
  • Richard HaseltineRichard Haseltine Posts: 19,962
    edited December 1969

    Did you render the version that had only the root brick, or did you just stop when it didn't preview correctly? For me such a surface is visible in preview, but does not appear in renders - I think the difference is due to the DAZ Material brick having code to preview correctly, but the root brick not having preview code (or less complete preview code).

  • kitakoredazkitakoredaz Posts: 1,973
    edited December 1969

    thnak you richard,,,
    (I think,,if it cause because,, my AMD video driver ,,
    First I need to each shader mixer blick work correclty or not ^^;)

    About daz default shader, (not use shader mixer) the opacity strength work what I thought.
    on 3d view, and after render.. simply opacity strongneth value is how transparetn the surface.

    and usually I need to render to check shader effect (made by shader mixer,, )

    load root surface blick only,
    it must show the "color" of cube when I render. but on 3d view, it keep grey defalut color.
    shader mixer pleview is transparent. I can not check any color.

    I just load root "surface" blick, in shader mixer, then apply it on cube surface.

    Property "opacity" = "black",
    property "color" = "blue" (or red , yellow green,, white,, )
    in shader mixer preview,, the color disappear.
    om 3d view,, cube keep default surface grey color.

    then render it. = pic1

    everytime,,it show ambient blue property "color" (or red , yellow green,, white,, )

    I want to confirm ,,,the effect of root blicks are supposed to be?
    or there is something problem about video driver?

    but when I set "color" ="black" too, as same as "opacity"
    and render, it transparent, I can not see the black color

    render2.JPG
    839 x 671 - 86K
    render1.JPG
    1175 x 771 - 122K
  • kitakoredazkitakoredaz Posts: 1,973
    edited December 1969

    wuuu,,,I am confused,,,

    if I set color (128,255,0) (light green) then , opacity (0,0,0) of root surface blick,
    it shows yellow .(ambient)

    if I set color (128.128.255) (violet) opacity (0.0.0)
    it shows white,,,

    now I render with default 3delight setting(restore default)
    how work color and opacity? :-S or AMD Radeon is so foolish??

    white.JPG
    786 x 594 - 84K
  • RarethRareth Posts: 1,457
    edited December 1969

    I think the root suface brick is not supposed to be used by itself I always use the DS Default Material Brick with it

    The surface brick is what tells the Render Engine how to apply the Shader ( I think all the "ROOT" bricks do this)

    so I leave the settings on the root brick alone and do all the work and changes through the DS Default Material Brick.

    in my mind I think of the root bricks as the final output, not something we should change, it is just something that is necessary for Daz Studio to communicate with the Render Engine the information about the shaders.

    the ONLY root brick I use as a standalone is the "Indirect Lighting Camera Shader" Brick.

  • kitakoredazkitakoredaz Posts: 1,973
    edited December 1969

    ya,, thank you I understand what you said.
    actually, I may never use only root surface blick if I make shader.

    then I want to know about each property of blicks, so first checked it by most simple case ^^;

    but I may need to apply ds default blicks, then tweak daz default blicks and connect other blicks as you said.
    it seems better..
    (do not hope to stay long about root surface blick ^^;)

    I understand if I connect ds default shader and surface root blick,
    and keep connect both of (Material color to color ) (Material opacity to opacity)
    it work as I hoped.

    (but I want to tweak to confirm, why when I unconnect "material color" of daz default shader material
    and use root blicks color property,,the opacity can not work ^^; I believe color property of root blick not only diffuse color,,
    or it has some meaning ^^;)

  • RarethRareth Posts: 1,457
    edited December 1969

    ya,, thank you I understand what you said.
    actually, I may never use only root surface blick if I make shader.

    then I want to know about each property of blicks, so first checked it by most simple case ^^;

    but I may need to apply ds default blicks, then tweak daz default blicks and connect other blicks as you said.
    it seems better..
    (do not hope to stay long about root surface blick ^^;)

    I understand if I connect ds default shader and surface root blick,
    and keep connect both of (Material color to color ) (Material opacity to opacity)
    it work as I hoped.

    (but I want to tweak to confirm, why when I unconnect "material color" of daz default shader material
    and use root blicks color property,,the opacity can not work ^^; I believe color property of root blick not only diffuse color,,
    or it has some meaning ^^;)

    its more than just the diffuse color, this is easily determined by the DS default Material and all of it's settings and that they all output through just the two outputs Color, and Opacity. So there is alot more going on behind the scenes can we can see, this is one of the main limitations of the Shader Mixer.

    The Surface Shader root brick "In My Opinion" should not have any settings that we the user can edit as this makes it too confusing for those learning to use the shader mixer. All the Surface root brick does is translate everything it receives from the DS Default Material Brick into a usable form that is understood by the 3Dlight render engine. when you change the default settings on the Root Brick you change the translation.

  • ReDaveReDave Posts: 815
    edited December 1969

    3Delight renders in which a zero opacity gives an opaque result are bugs and should be reported. I think the Surface root brick isn't equipped to distinguish between float and colour in the opacity channel.

  • Richard HaseltineRichard Haseltine Posts: 19,962
    edited December 1969

    You certainly shouldn't need to use a DAZ Default surface brick - and as I said, I got the correct result from setting the opacity to black with just the root in the shader (ambient isn't an independent setting, it has to be mixed in by the sahder to get the final colour and opacity - those are the only outputs from a surface shader, ignoring things like displacement that change location.

  • RarethRareth Posts: 1,457
    edited December 1969

    You certainly shouldn't need to use a DAZ Default surface brick - and as I said, I got the correct result from setting the opacity to black with just the root in the shader (ambient isn't an independent setting, it has to be mixed in by the sahder to get the final colour and opacity - those are the only outputs from a surface shader, ignoring things like displacement that change location.

    well I agree you shouldn't need to use a DAZ default surface brick, but it is a good starting point, just like you shouldn't need to use a DAZ default displacement brick, but both are my current go to starting points after the root brick. I am by no means an expert in the shader mixer, so there is alot I am missing, not to mention getting quite a bit bassackward. I blame it on the lack of good documentation included with the software.

  • kitakoredazkitakoredaz Posts: 1,973
    edited December 1969

    so,, richard said correct result means,

    use only root surface blicks.
    then
    when set "opacity" = (0,0,0)
    the object must be transparent , so nothing can be seen "not black shade of object, no color" ?
    I hope so,,, (though I do not get the effect) .

    I perfectly confused what means opacity,, about root shader..

    I thought,,, root surface blick " color"
    is data of RGB value about each surfaces when I render. if I connect the input color to
    other blicks node, it overwrite the RGB value,,

    about daz default material blicks, there is diffuse, ambient, specular,,
    so that these value are input to "color" of root surface blick when I render.

    is not it right?

    then when I connect "daz default material blick" to "root surface blick",
    I need to connect both output "color" and "opacity" to get transparetn (nothing can be seen)
    but I feel it is something wrong,,

    when I connect daz defualt material blicks output "Material opacity"
    to root surface blick input "opacity",
    it means,, opacity color (opacity strength) value of daz defualt material blicks
    overwrite the "opacity" of root surface blick,,

    then,, if I set the opacity strength of "daz default material" blick,, the surface will be transparent,
    the value of "opacity" which I set in root surface node are ignored,,,
    so I think I need not connect the "material color" to "color" (though I can not use ambient,or specular etc,,)
    to get transparent controll,,,

    but it can not work, as I expect,,
    it is miss understandinig?


    think the opacity value are overwritten by daz default material blick

  • Richard HaseltineRichard Haseltine Posts: 19,962
    edited December 1969

    I think you are understanding correctly - when you plug an input into a value that replaces the local value set in the brick. So setting the opacity in the root brick to black has no effect if there is an output from another brick plugged into the opacity input. Sorry, I had misunderstood some of your earlier posts I think.

  • kitakoredazkitakoredaz Posts: 1,973
    edited December 1969

    ah,, no no it is my fault :down:
    because,, it can not work what I suppose to be,, so I am confused,,
    I can not udnerstand, there is problem or I made misunderstanding,,
    so I can not say clear.

    then I want to ask (sorry again and again,, if you have time,, olease answer later,,, ) and confirm
    use only root surface blicks.(no daz default mateiral brick)

    then
    when set “opacity” = (0,0,0) in surface blick,

    the object should be transparent , so nothing can be seen “not black shade of object, no color” ?

    and,,, when I set opacity strength - (0.0.0) in daz material blick,,
    and I connect opacity material to opacity (root suface blick) only,

    it means,, opacity strength (0.0.0) out put as opacity value then input to opacity of (root surface blick)
    so object should be transparetn when I render?

    transparetn = opacity or opacity sterngth (0.0.0) is right understanding?

  • ReDaveReDave Posts: 815
    edited February 2013

    Yes, 0,0,0 in opacity is completely transparent, or it should be. I have put a sphere around a Kid4. The sphere has just the Surface brick and I applied the diffuse colours you used in your tests, i.e. violet and green; and black as opacity. Indeed the sphere comes out whitish, with a respectively blue and yellow green cast, you can see the UberEnv KHPark in the background. That looks like a bug to me, but there may be a valid reason I'm unaware of for that to happen.

    Kid_BadGuy_Velvet50pct_Raytraced_LipSharpness100pct_LightOrangeLight_SurfaceBrickRoot0pctOpacity_ColourVerdolino.png
    618 x 800 - 316K
    Kid_BadGuy_Velvet50pct_Raytraced_LipSharpness100pct_LightOrangeLight_SurfaceBrickRoot0pctOpacity_ColourViolaceo.png
    618 x 800 - 232K
    Post edited by ReDave on
  • kitakoredazkitakoredaz Posts: 1,973
    edited February 2013

    oh,, thank you Redave,, I am happy,, (because you confirm the problem may happen on user environment ^^;)
    if your PC video dirver is A M D? ^^; ????

    then ablut me,, if I use daz default shader blick and root blick,,

    I must need connect both opacity and color,, on this case it work I suppose to,,, (it is same when we use ds default shader,
    on surface tab,, ^^;) I think

    Now I talk about case,, when I use "ds default material blick" and "root surface blcik" and connect with each case.

    but if I connect only color,, or connect only opacity,, by shader mixer,

    it is so unreliable effect,,, I can not find the rule,,how I adjust each property how it effect,,

    eg if I connect ds default material blick " color material" to "color" root surface,, and disconnect "opacity"

    the effect is as if it inculde opacity strongneth value of "daz material shader"

    I never connect opacity to opacity,, disconect and apply shader,
    but when I tweak opacity strongneth of ds default material shader,,
    it change the effect when I render. (I never connect oapcity ^^;)

    I suppose to,, and believe,,
    if I connect only color,, and disconnect opacity,
    ds dafult shader opacity strongneth value can not overwrite "surface" root opacity value ^^;
    I want to shout ADM radeon ,, please much to my daz studio and blender more ^^;

    opacityoff.JPG
    1326 x 770 - 171K
    Post edited by kitakoredaz on
  • Richard HaseltineRichard Haseltine Posts: 19,962
    edited December 1969

    Ah, I understand the issue now - my tests were just a primitive in an empty scene, and that does vanish. It seems, I think, to be multiplying the colour from the surface with the root brick by the underlying surface. I suspect it is a bug, but it's hard to be sure.

  • ReDaveReDave Posts: 815
    edited December 1969

    I filed a bug report about the Surface-brick-only shader yesterday. I wasn't sure about the need to have other objects in the scene, thanks for that Richard.

  • Richard HaseltineRichard Haseltine Posts: 19,962
    edited December 1969

    Apparently if you want the same kind of result with the root as with something like the DS Default Surface you need to multiply the colour by the opacity - so multiplying by black would make the colour black too (which suggests that the actual blend with underlying pixels is screen).

  • kitakoredazkitakoredaz Posts: 1,973
    edited December 1969

    So,,finally I tried again then,, RIchard means,, like that?

    (I have never felt such difficulity about other aprication shader node,,
    and could not understand what you say,, multiple,, opacity and color for opacity again,,,
    I tried,, just make color and opacity,, as same as print "hello world!",,,
    then forget it so long time,,

    Though still seems far from what I can expect,,, I can not believe,, it is usuall behavor,,

    opacity.JPG
    930 x 652 - 48K
  • Eustace ScrubbEustace Scrubb Posts: 1,396
    edited March 2014

    The Surface brick calculates the Opacity/Color relationship expecting to receive input through a DAZ Default Surface brick: Bill Redfern had a good demonstration of this on the old boards, but I cannot duplicate it now. What you have to do if you do NOT use the Default Surface brick is to multiply your Color and Opacity values together before plugging the result in at "Color Input", I believe, or your color will be off.

    Edit to add: Yes, just as Richard described. You've hit right on it.

    Post edited by Eustace Scrubb on
  • kitakoredazkitakoredaz Posts: 1,973
    edited December 1969

    thank you,, Eustace Scrubb

    yes I understand if I use "DS Default material" blick, I need not to insert multiple blick,,
    then,, today I checked RSL documents,, and try to write most sumple shader,,

    /* TestOpacity shader */
    surface test(){
    Oi = Os; //Os = "Opacity" value in RIB"
    Ci = Cs*Oi; //Cs ="Color" value in RIB"
    }

    So that,,, "Root Surface" imputs"Color" (Ci) means,,final rendered color of the points?
    then it is same as "DS Default Material" Outputs "Material Color" value?

    Because,, when I see DS material blick, I think,, it means

    (Root surface) Oi = Outputs Material Opacity
    (Root surface) Ci = Outputs Material Color

    In "DS Default Material" blick,,
    it calcutate,

    Outputs "Material Color" = Outputs "Material Opacity" * "calculated value from Inputs values (diffuse,Specular,,etc)"?

Sign In or Register to comment.
Rocket Fuel