Shader-mixer: Double sided mat…
Daz 3D Forums > General > The Commons>Shader-mixer: Double sided mat…
Shader-mixer: Double sided materials? YES! (SOLVED)

I have a weird question. For my latest project, I'm making a coat with a long tail. Is it possible to have a different material on the inside of the coat than the outside without making a separate mesh? Or do I have to duplicate the mesh on the inside. This was what I was trying, since I didn't think the first option was possible. But my vertex count goes way up, for one thing, and there is a lot of overlap since the inside mesh is so close to the outside.
Post edited by 3WC on
Comments
I know that it is possible with renderman shaders to have double sided normals. So I would guess that if you really knew your stuff you could do it with shader mixer or shader baker. That said, I am not sure anyone actually knows how.
Yes it's possible but not all software can make a double sided polygons. I know 3D Max, Maya, Shade, Houdini all support the feature. Not sure about blender or modo.
Plus you'd need to check if Daz studio supports double-sided rendering. Poser can render them but it sometimes moans about it
UVMapper Pro was able to make a model double sided but I haven't used it in many years so i'm not sure if it's still a feature
I was under the impression that a mesh face always only has a single normal, no matter what. What can make a mesh appear "double sided" is the shader applied to it handling the normal and non-normal sides of the mesh independently. But as Khory points out, trying to create such a shader in Studio probably falls into the realm of Major Voodoo.
it's possible to have normals facing both sides of the polygons, by default Houdini makes all meshes double-sided.
it's not used often in daz studio or poser because it can cause artefacts in the render, it used to crash Poser if it was being grumpy, and not all modelling software supports the feature, but it does come in handy sometimes
Thanks for all the replies. So, I guess that's a "no", then? I'm probably not ready for major voodoo.
This is what I find for blender:http://www.blender.org/development/release-logs/blender-246/shading-nodes/
Maybe something similar could be done with shader mixer?
Or the other method, which seems problematic. It seems that the materials show through one another, as the meshes are too close together. http://www.katsbits.com/tutorials/blender/double-sided-faces-different-materials.php#setupduplicates
As I under stand it shader mixer/baker pretty much open up the potential to do any sort of shader that renderman is capable of. So if someone knew how it could be done. While it is not something that is the least bit helpful, velvet used on a surface in studio often has a different color inside than outside. I've always sort of assumed that this had to do with the double sided ability but have no way to prove it.
Yeah, shader mixer is pretty much a mystery to me. Calling all shader masters! Little help, please?:cheese:
Well, I've been working on the mesh option, and I got it working pretty well, so maybe I'll just go with that for now. I opened a whole can of worms, didn't I?
The Variable brick will give the normal at the current point, so you could test that to see if it was pointing towards or away from the camera (the camera vector is also in the Variable brick) and if it was away use one set of values (lining) and if towards another (outside) - I think. Rendering at the moment so I can't check at all.
This is an interesting topic :-)
Have no idea if this will help or hinder the process but in Hexagon one can create double-sided face normals by welding them together. The shimmer is drastic of course but if the Shaders can handle it???
As long as there are separate material zones I think so...but I think this is more about applying a different shader to each side of the polygon.
If I've got this wrong...please feel free to let me know! ; )
I was just reminded of this, and had a quick tinker. This network gets a normal vector between the surface and the eye (the camera position) by taking a variable set to P (surface position) and subtracting it from E (the camera position), normalising the result, then taking the dot product of that with the surface normal to get a value that will be over or under zero depending on whether the surface is facing towards or away from the camera. Actually, I'm pretty sure this is a bad way of doing it - probably better to take a single variable, set to I (the incident vector), normalise that and dot product it with N, as this method will give the wrong result if viewed by means of a mirror. Anyway, compare the result of the dot-product with zero (greater or less than) and use that on an If brick to pick the shader value you want to use.
Um, thanks.
(I don't unnerstann a word that fella' jus' said!)
No, thanks, I'll mess around with that and see what I can come up with.
Very nice Richard, it works well on this cut up cylinder, and yes that is two separate shaders on one material zone.
Like Richard says that doesn't work too good in reflections, you end up with the wrong effects showing in the reflection, his second suggestion does the business though, although I did have to change the Compare brick from Greater than to Less than, as the brick effect was being placed on the inside of the cylinder rather than the outside like I wanted ;)
Edit
You can even get bump/displacement to work with it XD
How do you figure this stuff out Richard !
I'm totally amazed :o
I remembered that the vectors were in the list of variables, and checked how the dot (and cross) product work via Wikipedia since it's been a long time since A-levels. Glad it's proving a useful starting point.
So if I want to add a double-normals to usual shader, I just need to add it to default materials to get that network from previous page?
Yes, if I understand the question you juts need to use the vector stuff to distinguish between insdie and outside of the mesh, and then feed the result of the compare brick to an If brick controlling each property you want to be different (or to control the colour and opacity etc. fed to the root bricks, which ever is easier).
um, any chance of somebody releasing that as a free shader for those of us who are brick blind?
My math skills are nowhere near Richards level so I had to go a less mathy route haha.
This shader just compares the Normalized Normal and Normal Forward. It works under a simple test but I don't know if it will hold up in a complex shader.
Richard and Age of Armour are both very very clever...if Richard doesn't mind I'm happy to attempt to put together the network for people to play with and also Age of Armour's.
I can generally follow where others lead...; ) lol
Yes, this stuff is amazing. The one caveat being, however, that this will only work in Daz Studio, right? If we were to convert to a cr2, this won't work in Poser, isn't that true?
I'm happy for people to use this as they wish - it was posted as a contribution to the discussion for further development, sine I was too lazy to make a full shader.
Yes, Shader Mixer is DS only - the Poser material room has N and P nodes, but I'm not seeing an equivalent of the I or V, or E, variables so I'm not sure how readily this could be done my way or using Age of Armour's approach. It might be worth trying to get BagginsBill's attention.
Well, it's kind of a moot issue for me; I already added extra mesh to my project to make a double sided coattail. I think that's the best way to go for now. But at least we have something to play around with. I never realized the possibilities of shader mixer.
Just a note:
By default, DAZ Studio will render normals forward regardless of what they are on the model itself. While this is useful for rendering in DS, if you export your scene to Lux Render, then the normals will be facing the same as they are on the model itself.
Poser will not render normals forward by default. You need to go to the Material Room and on every surface, check off the "Normals Forward" box near the bottom.
Thanks but I don't know that I am clever... Some of the permutations I try just accidentally work once in a while haha.
Feel free to use that network any way you like. I'm happy to contribute. If it weren't for you and others posting networks here in the forums I don't know that I would have ever figured out how to use Shader Mixer.
Funny how it is, that some of the carefully planned out, look like they should work on paper and follow all the 'rules' ones don't seem to work right, but the ones that you stumble upon on the way to something else turn out to be gems?
I've always felt that messing in SM is more 'art' (as in the arcane type) than 'science'...sort of a digital alchemy.