How to send data between shaders?

Hi everyone! Is it possible to send data between diffirent shaders? For examle: I need to send vertex position from current shader to fiew another shaders, how can I do this?

Short answer: you can’t.

Longer answers:

  1. use a compute shader and read back (slow)
    or
  2. write vertex positions as float into a texture and read the texture (slow)

GPUs are designed to be pretty much one direction, ie an instrument you instruct. You can get stuff back from it but it’s really quite slow to do so.

You also have fundamental misunderstandings, shaders do not contain vertex position or other information. The GPU would temporarily be holding this as it renders. Shaders are merely instructions for how the GPU should behave.

You should let us know what your real problem is as you’re asking for the wrong things.

I’m trying to implement custom realtime per vertex AO/GI. Idea is using invisible low res models(AO/GI caster) which looks familiar to working visible models. So every vertex position(translated in to world coordinates) of low res model should be used for calculation virtual per vertex lights in shader of the object which is AO/GI receiver.
I guess it’s possible to understand what write, because my English is quite far from good))).