OpenGL diamond is almost invisible

unhandled

#1

Hi @jeff, is there anything you can do to make glass and the gems stand more out in OpenGL?

As you can see it is almost invisible now:

And if you compare it to raytraced then you see how well OpenGL handles shiny objects and shadows so it would be great to get at least some more reflections.

Is it possible to implement some environment map refraction like they show here:
https://learnopengl.com/Advanced-OpenGL/Cubemaps

Or could you refract the entire scene in an efficient way?


#2

glass and diamonds are almost completely invisible in the mac version either.


(Jeff Lasor) #3

@Holo Rhino already supports cube mapping and has for years… The article you point to is a bit of lie… All it talks about is the environment, that’s it…until you get to the very end, where it mentions rendering the entire scene 6 times from the point of view of the object (for EVERY refractive object)…which will bring things down to a crawl. I could easily just refract to the environment (background), but that’s not going to look very good…it might in your simple ring model, but for other layouts, refracting only the environment would be less than desirable (IMO). The real solution (IMHO), is to draw refractive objects last, one at a time, from back to front, and capture the frame per rendering, passing it back down to the shader to be used for the next refractive pass… that will be pretty fast, and it can give better refractive results…except you won’t be able to refract to things outside the viewport…but who cares, it’ll be close enough :slight_smile:

I am planning on doing this very thing…I just haven’t found the time yet to do it.

-Jeff


(Jeff Lasor) #4

P.S. That’s not OpenGL handling the shiny objects and shadows… It’s all Rhino and our shaders :slight_smile:
-J


#5

Nice, I’ll look for it in the next wip then :wink:

And cudos to your shaders, they are absolutely stunning and you guys have done a great job! It’s stable, fast and helps me do my job better and faster and I would never go back to using V5 for this reason alone. (And for other reasons too, but you get my point)

Oh, and yes, I figured it was a simplified environment only refraction, but I hoped it could be used to get the point across. And i guess a workaround could also be to make a per object environmentmap and refract that, but your solutions sounds vastly superior!

Thanks for taking the time to explain!


#6

Oh, and something seems very wrong with glass reflection though:
It only has the fresnell effect, but no environment reflection at all:

image

And below I added two transparent spheres with custom materials, the first of them has 100% reflectivity and 90% transparency, number two is 100% transparent and then the surface reflection is 0%. That is too little IMO. (It might be accurate, but it’s not good for a visualization)
And if I toggle on the fresnell transparency then the environment reflection disappears.

image


#7

Another thing, transparency color is ignored in OpenGL, at least if I convert a “Ruby” gem material to Custom. And does not show even if I lower the Transparency value.

First I turned off the Fresnell effect.

And if reduce the reflection value then the transparency color is gradually appearing:

And could you revisit the idea that 100% transparency does not have any reflection?
Imo that is not more true than “If an object is 100% reflective it can’t be transparent” so I don’t think either is right and therefore if both are sat to 100% we should both get 100% transparency in areas with 0% light reflected and 100% reflection (and thus 0 transparency) in areas that reflect pure white light with an rgb value of 255,255,255.

I’ll be happy to make some images to explain the logic if needed.

or maybe better:


(David Eränen) #8

@Holo,

Could you send us the ring model?

Thanks
-David


#10

Yeah, sure, it’s just very simple geometry made for render testing.

Diamond ring simple.3dm (2.2 MB)

I see that the IOR value is linked directly to the reflection value, here I turned “Ruby” to glass (or set it to custom if you like) and sat IOR to 1, 2 and 3:

And a bit OT, but related: As you can see OpenGL totally ignores the reflection, both with Fresnell turned on or off, and also affects the color even if it isn’t altered.
(It looks horrible so I think it is worth bringing up again)

Edit:
And here is the renderball file. I saved it with “save textures” so check if the environment works. If not I’ll send that as well.

test RenderBall.3dm (2.7 MB)


#11

Oh, and try to purge that file, it should only be three materials there, but even after purge it is many to choose from in the object properties, material tab (But in the materials panel there are only a few) so why is it “remembering” so many materials? (I am on the release version of V6)


#12

I remember that there was a “similar” issue in Rhino5 with Vray and to get rid of those hidden materials you needed to purge the plugin information contained in the file. We noticed that after seeing the file size increased exponentially in very particular circumstances.