Layered Shaders

   6226   8   1
User Avatar
Member
245 posts
Joined: Sept. 2008
Offline
Hi. I am trying to wrap my head around Peter Quint's vimeo tutorials:

http://vimeo.com/12547985 [vimeo.com]

I can't seem to figure out how to create a Layered shader. I have 3 shaders as PNG files that I created in Photoshop, 512x512px resolution. A, B, and C. A and B are the letters A and B on a background with a color while C is on a transparent background. Initially OpenGL wouldn't even render any materials in the viewport. I think I was even having problems with UV Quickshade. However I know you can't use UV Quickshade to render a material based on P. Quint's tutorials. So I tried to use the Layer SOP and create UV Projects on different Layers. I also grouped different primitives within the Poly Mesh primitive that I created to test my layered shader. No dice. Do I have to go into the SHOP Vops to do this type of thing?

Sincerely,
markerline
User Avatar
Member
53 posts
Joined: Aug. 2009
Offline
Yes you need to create your own VOPs shader to take advantage of multiple layered textures. Make sure, however, that that is really what you need to do. If you write a shader that combines different textures at render time then the calculations for combining the textures will be done for every single sample. It may be more efficient to, e.g. combine the textures in COPs. You can usually achieve a great deal by good use of the colour, reflectivity maps.

If your model is polygonal and you want different materials on different parts you can use the material sop to give each part different materials, or material parameters.

A case where this won't work is, for example, where one of your texture components is procedural and based on point coordinates - a 3D noise function, for example. In that case you will need to build your own shader. The tutorial I did on materials in H11 gives some examples of doing this.
Peter Quint
User Avatar
Member
245 posts
Joined: Sept. 2008
Offline
Thank you for your response Mr. Quint .

I am trying to figure out based on the vimeo's that I saw on your channel that I can actually apply COP's to a material shader or Material SOP. What is the easiest way to do this? (Or perhaps refer me to the specific video that talks about this). As it stands I recall that COP's can only be applied to UV QuickShade, not an actual Material SOP. Is QuickShade what I want to apply a COP texture?

-markerline
User Avatar
Member
245 posts
Joined: Sept. 2008
Offline
Thanks again Mr. Quint for your vimeo tutorials on H11's material building. I will have to go back and watch previous vimeo's for H10 and/or prior for a more in-depth understanding of how shaders are built. I still wish to know from anyone reading this thread whether it is possible to use UV Quickshade to render a material properly using COP's. I have not had success with this and I may be doing something wrong. I have also had difficulty with OpenGL shading of textures on objects in the scene (depending on which workstation I am using).

Any more indepth information regarding this topic is greatly appreciated as I wish to continue learning how to build layered shaders in COP's or otherwise with Material VOP's .
User Avatar
Member
245 posts
Joined: Sept. 2008
Offline
I am happy to report that in H12.1.185 I can use a combination of Layer SOP, UV Project SOP, and UV QuickShade to display textures on NURBS as well as POLY MESH objects (spheres).

I haven't quite tried to create a true layered shader in COPs but I suppose I could create one and write it out as a texture and each time I need to make an edit to the texture placement in layers write out a new texture from the COP editor and load that into UV QuickShade. That seems to be the simple workaround for now.
User Avatar
Member
245 posts
Joined: Sept. 2008
Offline
I can verify that the following syntax works in H12.1.185:

opimg/img1/OUT

where OUT is a null node in the COP editor. This means that I can now apply materials to UV QuickShade quite easily. Not sure if this works on the Material SOP. Will have to troubleshoot. However this syntax was not working on the H12 version I had prior to installing the latest H12.1 .

Will update again soon. Thanks.
User Avatar
Member
245 posts
Joined: Sept. 2008
Offline
Okay so I made this discovery:

If you take a NURBS sphere and carve it so that you have 2 primitives and apply Layer SOP, UV Project SOP, and Material SOP with 2 distinct materials and 2 distinct Layers and 2 distinct UV Projects, it will not display 2 distinct materials on the surface. Instead it takes the last Material in the stack, in spite of having Layers. However if you take this same sequence and append a convert SOP to convert to Polys prior to doing the operations you can in fact layer your shaders quite nicely.
User Avatar
Member
53 posts
Joined: Aug. 2009
Offline
The Layer SOP simply allows you to create two or more sets of attributes on a surface. It does not of itself allow you to place two materials.

I don't work with Nurbs that much, but I think that the carve sop works by using trimcurves, so even after the carve you will have just one primitive. You will therefore get just one shader. If you convert the result to polygons and create two different primitive groups, then the material sop should work.
Peter Quint
User Avatar
Member
245 posts
Joined: Sept. 2008
Offline
I see about the layer SOP. I'm new to that particular node so I guess I misinterpreted what I saw in the vimeo vid.

The carve SOP can in fact create more than one primitive, in particular if you select the checkmarks for both “Keep Inside” and “Keep Outside” and if you successively do this for several Carve SOP nodes then you will have multiple NURBS primitives if you are carving NURBS and depending on your carve parameters. But your explanation stands to reason that you would still get only one shader I guess because the parametrization of the surface will only read once per operation and not multiple times as with polys and groups, even if you have multiple groups for the carved NURBS.
  • Quick Links