Getting shaders to work on imported .obj [SOLVED]
Vargr
Posts: 31
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.

Comments
Is the model UV mapped?
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:
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!
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.
@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.
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.
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.
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!
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 :-)
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.
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:
Again, thank you to Silas3D for helping out.