Render vertex color and albedo

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By bethleem

The setup is: one single scene with one copy of each object in it. Each object has a mesh. This mesh has a texture and also has vertex color information different as the one from the texture.
The goal is some method that allows to compose a final render with:

  1. a pass that render the albedos (textures) in a viewport (easy, is the deafult behaviour).
  2. a second pass who renders not the albedos but the vertex colors of the meshes in order to do some calculations over them and add some details to the final render. It needs to be done over the viewport becasuse this details are view-dependent. (Something like but no quite this thread: )

Is this even possible in godot? I was trying some aprroaches but did not get how to access the mesh-vertex-color info once it has render the albedo in the first pass. Same if I render first the vertex color, then I´m not able to access the albedo. Any ideas?


I don’t believe you can natively render different “data” out of the same materials. The only (hacky) ways of doing this I can think of would be to either do a second render after having put a unshaded-vertex-color-to-albedo material override on all meshes in the scene or do a second render but this time using duplicate meshes on a different layer.
I don’t know for sure if this is impossible in 3.x.
I believe things have improved in that regard in 4.0? Not sure.

I can’t do much more than that, sorry. Good luck!

Lola | 2021-09-25 14:36

Yep, the duplicate-all-objects-with-different-shaders appears to be the only solution in Godot, at least in 3.x. Very bad in terms of permonance. :frowning:

bethleem | 2021-09-26 10:46