Lighting and Material

Hi all,

Just discovered this - super exciting!

I was testing out some simple geometries but somehow I kept getting geometries that are rendered completely dark/black, seemingly with not light or materials.
I’ve tried putting a standard directional light on and exported both the geometry and light as an Iris HTML file but still doesn’t seem to work - feeling like I might be missing something really simple…

Files and screenshot attached.
cube_test.3dm (177.0 KB)
cube_test.html (4.9 MB)


Iris doesn’t know what to do with that metal texture or any of the “procedural” materials. Best you can do is add a custom material with an environment map for reflections.

Here is your geometry with the default custom material:

1 Like

Hi Luis, thanks a lot for the response, and yes, that works - I should’ve tried that as well, sorry!
Two follow up questions on lighting and material if you got any advice/tips:

The default without any custom light (point/directional etc.) will result in your second screenshot where the overall light is coming from the “back”, while any custom light seems to result mirrored against the XY plane (as visible in the three.js editor)?

When I tried to assign vertex colors, as a quick test to the workflow you presented in the gallery thread (Iris Gallery),
I can’t seem to be able to export and have been running into an error
(I’ve tried welding the mesh after the conversion from subd, which indeed does reduce the vertex count, but encountered the same error):

Current RH and GH files attached below:
cube_test.3dm (291.4 KB) (19.1 KB)

It seems both of these are bugs. The first one in the 3dmLoader for Three.js where we might not be bringing in the lighting orientation correctly, the second is a bug in Iris. Since Iris is no longer actively developed, I can’t guarantee we’ll fix the vertex color issue.

If you bring it into the threejs editor the vertex colors come in fine:

1 Like

Hi Luis, thanks for your response!

Lighting in my opinion isn’t a huge issue as one would only have to know/anticipate how it “flips” and adjust accordingly; however, the vertex color issue is a bit of a shame as it takes away the potential to allow more complex geometries/patterns to fully take advantage of this tool and represent the capabilities of rhino/grasshopper in HTML…

Regarding the threejs editor, could I export it to HTML from there? I don’t seem to see a compatible option. Are there any other workflows/methods you’d recommend to look into for the purpose of interacting with 3dm geometries in web browsers?

Thanks a lot again!

You can use the publish feature of the threejs editor. You can preview what this looks like by pressing the play menu button. When you publish you get a zip file with all of the files needed to view the scene, though there are no controls for orbiting, etc.

The vertex colors bug is new. I will need to test to see what is causing it because it is something that definitely worked before. Hopefully I can get it looked at in the next few weeks.

1 Like

got it, thanks again!
i realized when using the publish function, it’s a bit different from the HTML from iris where all the needed data is already written into the HTML file, instead, the HTML reads the JSON.
will test it out further - but looking forward to when you get a chance to take a look and update, thank you!