1 reply [Last post]
User offline. Last seen 9 years 25 weeks ago. Offline
Joined: 06/01/2012

Hi again ;).

Is there any way to debug a shader or print some values to the console?

My shader does not work as expected and I'd like to check the values of the vars.

Brad Larson
Brad Larson's picture
User offline. Last seen 4 years 51 weeks ago. Offline
Joined: 05/14/2008

If you think about the way that a fragment shader works (running in parallel once for each pixel), the only really effective way to debug one is to log out values in the color components and check those values to make sure that the shader is working right at each step. NSLog and printf() really have no meaning for the way these shaders operate.

Syndicate content