Getting shaders to work on imported .obj [SOLVED]

VargrVargr Posts: 31
edited November 25 in Daz Studio Discussion

I apologise in advance if this has already been discussed - I searched but found nothing (probably my fault).

A friend of mine has made an .stl-file using one of these websites, that enable you to quickly make a figure for 3D-printing.

He has then used another website to convert it into an .obj-file since I told him that Daz could import .obj-files but not .stl-files.

The .obj-file imports nicely, so no problems there (apart from odd opacity, scale and rotation but all easily corrected).

I want to turn it into marble or granite and use it in a scene as a statue.

My problem is, that I can not add a shader to the figure. Well, I sort'o can. Selecting the figure in the scene tab and in the surface tab I double-click the shader I want (say, a nice granite with red veins) and the result is disappointing. The colour changes to something a bit like the colour in the shader but just a uniform colour, no patterns, bumps or anything.

I have tried the following:

  • Add an Uber Shader first (I read somewhere this should add a proper surface property).
  • Export the figure as .obj and re-import it (someone mentioned this could do the trick).
  • Made a subset of the figure and merged it in afterwards.

Nothing helped - it is quite possible that I did it wrong.

 

If smeone could point me to a step-by-step tutoral or explain it here, I would appreciate it.

Please take into account, that I am just a happy amateur that dabbles in Daz from time to time; don't assume I know anything.

 

Oh, I am running Daz Studio 4.23 on Windows 10 if that matters.

 

Thank you in advance.

Post edited by Vargr on

Comments

  • LeanaLeana Posts: 12,735

    Is the model UV mapped?

  • Silas3DSilas3D Posts: 727

    3D models created in STL or other print formats often don't have UV maps, which are required to apply a shader successfully to a model.

    If you're not familiar with what a UV map is, briefly it is an unwrapped version of the models surface, which can then be used for creating textures which are then applied to the model as a material, and this material would only work for that model.

    Shaders are different in that they are typically a repeating pattern that can be tiled as appropriate on a surface, but there is still a dependency on having a UV map for the model.

    Rather than risk overwhelming you with how to check for and create a UV map (which would require other software such as Blender) I'll give you a simpler solution that will work without said UV maps :)

    With your model selected in the scene, go to the Create menu in Daz Studio menubar and select Create New Iray Decal Node.

    You can just click accept on the following dialog, then do the following:

    1. With the decal node selected in your scene, go to your Parameters tab and select Decal in the list of properties on the left (at the bottom)
    2. By default, Clip Mode is set to Position. Change this to None. This will ensure that your shader will cover the whole model without worrying about positioning it.
    3.  Go to your Surfaces tab and select the Front surface, then apply your desired marble/granite shader
    4. Et voila!

    This uses a technique called projection mapping, which literally projects the shader onto the model - much like an IRL projector onto a wall. As such its not constrained by the target models UV.

    You haven't attached a photo so don't know what kind of model you're working with, but there are limitations of this technique.

    Depending on how flat/curved your model is and position of your camera, you may need to tweak the projection rotation settings. Bear in mind this is not the general rotation settings, as decals have their own.

    Hope this helps and isn't too confusing!

  • VargrVargr Posts: 31

    Hmm, fiddling around a bit.

    It seems some other shaders (from DimensionTheory) do work (and some others), but the mainpart of those I have do not.

    So the problem seems to be related to the shader I guess.

    I need to find a good "Shaders 101" that can explain the workings for me.

    I guess my problem is solved or at least answered.

     

  • VargrVargr Posts: 31

    @Leana:

    I very much doubt the figure is UV mapped coming from a .stl-file.

     

    @Silas3D:

    UV maps: I see, good explanation.

    I will try the steps you gave and return.

  • Silas3DSilas3D Posts: 727

    Bear in mind that some shaders have projection mapping built into them, sometimes they can be referred to as procedural as well.

    The vast majority in the store will depend on UV maps though, and this is the industry standard.

  • VargrVargr Posts: 31
    edited November 25

    The pictures might take a while to be ready - sorry.

     

    @Silas3D:

    Below is the figure in Texture Shaded display, imported from the .obj-file, opacity set at 1, rotated and scaled.

     

    Picture 1: http://gofile.me/6nfX6/EeYMLkuzg

    Your steps were easy to understand and follow - thank you!

    And I do get the result I want. Somewhat.

     

    Picture 2: http://gofile.me/6nfX6/Ejt7g8iPU

     

    As you can see, the stone texture does get applied, but only partly (for instance, the backside of the harp is all white'ish as is the inner part of the coat, etc. Perhaps the figure is too complex (too many polygons)?

    Question: Why is the selector box for the decal node off set from the figure?

    Again, thank you for your help!

    Post edited by Vargr on
  • Silas3DSilas3D Posts: 727
    Ah yes your model is quite complex but that's the beauty of projection mapping, it works with any 3d mesh. The backface issue is probably because there's another setting that needs to be enabled on the decal. Can't remember exactly what it's called off the top of my head, but somewhere there's a drop-down that is by default set to front and there's an option for front and back. Don't worry about the selector box, that's just the bounds of where the physical decal node is in the scene. Providing you changed the clipping setting as mentioned previously, it shouldn't affect the projection, but it wouldn't hurt to check the transform settings of the decal and set them to 0 if currently non zero value.
  • VargrVargr Posts: 31
    edited November 25

    And I am back from business elsewhere.

    You are correct, it was - with Iray Decal Node selected - Parameters / Decal / General / Face Mode --> Front and back

    Now the shader is uniformly distributed. Very nice looking - and it accepts any Iray shader I have tried to throw at it.

    As far as the selector box - I can get it positioned so it more or less is at the right spot (but the height of the box and the height of the figure is different). However, regardless of where I place it it works, so I will not be bothered by the off-set now that I know it doesn't matter.

    Thank you very much for your help!

    I really appreciate it!

    I learned a lot through this and will put the procedure into my OneNote with all things Daz :-) 

     

    Post edited by Vargr on
  • Silas3DSilas3D Posts: 727
    No problem, glad it worked for you :)
  • Silas3D said:

    Bear in mind that some shaders have projection mapping built into them, sometimes they can be referred to as procedural as well.

    The vast majority in the store will depend on UV maps though, and this is the industry standard.

    or they may not need any kind of positonal data, or they may use acvtual location in space, etc. It's true that most mateials on store products need UVs, but there are various ways they might not.

  • VargrVargr Posts: 31
    edited November 26

    I have tried to make a step-by-step instruction for those coming here with the same question:

    Steps to undertake for Daz 4.23:

    • Import
      • Import the wanted .obj-file through File / Import
    • Add Iray Decal Node
      • Select the imported object in the Scene tab.
      • In the Create menu find and click Add New Iray Decal Node.
      • Select the Iray decal node in the Scene tab.
      • Go to the Parameters tab and select Decal in the list of properties on the left.
      • By default, Clip Mode is set to Position. Change this to None. This will ensure that the shader will cover the whole model without worrying about positioning it.
      • Go to your Surfaces tab and select the Front surface, then apply your desired shader.
      • Et voila!
    • If the shader does not cover the object completely, try this:
      • Again, select the Iray decal node in the Scene tab.
      • Go to Parameters / Decal / General / Face Mode and change it to Front and back.
    • The bounding box for the iray decal node seems off
      • The bounding box for the Iray decal node might seem off-set in relation to the object it belongs to.
      • This has no impact on how it works, so this off-set can be ignored.
      • If it bothers too much try to adjust the transform settings of the decal. Setting them to zero should help.

     

    Again, thank you to Silas3D for helping out.

    Post edited by Vargr on
Sign In or Register to comment.