Jump to content
3DCoat Forums

Multilayer shader support


3DArtist
 Share

Recommended Posts

  • Advanced Member

As I was working on this velvet-like shader, it made me realize how flexible "multilayer shaders" could be. Currently the velvet shader is a combination of picmat and the cube-mapped texture shader. It also uses a separate image for the environment/reflection that it applies over the underlying layers and vertex paint (via screen transfer mode). Try painting black on any "reflective" picmat (Gold, Nickel, Silvery, etc) and the reflection disappears.

132685393152.jpg

On the right is the stock PicMat_Silvery and on the left is the modified version applying a second "reflection" layer over the picmat and vertex color.

post-631-0-99533200-1326858153_thumb.jpg

An idea for a multilayer workflow would be: (example: to create a matte material base with shiny vertex paint, environment/reflection map modulated by a falloff picmat)

1. Select a multilayer enabled shader

2. To set a picmat base color, Right-click on a shader and click "Assign to Slot 1" in the menu.

3. To set a picmat to influence just the vertex color, assign it to slot 2.

4. Assign an environment/reflection map to slot 3

5. And assign the falloff picmat to slot 4.

Each of these "slots" act like the CustomSampler in the shader code. So assigning a shader to a slot, renders that shader and sends the image to the multilayer shader as "SlotSampler1..2..3". then the multilayer shader combines the slotsamplers however it wants to for the final output on the model.

And have options to save and load the "slots"

Also, organizing shaders into folders would be very useful and breaking out the shader settings dialog box into a regular palette.

Link to comment
Share on other sites

  • 2 weeks later...
  • Advanced Member

On a simpler note, I've been brainstorming on some "simple" features that I think will help alot with working with shaders, rendering in 3DC and compositing in an external app.

1. As mentioned previously, making the shader settings window a palette for quick access and unobstructing the view of the model.

2. Add Save and Load buttons to manage multiple textures and settings for each shader and for easy sharing between objects. These settings and files (variables.xml and only the images that are different) can be saved in subfolders in the shaders folder. Add a drop-down menu (top-right of palette similar to brushes palette) to select any subfolders (presets) in the current shaders folder. Also add an Export button to export the current preset as a standalone shader.

3. An option to Link the multiple objects shaders together, using all the same settings and realtime updates. Useful for objects with the same surface but many parts. Either by right-clicking on another object and selecting an option in the layer menu to "Link shader to selected" or "Share shader with subtree" or some other way.

4. Global variables for Variables.xml. Right now a variable is defined by <ID> tags in the variables.xml and is only visible to the current shader that is using it, add something like <GID> and make it "global" so that any other <GID>'s with the same name in other used shaders mirrors the number/texture. This would be useful for mirroring only specific settings between shaders (i.e. environment map, picmat/lightmap, spec settings, fog etc) but allow for the other settings to work independently. Other uses (and maybe more important) would be to easily enable/disable render passes (depth, spec, vertex color, shadow/diffuse, normals, object id, etc) for all objects in a single click (if a checkbox control was added).

Other ideas posted in Mantis here.

Link to comment
Share on other sites

  • 1 year later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...