1

From inside the shader I can't modify uniforms or attributes. Is there a way I could write a variable that I can use outside the shader?

My goal is to determine the lowest and the highest vertex on the z-axis. I could of course run through all the vertices in a for loop, but the shader runs through them anyway and is faster.

1 Answer 1

2

Not really. The shader's output, always, is pixels. Anything other than that would violate the stream-processing nature of the GPU. You could read the result pixel values...

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.