is it possible to test a lithophane in Babylon using light?
I am totally unsure what a litophane is @PatrickRyan might know ?
It feels like Mastering PBR Materials | Babylon.js Documentation could do ?
@Anda_Interaktif, to get a render like that in real time, you would need to author a thickness map and then use that with transmission in our PBR material. I’m not sure what you mean when you say “test” the lithophane, however. If you are planning to 3D print the lithophane, I don’t think any real time or even ray traced engine will give you a proper test result as the material you use will impact the thickness of the print you need to block light transmission. Any real time or ray traced renderer relies on you to set the parameters like transmission or provide a thickness map as part of material authoring.
Not sure if this actually answers your question or not. If it doesn’t please let us know what you are trying to achieve with this effect? Is it previs for something that will become a real object or will this asset only be digital, in which case we just need to set up the material correctly for light to be transmitted?
First of all, I would like to thank you @PatrickRyan for your reply and @sebavan for helping me reach you.
I think testing is the wrong expression. I want to present a model that I converted with photogrammetry on the web, but I intend to use a relief with a low-resolution image in the background.I thought lithophane was the best way to go about it.
I tried it in the blender to get the best effect.Here are results;
now i am trying to learn how i can achieve the same effect with babylon.
@Anda_Interaktif, the way I would approach what you want to do would be with a custom shader on the background mesh that just dials down the light on the mesh. That way you get the same lighting direction as your foreground mesh, but have control over how much light is contributing to the render. This is what I am talking about… a simple shader that takes advantage of our PBR rendering but adds a scale into the calculation to help bring down the amount of light on the object:
You can see that the base color is bright red, and there is a simple float that is scaling all of the diffuse and specular outputs of the PBRMetallicRoughness node. Note that these outputs are in linear space and the fragment out expects gamma space, so selecting the fragment out you will see a convert to gamma space toggle. This gives you full control over how much light is contributing to the render:
This is the simple version of the shader without hookups for textures so you can dissect it. If you do not have experience working with our node material, we have some tutorials specifically on the PBRMetallicRoughness workflow in node material.
You could expand this basic version to independently control the direct and indirect contributions of both diffuse and specular components to really dial in your render. I hope this helps, but if you still have questions, please feel free to reach out.