The objective here is to change the color of the nearest object. (the nearer the object, the more "colorful" the object gets rendered; and the farther away, the more "grey" the object gets rendered), so far away objects are completely grey and close objects are in full color.
How I'm thinking about this so far:
You know, every frame, there is this certain float value, which determines if a pixel should be drawn or not. (aka z-buffer)
Can anyone tell me the variable - name of it? Or how can I access it? Can I even access it?
Edit:
The GPU is comparing two values: the depth of the new fragment you're drawing (a) and the depth value of whatever's already been drawn in that spot of the depth buffer (b).
Typically if b <= a it skips drawing the fragment because it's behind whatever's already been rendered previously.
I think I need both (a) and (b) variables - since I always need the nearer one.
Im not sure though... I think its also fine if I could only access the (b) and check every frame if the previous b was smaller.
No comments:
Post a Comment