Fast fake diamonds demo - part 1

Hi guys!
I had a quite annoying debate on diamonds and overall approach today here on the forum with a gentleman (EDIT: I think it’s a lady) and I got frustrated, just tried him to help, but… I’m not going to tell his name, if you want, you can look for the topic :smiley: No, it was not @simon :stuck_out_tongue: we are already friends, I hope so :stuck_out_tongue: :diamond_shape_with_a_dot_inside:
However I decided to create my own diamonds, only with reflections, no refractions. Just wanted to try how fast and far can I get alone with the help of the BJS Documentation (he/she was complaining, that the BJS docs are poorly written) , YouTube and Google.

If you are going to work with the NME, you must watch @PatrickRyan’s cool videos on PBR nodes! Thanks Patrick! That’s what I did and created a very basic diamond shader. Actually the first part was enough to watch.

Please note, that I started to work with NME only a few days ago, so I am in the learning phase.

NME:
https://nme.babylonjs.com/#KIUSWC#6

and a PG to show the results:
https://playground.babylonjs.com/#U07HYC#1

I believe, this is the most basic setup to achieve very fast diamondly looking objects :smiley:
No refractions here, no lights, … They are coming in the next part.

Hope you like it!

R.

8 Likes

Beautiful :smiley:

1 Like

@gbz I have this sticker on my notebook’s bottom side:

:handshake:

5 Likes

Welcome to the forest of node trees)))
:evergreen_tree: :evergreen_tree: :evergreen_tree:

1 Like

Hey I am so proud of myself. I inserted and connected a color node. Now we have a gold plated surface! :slight_smile:


image

You have to start with small steps. In the beginning, the new seems so complicated.

Friends, can you tell me how you got started in this topic and what basics are needed to get along with it?

1 Like

Hi @Necips!
The first thing you need is a diamond model, obviously. :smiley: Grab one from the hundreds of available for free :smiley:
The most important part is to generate a caustics texture. There are free generators available or just download one. You need to shift the R, G, B channels of the texture (actually only R & B, G stays at offset 0,0). Let me know, if you are not a Photoshop geek and I’ll explain how to do it). 3 to 5 pixels offset gave me the best results. So R layer is at (-x, -x) and B is at (x, x). Use the resulting image as the reflection texture. Maybe there are caustic generators with the channels already shifted available. In your code just assign the node material to the model and That’s all.

EDIT: hey, share your GOLD (material) dude! :smiley:

:vulcan_salute: R

2 Likes

Thank you, Roland!

We newbies simply lack more video tutorials. How nice would it be to simply record the work of a pro as a silent movie and upload it to youtube at a faster speed rate.

To see is to understand. Words are hard to grasp especially if you lack the nomenclature to do so. I didn’t even know these types of images were called “caustics texture”:

I did already shared my golden material - as an addition to your foodsteps! :slight_smile:

I am working on the refraction just right now, the diamond starts to look cooler and my node tree scarier :joy::joy::joy:

Save it next time :sunglasses:

@Necips
This one is working for me: https://www.cathalmcnally.com/doc/news/caustics/CausticsGenerator_v1.4.zip

It’s a bit tricky to set the parameters, so here are one of my settings:

Thanks, here is a set of little funny animations to give you a smile for all your work and help:

You can get such images faster with GLSL:

PS: Sorry for that flickering. They have changed the playground. Here is the original I forked from:

PPS: What do you think to use this shader as material for the diamonds? Ideal for a salvaged treasure chest full of diamonds, pulled out of the depths of the sea on a swaying boat… :smiley:

This moment:
image

EDIT:
This was cool! :smiley: Thanks! I try to choose a favourite one, but all are awesome and true :smiley: :smiley:

@necips trying to private msg you, but seems you disallowed that function.

ok, fixed. try again. :slight_smile:

Hey ~ roland, I saw this while browsing sketchfab

The diamond has some planes inside to make it look fuller. This may help to improve the visual effect
This is in the sandbox


(You’re doing something great, as always. I’ve seen people talk about it more than once. Looking forward to the Part 2 )

Hey @musk!
You must have been peeking me the last night, because I was preparing something similar😂 however I don’t 'want to use inner structures, everything is handled by the shader itself, so you can apply it to any mesh. However I will definitely check this model after finishing the shader. Thanks a lot!

I will post a demo shortly. If you are interested and because you handed me this information, I think you definitely are, I can send you a preview of what is already done in private. Wanna see now?
:vulcan_salute:

R.

1 Like

COOL! This is definitely not what I want to miss :grin: