GH Shaders - Creating Bi-Color Glass

G’Day all! Any help would be appreciated! I created a bi-color glass in Blender Cycles— and trying to recreate the material in Rhino Cycles using GH Shaders via Cycles XLM materials. Not sure if I’m going about it the correct way or if there is a better option. Tried normal and PBR materials, but no luck. Any help appreciated!


Bi color GH.gh (10.7 KB)

So essentially you are trying to create a gradient material for the diffuse/albedo channel and an overall material that has translucency & reflectivity (glass) is that correct?

Pretty much! Ideally a gradient between two colors, diffused over the geometry, not texture mapped would be ideal-- with glass like properties.

Side note-- your Portfolio is astonishing!

1 Like

I don’t have the plugins you are using but I was able to create a Rhino gradient glass material, and then apply that to some test grasshopper geometry via baking in the new Rhino 8 material nodes/baking component.

Query the rhino gradient glass material via name and apply that material via “Model Objects” “Render Attributes” input.

Unfortunately the ability to modify physically based or more complex material settings from within GH does not seem to be a complete feature set. Exploiting the Display tab’s “Create Material” (egg shaped icon) we can actually set the opacity of our new material from within GH.

However, we cannot set the Roughness, Reflectivity, or Shine unfortunately so we end up with the gradient glass material showing up fully Rough each time and would have to manually adjust the the Roughness value in the material which obviously defeats the point of automating this gradient glass material creation.

Rendered Mode:
image

Raytraced Mode:

After adjusting the Roughness parameter manually:

You can see we can set the Opacity (B) from within GH but not the Roughness (A)

Perhaps the plugin you are using can modify the materials in the needed way and then you can try baking that material with the Rhino 8 nodes?

PS: Thank you very much for your kind words about my portfolio! Let me know if you or another ever need my/our services! :grin:

EDIT:
Actually trying to see if we can achieve this with a python node, here’s a split out topic about that specifically:

1 Like

I am using the GH Shaders node that @nathanletwory created. I will try what you suggested! Here is the GitHub if interested-- he mirrored a lot of the Blender nodes into GH, for implementation into Rhino Cycles.

Great idea. Never crossed my mind to Py script it. Ill play around with it! Thanks so much!

Thanks for sharing! I’m a total python newbie. I know you can reference document materials and modify attributes I just don’t know to what extent and what methods to utilize.

Trying to learn though! Please let me know what you find in your explorations!

1 Like

Getting closer but I cannot seem to Diffuse it over the entirety of the object. : (

My head is hurting…

GH_Gradient_Test.rmtl (27.6 KB)

1 Like

What UVW method are using in the object properties?

No matter which Mapping type I choose, it will not map as anticipated. These are a good example of the end result I am trying o achieve.

Maybe silly question after what you just said but did you try spherical mapping? Even though that is counter intuitive given the geometry shapes of your examples.

I was able to get it map correctly earlier so I can take a look later and see if I had any special settings, repeats, offsets or anything.

I think I had to set an offset that matched the distance of the bounding box of the geometry for it to map the gradient correctly.

1 Like

Not sure if custom shaders are necessary here. That approach is more complicated than it needs be.

Just put in a color gradient in basecolor (either image file or gradient texture) and apply a planar mapping to your object that covers it completely.

I covered this in the tinted glass post: Creating a tinted gradient on a glass material in Rhino .

The planar mapping for the colored glass in this post:

And here one with a 512x1 px image created in GIMP using the pastel rainbow gradient (this is probably the easiest on the rendering and memory usage)

The gradient image file:
pastel_rainbow_gradient

If you want to learn about scripting the creation of PBR materials, you could have a look at some of my literate scripts: https://jesterking.github.io/rhipy/ . There are a couple that should get you started.

1 Like

And this is why we bow down to your wisdom, @nathanletwory! Appreciate the response and gave it a try!

Was able to generate the gradient on with you workflow, but on mesh objects, it blends a color. Any ideas?

Did a little more digging- unwrapping the mesh is the only way to get a PBR to map correctly. Was trying to just make a material that I can apply simply w/o unwrapping. Any ideas on that?

2 Likes

I would make the planar mapping a bit oversized, not right on the edges of the mesh. That gives nicer result for your box for instance.

1 Like

@nathanletwory - Out of curiosity, will the GH Shaders be ported to R8 WIP once it goes live?