[2.0xx] How to set multiple render targets for a fragment shader?
in
Core Library Questions
•
9 months ago
I've been looking for a way to get the depth map of the scene. If there are alternatives to my current method let me know. For now I am now using shaders to get it. Once I get to the fragment shader I have both the color (vertColor) that you would normally use and the depth (depthColor) which I want for my depth map. Of course gl_FragColor only outputs a single color.
On the internet people say it is possible with GLSL while other say it is not possible with GLSL ES 2.0.
Is it possible in Processing 2.0xx to output to multiple render targets from a fragment shader?
Fragment shader
On the internet people say it is possible with GLSL while other say it is not possible with GLSL ES 2.0.
Is it possible in Processing 2.0xx to output to multiple render targets from a fragment shader?
Fragment shader
- varying vec4 vertColor;
- varying vec4 depthColor;
- void main()
- {
- gl_FragColor = depthColor;
- }
1