Deferred shading. Position Conversion #618
-
In the document "Redesign of the rendering pipeline", GBuffer assumed the output of the "position". He's not here right now. I guess this was abandoned in favor of converting the pixel position from the depth buffer. I am currently working on a lighting implementation from PointLight and I am trying to use this feature in a shader.
Of course, nothing happens so easily and the light source begins to wander around the stage ) I have two questions:
|
Beta Was this translation helpful? Give feedback.
Replies: 4 comments
-
Hmm, the first question is removed, I calculated vViewPosition incorrectly. If anyone needs it, it looks like this:
The question of how to add your own buffers to GBuffer remains relevant |
Beta Was this translation helpful? Give feedback.
-
That should technically be possible by passing a GBufferConfig with additional data into GeometryPass. Rendering to the custom texture attachment would have to be implemented by modifying one of three's
Thanks for that snippet. The |
Beta Was this translation helpful? Give feedback.
-
I've added support for From what I've read, lighting calculations should either be done in view space or world space. If you need the world position, you can |
Beta Was this translation helpful? Give feedback.
-
Also, the parameters of
|
Beta Was this translation helpful? Give feedback.
I've added support for
GData.POSITION
in[email protected]
. If an Effect specifiesGBuffer.DEPTH
as input and accessesgData.position
, the field will be populated with the view position.From what I've read, lighting calculations should either be done in view space or world space. If you need the world position, you can
#include <pp_world_utils_pars_fragment>
and then usegetWorldPosition(gData.position, uv)
.