Is it possible to bake Screen Space effects to vertex colors?


this might be a weird question, but since some time i am looking for a way to get a curvature or edge shader in UE, that works with raytracing. So far i was only able to find solutions for screen space. And i know, that there are programs, which can do that, if you have proper UV sets, but that is the other part of the problem ^.^ The models i have in mind, either have no proper UV sets, or they are garbage don´t work very well. I also have no way of generating those proper UV maps, cuz those models would be high poly, so that you need a dozen to hundreds of UV sets to cover the whole models (think about Star Destroyers and their superstructure, have a model, that comes with ~75 UV maps + the necessary textures, and thats just a small Venator, not a Super Star Destroyer). Basically, i am looking for a way to get those curvature dynamically, without being tied to UV maps.

The one constant of all meshes are vertexes, those can be colorded intependent of any UV map, they are always at the same spot and where they need to be. Since we have access to vertex colors, my idea was to find a way to bake the curvature into the vertex colors of the mesh, and the rest of the materials would be applied f.e. via triplanar mapping. And we can paint vetex colors in UE4.

However, the only curvature shaders i could find, were all screen space, and that does not work with raytracing reflections. Sooo big question: Is there a way to bake this screen space effect into the vertex colors, so that they then stay there permanently and then afterwards would work with raytracing? Cuz once baked, the screenspace effect would no longer be needed, and the material would get it´s mask infos from the vertex colors.

This is one of those screen space shaders:

And in know, that there are external programs, that could do that, (f.e Cinema 4D since R18 and upwards, but i just have a R15 without access to vertex colors :confused: ), but i am looking for a way to do it directly in UE, if possible, without the need of external (expensive) programs.

Ooorrrrr, if someone have a better idea for this… ^.^

Usually you don’t have enough to write curvature into verticis.
either way, without using a scripting program to do it you won’t be able to.all that curvature is, is the angle fromed between the vertex and its 4 adjacent verticis expressed in a 0 to 180 normalized value.

I have yet to find a way to truly manipulate or iterate verticis over a shader.

You could try using something like vertex normal, and a pixel interpolator to display the result on base color.
Move from there to figure out what to dot/cross to get something that looks visually similar to the mask you need…

Aye, ok, i stumbled across something, that looks somewhat promising, and actually for free. Blender got an addon, that enables you to bake to vertex color:

Now i try to figure out Blender… again… :confused:

Zbrush will do this too, for what its worth