GhShaderNodes + Raytraced + Rhino 6 / 2018.05.03

A quick video how to get GhShaderNodes for Raytraced in Rhino 6 (SR 3)

Steps:

  1. Start Rhino
  2. Open Grasshopper
  3. Load all_shader_nodes.gh (36.2 KB) into Grasshopper
  4. Grasshopper will notify that some components couldn’t be found. Note the Install button in the bottom of that dialog. Click it to install GhShaderNodes
  5. Restart Rhino
  6. Reopen Grasshopper
  7. Create a shader graph with the components under the Shader tab, add at least an Output node
  8. In Rhino run _TestShowPrivateContent
  9. Add a Cycles XML material
  10. Select the Cycles XML material in the Grasshopper definition through the context menu of the Output node
  11. Assign the material to an object in Rhino
  12. Switch viewport to Raytraced
  13. Tweak shader graph

And one how to combine the GhShaderNodes material with GH geometry in the Raytraced viewport

  1. Make sure you have done the above
  2. Create some GH geometry
  3. Add Custom Preview component
  4. Pipe your GH geometry into the Custom Preview component
  5. Select the Cycles XML as the input material
7 Likes

Caveats:

  • No cluster support (yet)
  • Limited accepted/understood GH component inputs: number slider, colour picker object
  • Only beginnings of multi-shadergraph-with-one-output-definition (i.e. connect two different colour picker objects into the same BSDF color input resulting in two different materials)
  • Not all Cycles nodes have been wrapped. If you really, really, really need one that isn’t there yet, request it

Hahahaha, applied several materials without previewing and then switched to RT. BOOM, Rhino crashed. :sweat_smile:

Now I have another question. Is there possibility to get Cycles XML material to preview in Renderred mode? Default Rhino materials works in both modes, but Cycles specific only in RT.

In Blender 2.8 it’s great to have same material in Cycles and Eevee (with small tweaking, especially for glass material).

There’s totally unlogical thing. Why not to connect material input in previewer node, just link material by node’s RMB menu?

1 Like

There is a reason why it is still behind a test command. Please find the RhinoCrashDump.dmp file on your desktop and upload to Rhino - Upload to Support with nathan@mcneel.com as recipient.

In the future, at some point I’ll create a translation to GLSL.

Historically GhShaderNodes came before the bottlenecked Custom Preview for Rendered, Arctic and Raytraced. Since this tool was created initially to help me create the conversion graph from Rhino materials to Cycles shaders, therefor there was no need to make the output of Output into anything other than Panel. No doubt eventually integration and workflow will be improved. But that is for v7.

Sent RhinoCrashDump.

Nice! Looking forward! :wink:

@nathanletwory I detected what seems a little bug in Principled BSDF component: Subsurface Radius and Subsurface Color seems to have the names “truncated”

You don’t see this?

image

@LukaszKosciesza, can you recreate the materials as you did prior to the crash, save the GH and send it to me? Did you use any polish language characters in your naming of components?

The message I see here is Podczas analizowania elementu Name nastąpił nieoczekiwany koniec pliku = An unexpected end of the file occurred while parsing the Name element. It’d be good to have the file that caused to create bad XML.

Yeah @nathanletwory , but I guess that ‘radius’ input is expecting a color , and ‘color’ input a number.

The component works as it should. Subsurface takes a number [0.0..1.0] (from fully off to fully enabled).

Subsurface Radius takes a vector \overrightarrow{v}, but a color will do to. The constituents of \overrightarrow{v} each control how much the Subsurface Color gets applied essentially, again each with a domain of [0.0..1.0].

Subsurface Color takes just a color (but a vector will do, too).

principled_sample.3dm (81.1 KB)
principled_sample.gh (16.5 KB)

image

my apologies, I guess I have had some confusion with this.

That is ok, part of the learning process :slight_smile:

Nice icons now, but I still have no idea how to get/rebuild any of the materials shown here:

An example would be highly appreciated.
Good examples of commonly used materials are the best way to understand and learn imo.

I tried this, doesn’t look like anodized aluminium to me: shader-nodes-test 01.gh (9.9 KB)

It looks like you need to set the metallic node to “1”, it should look much better after that!

1 Like

This video might be helpful to everyone that isn’t already familiar with shaders in cycles. At a glance it looks like @nathanletwory has the majority of this stuff implemented, so hopefully any minor differences don’t create more confusion for everyone.

2 Likes

indeed it does! thanks.
but not quite there jet. what about the “couldn’t read verctor” warning, which vector? the normal from the surface? what if it is not a flat surface?

I’m not sure what that warning is referring to, the surface normal or maybe something to do with the mapping maybe? I can’t think of a reason that it would be effecting the output though since there’s no texture image or displacement.

well displacement is what I want to do. The material I try do make is aluminium, bead blasted and then anodized.

Hmm, I’m not having any luck with bump or displacement for some reason. I was able to make something that looked decent, until the rendering cleared up and made it look perfectly smooth. Most likely user error :disappointed_relieved: