Z-issue - question

haho

Newcomer
How to avoid Z - artefacts when composing lights in backbuffer? :?: I tried to offset Z values trough depth bias & depth slope scale, or near plane shifting. But when transforming object light layers are still oscillatory on it. :LOL: In static rendereng or view transformation image is OK. any idea how to solve this issue? :cry:
 
1. do not bias/offset Z's.
2. use LESSEQUAL or EQUAL for non-first passes.
3. transform vertices in all passes absolutely identically. This also says: don't mix vertex shaders and fixed function for light passes - either all in fixed, or all in shader.
 
NeARAZ said:
3. transform vertices in all passes absolutely identically. This also says: don't mix vertex shaders and fixed function for light passes - either all in fixed, or all in shader.

may the reason for this be in calculating clip matrix for every pass:

clip = obj*view*proj?

10x for reply :D
 
10xxxxxxxxxxxx ;) . now I compute clip matrix for all objects for each frame and use this matrices in shaders for all passes...it work :D :D :D
 
haho said:
may the reason for this be in calculating clip matrix for every pass
Well, if in each pass all the matrices (obj, view and proj) are absolutely identical, and you're multiplying them identically (with the same multiplication function), and aren't fiddling with FPU precision in between, then the final matrices should be identical as well...
Of course, computing the matrix once is a good optimization on it's own (even more, if you don't need obj*view matrix, you can compute view*proj once each frame, and the final matrix calculation is just one matrix mul: obj*(view*proj)).
 
Back
Top