I am writing a shader and I would like to use some special values for the precomputed realtime GI. I am using a vertex fragment shader as it seems that it offers much more controls than a surface shader.
Unfortunately it doesn’t seems possible as the data used in the meta pass are static, I mean they come from the static textures used in the material and the colors or values transformation applied.
As an example, if I make some modification on the self-illumination value in any other pass other than the meta pass, the result is not applied.
Is there a way to use the data calculated in the forwardbase pass or forwardadd pass or from any other pass ? Is there maybe another way to do that maybe using Command buffers ?
If someone could give me a clue it would help me so much because for the moment I don’t see any way to do that.
Thank you very much.
Thank you @KEngelstoft
I am also wondering if there is an easy way to transfer the results calculated in the forwardbase, forwardadd or deferred pass to the meta pass.
The only way to do that in my opinion is to use a new buffer but this will result in calculating the lighting twice and constrain it to screenspace, no ?
To make it quick do you have any clue or idea on how transferring the lighting data to the meta pass (deferred and forward). Because I am trying to send my translucency results calculated in forwardadd and deferred pass to the meta pass.
You should render the translucency information into a render target and sample that as a texture in the meta pass. That way you don’t have to do the lighting calculation twice.
@KEngelstoft Could you be a bit more explicit about the process of using a render target to sample the result of the forward or deferred lighting pass in the meta pass ? I’ve already tried render target but I didn’t really dig into it and I didn’t achieved to make it work. I also didn’t found any tutorial about it.
Just to know, the result will be in screenspace so, everything outside screen won’t be taken into account.
Remember that the meta pass is running in lightmap space, so you have to calculate the translucency results in the same space and there will be a 1-to-1 mapping from your translucency to the meta pass.
@KEngelstoft Thank you for all you help. This might be a little off-topic but as this is the first time I’ll be using RenderTargets, I have some difficulties about understanding the whole process of using it with all the passes (deferred, forwardadd). And there is the lightmap space calculation I need to dig it too.
I can output the result of those passes to another rendering target in addition to its regular output ? How ?
Thank you again for all the precisions you’re giving. I hope this will be useful to someone else too.