We are making progress with our hard surface scene, but without a proper raytracing engine, it’s difficult to get proper separation between parts of the model.
So my “code guy” @paleRider and me are seeking for solutions.
Something I use a lot in VFX works is “roundCorners” effect.
In case you don’t know about it, it’s like beveling mesh hard edges but at render time, not modeled.
So, the object itself is still simple (low polycount) but appears as complex at render time. You can see how it is done in MAYA with Arnold engine here.
Without the effect:
With roundCorners applied:
I know BabylonJS is not able to do this right away. But it would be any chance to create via the node editor or any other way?
@joie I would guess the best way to accomplish something like this is create a post process node material that runs a sobel-type edge detect on the scene render and then use that as a mask to add a reflection color into the edge mask. However, this is a more expensive route to take because you are doing 16 taps into the render target texture to blur the image and generate the mask.
The much simpler and more performant path that does not need a post process shader to fake in edge detail would be to use a normal texture. This is baked from the delta between a high-resolution mesh with edge beveling and a low-resolution real time asset.
All of our standard materials and PBR materials are written to handle a normal texture and so your surface normal will be perturbed by the normal texture and result in edge highlighting as above without the need for the high-resolution mesh. An example of this can be seen in our Flight Helmet model, especially in the leather material. The normal texture is responsible for all of the surface perturbation of the low poly surface to reflect the light.
You would also have more control over the final render if you are able to determine where edge bevels are rather than relying on a post process effect.
I haven’t tested it thoroughly on complex, realistic scenes but the (not yet well documented) screen space curvature post process effect borrowed from Blender could provide an approximation of what you’re seeking. I think it works best on stylised scenes and for accentuating model topology when modelling in Blender, but applied with subtle settings to a realistic scene, it could provide a nice, subtle rounded effect to sharp edges. Not physically accurate I know, but relatively cheap and easy.
We can’t use that solution because our model has hundreds of pieces and don’t want to use giant texture to cover that effect. We would need dozens of normal textures, not viable.
Yes, we are using that curvature effect and looks great…, sometimes. Because there are places where it doesn’t appear. It doesn’t work as good as in Blender. And in fact it is not and effect like the roundcorners. The roundcorners effect just smooths the normals of hard edges with desired radius.
I suppose the effect can’t be achieved.