Multipass Rendering

Dear OpenglProgrammers,

How to implement Multipass Rendering using Opengl and GLSL.

Any examples will be of great use.

Thanks in advance
RAJESH.R

  • enable depth test
  • render depth (and optionally ambient color)
  • enable additive blending
  • disable depth test

for each light:

  • render lighting

  • disable additive blending

Actually, you want to keep depth test enabled, and disable depth writes. It should be:

*enable depth test
*for each frame:
 *set depth test to GL_LEQUAL or GL_LESS
 *enable depth writes
 *disable color writes (unless you want ambient)
 *render
 *disable depth writes
 *enable color writes
 *set depth test to GL_EQUAL
 *enable additive blending
 *for each light:
  *render lighting
 *disable additive blending

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.