Compose renders in shader builder

almahiedraalmahiedra Posts: 1,351
edited August 2012 in Daz Studio Discussion

I need help with shader builder.

With two shaders (shader A and shader B) I obtain two renders which I want compose in shader builder. I want compose the renders, compose shaders is imposible because shader A destroy shader B then mix function is useless. Anyone have an idea to do it?

I do a composition with postwork, but the idea is obtain all with shaders. I add renders and postwork composition.

compose.jpg
175 x 779 - 36K
B.jpg
175 x 779 - 33K
A.jpg
175 x 779 - 21K
Post edited by almahiedra on

Comments

  • Takeo.KenseiTakeo.Kensei Posts: 1,303
    edited August 2012

    Hi,

    I recall reading a paper about npr rendering in renderman that used a tip in which you render the object scaled a bit bigger for the outline then render the object with a toon shader and combine the two. That seems to be what you're looking for. I can't remember exactely but I think it was a two pass render so you may also need to use DS scripting; Sorry I can't remember where I read it but I do recall that it also involved backface culling, so that you only render what is behind the object you want to render

    An other way to do that could be to use ImageMagick to combine the two rendering

    Post edited by Takeo.Kensei on
  • ChoholeChohole Posts: 33,604
    edited December 1969

    Please note that nudity is not allowed in the forums, as [er the forum TOS, Please review the TOS here, espceially the first bullet point in the gerenal code of conduct. Thanks. http://www.daz3d.com/forums/discussion/6_4/

  • almahiedraalmahiedra Posts: 1,351
    edited December 1969

    chohole said:
    Please note that nudity is not allowed in the forums, as [er the forum TOS, Please review the TOS here, espceially the first bullet point in the gerenal code of conduct. Thanks. http://www.daz3d.com/forums/discussion/6_4/

    Sorry, I quickly transform her in a decent girl.:red:

  • almahiedraalmahiedra Posts: 1,351
    edited August 2012

    Hi,

    I recall reading a paper about npr rendering in renderman that used a tip in which you render the object scaled a bit bigger for the outline then render the object with a toon shader and combine the two. That seems to be what you're looking for. I can't remember exactely but I think it was a two pass render so you may also need to use DS scripting; Sorry I can't remember where I read it but I do recall that it also involved backface culling, so that you only render what is behind the object you want to render

    An other way to do that could be to use ImageMagick to combine the two rendering

    Thanks, Takeo.

    Yes, DS Scripting is the optimal solution, but not the fast solution. I need time, time and more time to learn.

    Post edited by almahiedra on
  • ReDaveReDave Posts: 815
    edited December 1969

    That's a nice shader you've got there.

    gilikshe said:
    I want compose the renders, compose shaders is imposible because shader A destroy shader B then mix function is useless.
    Are you sure it's impossible? I'm fairly confident you can pretty much always mix a number of shaders (e.g. pass values to temporary variables, in particular pass the value just before you add to Ci, and an "if then" here or there; although your outline shader probably doesn't have anything to add to Ci :-S ).
  • Takeo.KenseiTakeo.Kensei Posts: 1,303
    edited August 2012

    I think that the good way to go would be to use geometry shell rendered with backface culling inverted to get the outline and render the other shader as normal. That would be a single pass and no need to mix shader

    Post edited by Takeo.Kensei on
  • almahiedraalmahiedra Posts: 1,351
    edited December 1969

    ReDave said:
    That's a nice shader you've got there.
    gilikshe said:
    I want compose the renders, compose shaders is imposible because shader A destroy shader B then mix function is useless.
    Are you sure it's impossible? I'm fairly confident you can pretty much always mix a number of shaders (e.g. pass values to temporary variables, in particular pass the value just before you add to Ci, and an "if then" here or there; although your outline shader probably doesn't have anything to add to Ci :-S ).


    Thanks, ReDave,


    Black Silhoute is a displacement shader, toon filled is a surface shader. When I try to use a version of the brick from the displacement network in the surface network:

    1.- It doesn't produce any transform, or
    2.- If I add displacement brick output, it produce a white colored and broken silhoutte

    For this reason I was thinking about mix renders, no bricks mix in one shader.
    All toon filled shader is a mix of outline shader, plain color shader, and shadow control shaders (no included in the images), but I fail trying to integrate displacements in the mix.

  • almahiedraalmahiedra Posts: 1,351
    edited December 1969

    I think that the good way to go would be to use geometry shell rendered with backface culling inverted to get the outline and render the other shader as normal. That would be a single pass and no need to mix shader


    I supose it is different to trying to use displacements, but even use information fron normal vector. I will think in this, thanks.

  • almahiedraalmahiedra Posts: 1,351
    edited December 1969

    I think that the good way to go would be to use geometry shell rendered with backface culling inverted to get the outline and render the other shader as normal. That would be a single pass and no need to mix shader

    First experiment with geometry shell and outline in shader builder. No enough good with transparency, It needs more work.

    DS4.5 Pro crash, and re-crash when I touch much the geometry shell.

    shell2.png
    777 x 834 - 168K
    shell.png
    777 x 834 - 224K
  • almahiedraalmahiedra Posts: 1,351
    edited December 1969

    Experiment # 2: transparent front is "some" better.

    rendered.png
    698 x 834 - 125K
    unrendered.jpg
    631 x 733 - 44K
  • almahiedraalmahiedra Posts: 1,351
    edited August 2012

    Experiment # 3:

    Normal negatives visible, transformed normal from "world space" to "camera space". I was thinking this was better, but... what happen?

    exp3.3_.png
    253 x 834 - 55K
    exp3.2_.png
    253 x 834 - 83K
    exp3.1_.png
    253 x 834 - 104K
    Post edited by almahiedra on
  • almahiedraalmahiedra Posts: 1,351
    edited December 1969

    Experiment # 4: Non optimal results, but it now works.
    I change transfomations and sign of normal.

    Thanks guys for the ideas.


    PD: Thanks Takeo for your Gooch shader, too

    exp4.4_.png
    253 x 834 - 115K
    exp4.3_.png
    253 x 834 - 119K
    exp4.2_.png
    253 x 834 - 102K
    exp4.1_.png
    253 x 834 - 127K
  • Takeo.KenseiTakeo.Kensei Posts: 1,303
    edited December 1969

    gilikshe said:
    Experiment # 4: Non optimal results, but it now works.
    I change transfomations and sign of normal.

    Thanks guys for the ideas.

    Congrats for succeeding in creating the shader. Looks good to me. I know there are other tech to get the outlines better and If I find them again I'll tell you so that you can optimize your shader


    PD: Thanks Takeo for your Gooch shader, too

    No problem you're welcome. I should update it because I changed some little things that give more control

Sign In or Register to comment.