c++ - Quick question about glColorMask and its work -
i want render depth buffer nice shadow mapping. drawing code though, consists of many shader switches. if set glcolormask(0,0,0,0)
, leave shader programs, textures , others are, , render depth buffer, 'ok' ? mean, if glcolormask disables "write of color components", mean per-fragment shading is not going performed?
for rendering shadow map, want bind depth texture (preferrably square , power of two, because stereo drivers take hint!) fbo , use 1 shader (as simple possible) everything. not want attach color buffer, because not interested in color @ all, , puts more unnecessary pressure on rop (plus, hardware can render double speed or more depth-only). not want switch between many shaders.
depending on whether "classic" shadow mapping, or more sophisticated such exponential shadow maps, shader use either simple can (constant color, , no depth write), or performs (moderately complex) calculations on depth, not want perform colour calculations, since mean needless calculations not visible in way.
Comments
Post a Comment