attempted to use z prepass for terrain objects, since most slowdown seen for voxel terrain with complex frag shader making many samples. see 9669a4178c3269c7c7d1eef18862367a71ed4767
appears that "early z" discard is not happening because I am using custom depth drawing. result is that zprepass on is slower than off. if so, draw order is irrelevant!
ideas:
a) move custom z earlier in frag shader. does this then discard?
b) stop using custom z. accept some z-fighting or redesign levels to avoid.
c) check against depth texture, as do already with sea, and explicitly discard. means more vert shader work, though without fog, prepass relatively inexpensive.
d) move to typical deferred renderer. overdraw should matter much less.
attempted to use z prepass for terrain objects, since most slowdown seen for voxel terrain with complex frag shader making many samples. see 9669a4178c3269c7c7d1eef18862367a71ed4767 appears that "early z" discard is not happening because I am using custom depth drawing. result is that zprepass on is slower than off. if so, draw order is irrelevant!
ideas: a) move custom z earlier in frag shader. does this then discard? b) stop using custom z. accept some z-fighting or redesign levels to avoid. c) check against depth texture, as do already with sea, and explicitly discard. means more vert shader work, though without fog, prepass relatively inexpensive. d) move to typical deferred renderer. overdraw should matter much less.
try a. else c?